|
21 | 21 | # [ANSWER_DIR path]
|
22 | 22 | # [ANSWER_FIEL file]
|
23 | 23 | # [EXAMPLE_TYPE type]
|
24 |
| -# [TEST_ARGS arg1 arg2 ...]) |
| 24 | +# [TEST_ARGS arg1 arg2 ...] |
| 25 | +# [LABELS label1 label2 ...]) |
25 | 26 | # ~~~
|
26 | 27 | #
|
27 | 28 | # CMake macro to add a SUNDIALS regression test. Keyword input arguments can be
|
|
46 | 47 | #
|
47 | 48 | # The option EXAMPLE_TYPE set the example type i.e., release or develop examples
|
48 | 49 | #
|
| 50 | +# The option TEST_ARGS are command line arguments to pass to the executable |
| 51 | +# |
| 52 | +# The options LABELS are labels added to the test properties to easily run (or |
| 53 | +# exclude) groups of test with ctest -L <label> (or ctest -LE <label>) |
| 54 | +# |
49 | 55 | # When SUNDIALS_TEST_DEVTESTS is OFF (default) the executable is run and success
|
50 | 56 | # or failure is determined by the executable return value (zero or non-zero
|
51 | 57 | # respectively).
|
@@ -83,7 +89,7 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE)
|
83 | 89 | set(options "NODIFF")
|
84 | 90 | set(oneValueArgs "MPI_NPROCS" "FLOAT_PRECISION" "INTEGER_PRECISION"
|
85 | 91 | "ANSWER_DIR" "ANSWER_FILE" "EXAMPLE_TYPE")
|
86 |
| - set(multiValueArgs "TEST_ARGS" "EXTRA_ARGS") |
| 92 | + set(multiValueArgs "LABELS" "TEST_ARGS" "EXTRA_ARGS") |
87 | 93 |
|
88 | 94 | # parse inputs and create variables SUNDIALS_ADD_TEST_<keyword>
|
89 | 95 | cmake_parse_arguments(SUNDIALS_ADD_TEST "${options}" "${oneValueArgs}"
|
@@ -282,6 +288,14 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE)
|
282 | 288 |
|
283 | 289 | endif()
|
284 | 290 |
|
| 291 | + if(SUNDIALS_TEST_DEVTESTS OR NOT SUNDIALS_ADD_TEST_EXAMPLE_TYPE) |
| 292 | + # set any labels (must quote SUNDIALS_ADD_TEST_LABELS) |
| 293 | + if(SUNDIALS_ADD_TEST_LABELS) |
| 294 | + set_tests_properties(${NAME} PROPERTIES LABELS |
| 295 | + "${SUNDIALS_ADD_TEST_LABELS}") |
| 296 | + endif() |
| 297 | + endif() |
| 298 | + |
285 | 299 | endif()
|
286 | 300 |
|
287 | 301 | endmacro()
|
0 commit comments