Skip to content

Commit 7a3d2c3

Browse files
aphecetchedavidrohr
authored andcommitted
[CTest] Disable some tests in Debug mode
Just a small warning about the consequence of this change. Those tests where the CONFIGURATIONS option of `o2_add_test` is used will no longer be ran by a bare `ctest` command. One will need to be explicit about the configuration to be used, e.g. : ``` ctest -C RelWithDebInfo ``` Other tests are _not_ affected, i.e. `ctest` without the `-C` option will still run them.
1 parent 9ad45ec commit 7a3d2c3

5 files changed

Lines changed: 30 additions & 17 deletions

File tree

Detectors/MUON/MCH/Mapping/test/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ o2_add_test(StressTest3
5959
COMMAND_LINE_ARGS --testpos ${CMAKE_CURRENT_LIST_DIR}/data/test_random_pos.json --run2 --manunumbering
6060
PUBLIC_LINK_LIBRARIES O2::MCHMappingImpl3 O2::MCHMappingSegContour
6161
RapidJSON::RapidJSON
62+
CONFIGURATIONS RelWithDebInfo Release MinSizeRel
6263
LABELS "muon;mch;long")
6364

6465
o2_add_test(StressTest4
@@ -70,6 +71,7 @@ o2_add_test(StressTest4
7071
COMMAND_LINE_ARGS --testpos ${CMAKE_CURRENT_LIST_DIR}/data/test_random_pos.json --manunumbering
7172
PUBLIC_LINK_LIBRARIES O2::MCHMappingImpl4 O2::MCHMappingSegContour
7273
RapidJSON::RapidJSON
74+
CONFIGURATIONS RelWithDebInfo Release MinSizeRel
7375
LABELS "muon;mch;long")
7476

7577
if(benchmark_FOUND)

Detectors/TPC/reconstruction/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ o2_add_test(FastTransform
107107
LABELS tpc
108108
PUBLIC_LINK_LIBRARIES O2::TPCReconstruction
109109
SOURCES test/testTPCFastTransform.cxx
110-
ENVIRONMENT O2_ROOT=${CMAKE_BINARY_DIR}/stage) # CONFIGURATIONS RelWithDebInfo)
110+
ENVIRONMENT O2_ROOT=${CMAKE_BINARY_DIR}/stage
111+
CONFIGURATIONS RelWithDebInfo Release MinRelSize)
111112

112113
# FIXME: should be moved to TPCCalibration as it requires O2::TPCCalibration
113114
# which is built after TPCReconstruction

Detectors/TPC/spacecharge/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ o2_add_test(PoissonSolver
5555
PUBLIC_LINK_LIBRARIES O2::TPCSpaceCharge
5656
SOURCES test/testO2TPCPoissonSolver.cxx
5757
ENVIRONMENT O2_ROOT=${CMAKE_BINARY_DIR}/stage
58-
LABELS tpc)
58+
LABELS tpc
59+
CONFIGURATIONS RelWithDebInfo Release MinRelSize)
5960

6061
if (OpenMP_CXX_FOUND)
6162
target_compile_definitions(${targetName} PRIVATE WITH_OPENMP)

cmake/O2AddTestWrapper.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function(o2_add_test_wrapper)
131131
${testExe}
132132
${A_COMMAND_LINE_ARGS}
133133
WORKING_DIRECTORY "${A_WORKING_DIRECTORY}"
134-
CONFIGURATIONS "${A_CONFIGURATIONS}")
134+
CONFIGURATIONS ${A_CONFIGURATIONS})
135135

136136
set_tests_properties(${testName} PROPERTIES TIMEOUT ${ctestTimeout})
137137
if(A_LABELS)

doc/CMakeInstructions.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66

77
<!-- vim-markdown-toc GFM -->
88

9-
- [CMake and CTest tips for AliceO2](#cmake-and-ctest-tips-for-aliceo2)
10-
- [CMake](#cmake)
11-
- [Instructions for contributors (aka developers' documentation)](#instructions-for-contributors-aka-developers-documentation)
12-
- [Typical CMakeLists.txt](#typical-cmakeliststxt)
13-
- [Examples](#examples)
14-
- [Ex1 Adding a basic library](#ex1-adding-a-basic-library)
15-
- [Ex2 Adding a basic library with a Root dictionary](#ex2-adding-a-basic-library-with-a-root-dictionary)
16-
- [Ex3 Adding an executable](#ex3-adding-an-executable)
17-
- [Ex4 Adding a couple of tests](#ex4-adding-a-couple-of-tests)
18-
- [Ex5 Adding a man page](#ex5-adding-a-man-page)
19-
- [CTest](#ctest)
20-
- [Selecting/excluding by test name (-R/-E)](#selectingexcluding-by-test-name--r-e)
21-
- [Selecting/excluding by label (-L/-LE)](#selectingexcluding-by-label--l-le)
22-
- [Speeding up ctest execution](#speeding-up-ctest-execution)
9+
* [CMake and CTest tips for AliceO2](#cmake-and-ctest-tips-for-aliceo2)
10+
* [CMake](#cmake)
11+
* [Instructions for contributors (aka developers' documentation)](#instructions-for-contributors-aka-developers-documentation)
12+
* [Typical CMakeLists.txt](#typical-cmakeliststxt)
13+
* [Examples](#examples)
14+
* [Ex1 Adding a basic library](#ex1-adding-a-basic-library)
15+
* [Ex2 Adding a basic library with a Root dictionary](#ex2-adding-a-basic-library-with-a-root-dictionary)
16+
* [Ex3 Adding an executable](#ex3-adding-an-executable)
17+
* [Ex4 Adding a couple of tests](#ex4-adding-a-couple-of-tests)
18+
* [Ex5 Adding a man page](#ex5-adding-a-man-page)
19+
* [CTest](#ctest)
20+
* [Selecting/excluding by test name (-R/-E)](#selectingexcluding-by-test-name--r-e)
21+
* [Selecting/excluding by label (-L/-LE)](#selectingexcluding-by-label--l-le)
22+
* [Speeding up ctest execution](#speeding-up-ctest-execution)
2323

2424
<!-- vim-markdown-toc -->
2525

@@ -340,6 +340,15 @@ Tests can also be _excluded_ based on label (`-LE`) or name (`-RE`).
340340
dummy = 0.07 sec*proc (1 test)
341341
fast = 0.07 sec*proc (1 test)
342342

343+
Note as well that some (very few) tests are ran only for some configurations
344+
(aka build types). Those tests are _not_ ran automatically when using the bare
345+
`ctest` command. One has to explicitely specify the build type for those, e.g.
346+
:
347+
348+
```
349+
ctest -C RelWithDebInfo
350+
```
351+
343352
#### [Ex5](../Examples/Ex5) Adding a man page
344353

345354
If a module provides one or more executables, it might be of interest for the users of those executables to have access to a man page for them. Ex5 illustates that use case.

0 commit comments

Comments
 (0)