mirror of
https://github.com/CorsixTH/CorsixTH.git
synced 2025-07-23 04:13:01 +02:00
CTest fixes
* Allow ctest to run from build dir * Remove extra libs linked to ctest * Prevent test from running twice Manually adding tests isn't useful as we have catch_discover_tests which does the same thing on a granular basis for catch2
This commit is contained in:
@@ -64,6 +64,10 @@ endif()
|
|||||||
|
|
||||||
project(CorsixTH_Top_Level)
|
project(CorsixTH_Top_Level)
|
||||||
|
|
||||||
|
if(ENABLE_UNIT_TESTS)
|
||||||
|
enable_testing()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
|
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -266,7 +266,6 @@ endif()
|
|||||||
if(ENABLE_UNIT_TESTS)
|
if(ENABLE_UNIT_TESTS)
|
||||||
message("Building Unit Tests")
|
message("Building Unit Tests")
|
||||||
# Enable testing if set at this level so we can use CTest from the root of the build dir
|
# Enable testing if set at this level so we can use CTest from the root of the build dir
|
||||||
enable_testing()
|
|
||||||
add_subdirectory(${PROJECT_SOURCE_DIR}/CppTest)
|
add_subdirectory(${PROJECT_SOURCE_DIR}/CppTest)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -39,16 +39,13 @@ add_custom_target(AllTests)
|
|||||||
add_executable(UnitTests "")
|
add_executable(UnitTests "")
|
||||||
target_link_libraries(UnitTests
|
target_link_libraries(UnitTests
|
||||||
Catch2::Catch2WithMain
|
Catch2::Catch2WithMain
|
||||||
CorsixTH_lib
|
CorsixTH_lib)
|
||||||
${LUA_LIBRARY}
|
|
||||||
${CMAKE_DL_LIBS})
|
|
||||||
|
|
||||||
set_property(TARGET UnitTests PROPERTY CXX_STANDARD 14)
|
set_property(TARGET UnitTests PROPERTY CXX_STANDARD 14)
|
||||||
set_property(TARGET UnitTests PROPERTY CXX_EXTENSIONS OFF)
|
set_property(TARGET UnitTests PROPERTY CXX_EXTENSIONS OFF)
|
||||||
set_property(TARGET UnitTests PROPERTY CXX_STANDARD_REQUIRED ON)
|
set_property(TARGET UnitTests PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
# Add the target to CTest
|
# Add the target to CTest
|
||||||
add_test(NAME UnitTests COMMAND UnitTests)
|
|
||||||
set_target_properties(UnitTests PROPERTIES FOLDER UnitTests)
|
set_target_properties(UnitTests PROPERTIES FOLDER UnitTests)
|
||||||
|
|
||||||
# Make sure we add it as a dependency to all tests (some day we can add LuaTest here)
|
# Make sure we add it as a dependency to all tests (some day we can add LuaTest here)
|
||||||
|
@@ -25,9 +25,7 @@ build:
|
|||||||
verbosity: minimal
|
verbosity: minimal
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- cd CorsixTH
|
|
||||||
- cmd: ctest --extra-verbose --build-config Release --output-on-failure
|
- cmd: ctest --extra-verbose --build-config Release --output-on-failure
|
||||||
- cd ..
|
|
||||||
|
|
||||||
after_build:
|
after_build:
|
||||||
- curl -L -o %APPVEYOR_BUILD_FOLDER%/CorsixTH/Release/FluidR3.sf3 https://github.com/Jacalz/fluid-soundfont/raw/master/SF3/FluidR3.sf3
|
- curl -L -o %APPVEYOR_BUILD_FOLDER%/CorsixTH/Release/FluidR3.sf3 https://github.com/Jacalz/fluid-soundfont/raw/master/SF3/FluidR3.sf3
|
||||||
|
Reference in New Issue
Block a user