Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cmake
cmake-library
Commits
35733c9d
Commit
35733c9d
authored
Sep 06, 2019
by
Martin Heistermann
Browse files
run tests in Linux CI
parent
032c26fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
35733c9d
...
...
@@ -10,8 +10,8 @@ test-linux:
-
mkdir build
-
cd build
-
cmake ../CI -G Ninja
-
ninja
-
cmake --build .
-
ctest .
test-windows
:
tags
:
...
...
CI/CMakeLists.txt
View file @
35733c9d
...
...
@@ -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
)
CI/tests/CMakeLists.txt
View file @
35733c9d
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}"
)
==]]
CI/tests/Gurobi/CMakeLists.txt
View file @
35733c9d
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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment