Commit 35733c9d authored by Martin Heistermann's avatar Martin Heistermann
Browse files

run tests in Linux CI

parent 032c26fe
......@@ -10,8 +10,8 @@ test-linux:
- mkdir build
- cd build
- cmake ../CI -G Ninja
- ninja
- cmake --build .
- ctest .
test-windows:
tags:
......
......@@ -8,19 +8,10 @@ project(CMakeLibraryCITest)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../finders")
# find every package *twice* - this way we can see if it handles this robustly, e.g.
# not creating targets that already exist.
find_package(GMM)
find_package(Gurobi)
# First, find *without* REQUIRED - this way, we can get output from all finders, even if one fails.
find_package(GMM )
find_package(Gurobi )
# Then, repeat *with* REQUIRED:
find_package(GMM REQUIRED)
find_package(Gurobi REQUIRED)
enable_testing()
add_subdirectory(tests)
file(GLOB tests
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
CONFIGURE_DEPENDS
......@@ -9,3 +10,20 @@ foreach(test ${tests})
add_subdirectory("${test}")
endif()
endforeach()
#[[==
maybe run configure/build as test?
cf https://cliutils.gitlab.io/modern-cmake/chapters/testing.html
add_test(
NAME
ExampleCMakeBuild
COMMAND
"${CMAKE_CTEST_COMMAND}"
--build-and-test "${My_SOURCE_DIR}/examples/simple"
"${CMAKE_CURRENT_BINARY_DIR}/simple"
--build-generator "${CMAKE_GENERATOR}"
--test-command "${CMAKE_CTEST_COMMAND}"
)
==]]
find_package(Gurobi REQUIRED)
add_executable(test_c "test_c.c")
target_link_libraries(test_c Gurobi::Gurobi)
add_test(NAME test_c COMMAND test_c)
add_executable(test_cxx "test_cxx.cc")
target_link_libraries(test_cxx Gurobi::GurobiCXX)
add_test(NAME test_cxx COMMAND test_cxx)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment