From 4bf7b00013f7efe222d02171e176bb827a90fad9 Mon Sep 17 00:00:00 2001 From: hristo Date: Mon, 25 Jan 2021 11:44:30 +0200 Subject: [PATCH] Removing test file. (#1545) This test file is just testing compilation with the library works correctly but is no longer needed because: - it is not cross platform - it taps into the CTest system which is better suited for real unit/integration tests - it can be incorporated into the pipeline of github actions instead in the future --- .github/workflows/cmake.yml | 24 ++++++++++++------------ cmake/test-pkgconfig.sh | 21 --------------------- src/CMakeLists.txt | 3 --- 3 files changed, 12 insertions(+), 36 deletions(-) delete mode 100755 cmake/test-pkgconfig.sh diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 11aabbb0..52fbdd80 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -41,12 +41,12 @@ jobs: # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config $env:BUILD_TYPE -# - name: Test -# working-directory: ${{github.workspace}}/build -# shell: powershell -# # Execute tests defined by the CMake configuration. -# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail -# run: ctest -C $env:BUILD_TYPE + - name: Test + working-directory: ${{github.workspace}}/build + shell: powershell + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C $env:BUILD_TYPE build_linux: name: Linux Build @@ -85,9 +85,9 @@ jobs: # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config $BUILD_TYPE -# - name: Test -# working-directory: ${{github.workspace}}/build -# shell: bash -# # Execute tests defined by the CMake configuration. -# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail -# run: ctest -C $BUILD_TYPE \ No newline at end of file + - name: Test + working-directory: ${{github.workspace}}/build + shell: bash + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C $BUILD_TYPE \ No newline at end of file diff --git a/cmake/test-pkgconfig.sh b/cmake/test-pkgconfig.sh deleted file mode 100755 index ccbdfb65..00000000 --- a/cmake/test-pkgconfig.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# Test if including/linking/running an installed raylib works - -set -x -export LD_RUN_PATH=/usr/local/lib - -CFLAGS="-Wall -Wextra -Werror $CFLAGS" -if [ "$ARCH" = "i386" ]; then -CFLAGS="-m32 $CLFAGS" -fi - -cat << EOF | ${CC:-cc} -otest -xc - $(pkg-config --libs --cflags $@ raylib.pc) $CFLAGS && exec ./test -#include -#include - -int main(void) -{ - int num = GetRandomValue(42, 1337); - return 42 <= num && num <= 1337 ? EXIT_SUCCESS : EXIT_FAILURE; -} -EOF diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f6416dfe..a11f4efb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,7 +56,6 @@ add_library(raylib ${raylib_sources} ${raylib_public_headers}) if (NOT BUILD_SHARED_LIBS) MESSAGE(STATUS "Building raylib static library") add_library(raylib_static ALIAS raylib) - add_test("pkg-config--static" ${PROJECT_SOURCE_DIR}/../cmake/test-pkgconfig.sh --static) else() MESSAGE(STATUS "Building raylib shared library") if (MSVC) @@ -65,8 +64,6 @@ else() INTERFACE $ ) endif () - - add_test("pkg-config" ${PROJECT_SOURCE_DIR}/../cmake/test-pkgconfig.sh) endif() # Setting target properties