Skip to content

Commit 1156296

Browse files
fuhlig1dennisklein
authored andcommitted
test: Add unit tests for FairGeoSets
Co-authored-by: @dennisklein
1 parent 5a3fc30 commit 1156296

File tree

17 files changed

+346
-3
lines changed

17 files changed

+346
-3
lines changed

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
################################################################################
2-
# Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
2+
# Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
33
# #
44
# This software is distributed under the terms of the #
55
# GNU Lesser General Public Licence (LGPL) version 3, #
@@ -129,6 +129,7 @@ if (BUILD_MBS)
129129
set(BUILD_ONLINE ON)
130130
endif()
131131
option(BUILD_BASEMQ "Build the 'FairRoot::BaseMQ' library" ON)
132+
Option(BUILD_EXAMPLES "Build Examples" ON)
132133

133134
# searches for needed packages
134135
# REQUIRED means that cmake will stop if this packages are not found
@@ -231,6 +232,10 @@ if(BUILD_BASEMQ OR BUILD_EXAMPLES)
231232
)
232233
endif()
233234

235+
if(BUILD_EXAMPLES)
236+
find_package2(PRIVATE fmt REQUIRED)
237+
endif()
238+
234239
If (Boost_FOUND)
235240
Set(Boost_Avail 1)
236241
Else (Boost_FOUND)
@@ -291,7 +296,6 @@ if(BUILD_DOXYGEN)
291296
endif()
292297
endif(BUILD_DOXYGEN)
293298

294-
Option(BUILD_EXAMPLES "Build Examples" ON)
295299
if(BUILD_EXAMPLES)
296300
add_subdirectory(examples)
297301
endif(BUILD_EXAMPLES)

tests/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
################################################################################
2-
# Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
2+
# Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
33
# #
44
# This software is distributed under the terms of the #
55
# GNU Lesser General Public Licence (LGPL) version 3, #
@@ -10,4 +10,8 @@
1010
set(test_prefix test)
1111

1212
add_subdirectory(base)
13+
add_subdirectory(geobase)
14+
15+
add_subdirectory(examples)
16+
1317
add_subdirectory(tgeo)

tests/examples/CMakeLists.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
################################################################################
2+
# Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
3+
# #
4+
# This software is distributed under the terms of the #
5+
# GNU Lesser General Public Licence (LGPL) version 3, #
6+
# copied verbatim in the file "LICENSE" #
7+
################################################################################
8+
9+
# Temporarily disabled, see https://github.com/FairRootGroup/FairRoot/issues/1523
10+
# if(TARGET FairRoot::ExSimulation1)
11+
# add_subdirectory(simulation/Tutorial1)
12+
# endif()
13+
if(TARGET FairRoot::ExSimulation2)
14+
add_subdirectory(simulation/Tutorial2)
15+
endif()
16+
if(TARGET FairRoot::ExSimulation4)
17+
add_subdirectory(simulation/Tutorial4)
18+
endif()
19+
if(TARGET FairRoot::ExTestDetector)
20+
add_subdirectory(advanced/Tutorial3)
21+
endif()
22+
if(TARGET FairRoot::ExPropagator)
23+
add_subdirectory(advanced/propagator)
24+
endif()
25+
if(TARGET FairRoot::ExPixel)
26+
add_subdirectory(MQ/pixelDetector)
27+
endif()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
################################################################################
2+
# Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
3+
# #
4+
# This software is distributed under the terms of the #
5+
# GNU Lesser General Public Licence (LGPL) version 3, #
6+
# copied verbatim in the file "LICENSE" #
7+
################################################################################
8+
9+
# Test suite for the `FairRoot::ExPixel` library
10+
11+
set(suite ExPixel)
12+
set(exe "${test_prefix}_${suite}")
13+
add_executable(${exe}
14+
test_PixelGeo.cxx
15+
)
16+
target_link_libraries(${exe} PRIVATE
17+
FairRoot::ExPixel
18+
FairRoot::GeoBase_checks
19+
Catch2::Catch2WithMain
20+
)
21+
catch_discover_tests(${exe} TEST_PREFIX "${suite}::")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/********************************************************************************
2+
* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3+
* *
4+
* This software is distributed under the terms of the *
5+
* GNU Lesser General Public Licence (LGPL) version 3, *
6+
* copied verbatim in the file "LICENSE" *
7+
********************************************************************************/
8+
9+
#include "tests/geobase/checks_FairGeoSet.h"
10+
11+
#include <PixelGeo.h>
12+
#include <catch2/catch_test_macros.hpp>
13+
14+
TEST_CASE("PixelGeo")
15+
{
16+
PixelGeo geo;
17+
18+
fairroot::tests::checkGeoSetNamingConventions(geo, "Pixel", 10);
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
################################################################################
2+
# Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
3+
# #
4+
# This software is distributed under the terms of the #
5+
# GNU Lesser General Public Licence (LGPL) version 3, #
6+
# copied verbatim in the file "LICENSE" #
7+
################################################################################
8+
9+
# Test suite for the `FairRoot::ExTestDetector` library
10+
11+
set(suite ExTestDetector)
12+
set(exe "${test_prefix}_${suite}")
13+
add_executable(${exe}
14+
test_FairTestDetectorGeo.cxx
15+
)
16+
target_link_libraries(${exe} PRIVATE
17+
FairRoot::ExTestDetector
18+
FairRoot::GeoBase_checks
19+
Catch2::Catch2WithMain
20+
)
21+
catch_discover_tests(${exe} TEST_PREFIX "${suite}::")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/********************************************************************************
2+
* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3+
* *
4+
* This software is distributed under the terms of the *
5+
* GNU Lesser General Public Licence (LGPL) version 3, *
6+
* copied verbatim in the file "LICENSE" *
7+
********************************************************************************/
8+
9+
#include "tests/geobase/checks_FairGeoSet.h"
10+
11+
#include <FairTestDetectorGeo.h>
12+
#include <catch2/catch_test_macros.hpp>
13+
14+
TEST_CASE("FairTestDetectorGeo")
15+
{
16+
FairTestDetectorGeo geo;
17+
18+
fairroot::tests::checkGeoSetNamingConventions(geo, "torino", 10);
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
################################################################################
2+
# Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
3+
# #
4+
# This software is distributed under the terms of the #
5+
# GNU Lesser General Public Licence (LGPL) version 3, #
6+
# copied verbatim in the file "LICENSE" #
7+
################################################################################
8+
9+
# Test suite for the `FairRoot::ExPropagator` library
10+
11+
set(suite ExPropagator)
12+
set(exe "${test_prefix}_${suite}")
13+
add_executable(${exe}
14+
test_FairTutPropGeo.cxx
15+
)
16+
target_link_libraries(${exe} PRIVATE
17+
FairRoot::ExPropagator
18+
FairRoot::GeoBase_checks
19+
Catch2::Catch2WithMain
20+
)
21+
catch_discover_tests(${exe} TEST_PREFIX "${suite}::")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/********************************************************************************
2+
* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3+
* *
4+
* This software is distributed under the terms of the *
5+
* GNU Lesser General Public Licence (LGPL) version 3, *
6+
* copied verbatim in the file "LICENSE" *
7+
********************************************************************************/
8+
9+
#include "tests/geobase/checks_FairGeoSet.h"
10+
11+
#include <FairTutPropGeo.h>
12+
#include <catch2/catch_test_macros.hpp>
13+
14+
TEST_CASE("FairTutPropGeo")
15+
{
16+
FairTutPropGeo geo;
17+
18+
fairroot::tests::checkGeoSetNamingConventions(geo, "Pixel", 10);
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
################################################################################
2+
# Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
3+
# #
4+
# This software is distributed under the terms of the #
5+
# GNU Lesser General Public Licence (LGPL) version 3, #
6+
# copied verbatim in the file "LICENSE" #
7+
################################################################################
8+
9+
# Test suite for the `FairRoot::ExSimulation1` library
10+
11+
set(suite ExSimulation1)
12+
set(exe "${test_prefix}_${suite}")
13+
add_executable(${exe}
14+
test_FairTutorialDet1Geo.cxx
15+
)
16+
target_link_libraries(${exe} PRIVATE
17+
FairRoot::ExSimulation1
18+
FairRoot::GeoBase_checks
19+
Catch2::Catch2WithMain
20+
)
21+
catch_discover_tests(${exe} TEST_PREFIX "${suite}::")

0 commit comments

Comments
 (0)