Skip to content

Commit

Permalink
use the python wrapper in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gipert committed Dec 28, 2024
1 parent eeb92f5 commit 5db8ac6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
5 changes: 5 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
cmake_minimum_required(VERSION 3.8)
project(remage-tests)

# this can be used as the path to the remage executable in the tests
# in case the remage-cpp executable is needed, one can just use the
# "remage-cli-cpp" target name (see add_test() docs)
get_target_property(REMAGE_PYEXE remage-cli PYEXE_PATH)

add_subdirectory(basics)
add_subdirectory(confinement)
add_subdirectory(internals)
Expand Down
8 changes: 4 additions & 4 deletions tests/basics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ set(_macros_extra run-2nbb.mac)
set(_macros_vis vis-co60.mac vis-2nbb.mac)

foreach(_mac ${_macros} ${_macros_extra} ${_macros_vis})
add_test(NAME basics/${_mac} COMMAND remage-cli-cpp -g gdml/main.gdml -- macros/${_mac})
add_test(NAME basics/${_mac} COMMAND ${REMAGE_PYEXE} -g gdml/main.gdml -- macros/${_mac})
endforeach()

foreach(_mac ${_macros})
add_test(NAME basics-mt/${_mac} COMMAND remage-cli-cpp -g gdml/main.gdml -t 2 macros/${_mac})
add_test(NAME basics-mt/${_mac} COMMAND ${REMAGE_PYEXE} -g gdml/main.gdml -t 2 macros/${_mac})
set_tests_properties(basics-mt/${_mac} PROPERTIES LABELS mt)
endforeach()

Expand All @@ -29,7 +29,7 @@ endif()

if(BxDecay0_THREADSAFE)
foreach(_mac ${_macros_extra})
add_test(NAME basics-mt/${_mac} COMMAND remage-cli-cpp -g gdml/main.gdml -t 2 macros/${_mac})
add_test(NAME basics-mt/${_mac} COMMAND ${REMAGE_PYEXE} -g gdml/main.gdml -t 2 macros/${_mac})
set_tests_properties(basics-mt/${_mac} PROPERTIES LABELS "mt extra")
endforeach()

Expand All @@ -49,6 +49,6 @@ set_tests_properties(${_macros_vis} PROPERTIES SKIP_REGULAR_EXPRESSION "couldn't
# further specific tests.

# expect two overlaps from this prepared geometry.
add_test(NAME basics/overlaps.mac COMMAND remage-cli-cpp -- macros/overlaps.mac)
add_test(NAME basics/overlaps.mac COMMAND ${REMAGE_PYEXE} -- macros/overlaps.mac)
set_tests_properties(basics/overlaps.mac PROPERTIES PASS_REGULAR_EXPRESSION
"GeomVol1002.*GeomVol1002")
6 changes: 3 additions & 3 deletions tests/confinement/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ set(_macros complex-volume.mac geometrical.mac native-surface.mac geometrical-an
geometrical-or-physical.mac native-volume.mac)

foreach(_mac ${_macros})
add_test(NAME confinement/${_mac} COMMAND remage-cli-cpp -g gdml/geometry.gdml -o test-out.root
add_test(NAME confinement/${_mac} COMMAND ${REMAGE_PYEXE} -g gdml/geometry.gdml -o test-out.root
-- macros/${_mac})

add_test(NAME confinement-mt/${_mac} COMMAND remage-cli-cpp -g gdml/geometry.gdml -t 2 -o
add_test(NAME confinement-mt/${_mac} COMMAND ${REMAGE_PYEXE} -g gdml/geometry.gdml -t 2 -o
test-out.root -- macros/${_mac})
set_tests_properties(confinement-mt/${_mac} PROPERTIES LABELS mt)

add_test(NAME confinement-vis/${_mac}
COMMAND remage-cli-cpp -g gdml/geometry.gdml -o test-out.root -- macros/_vis.mac
COMMAND ${REMAGE_PYEXE} -g gdml/geometry.gdml -o test-out.root -- macros/_vis.mac
macros/${_mac} macros/_vis-export.mac)
set_tests_properties(confinement-vis/${_mac} PROPERTIES LABELS vis)
set_tests_properties(confinement-vis/${_mac} PROPERTIES SKIP_REGULAR_EXPRESSION
Expand Down
7 changes: 1 addition & 6 deletions tests/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
get_target_property(REMAGE_PYEXE remage-cli PYEXE_PATH)

add_test(
NAME python/cli
COMMAND "${REMAGE_PYEXE}" -q
COMMAND "${REMAGE_PYEXE}" --help)
add_test(NAME python/cli COMMAND "${REMAGE_PYEXE}" -q --help)
5 changes: 3 additions & 2 deletions tests/vertex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ endforeach()
set(_macros vert-hdf5.mac vert-lh5.mac)

foreach(_mac ${_macros})
add_test(NAME vertex/${_mac} COMMAND remage-cli-cpp -g gdml/geometry.gdml -- macros/${_mac})
add_test(NAME vertex/${_mac} COMMAND ${REMAGE_PYEXE} -g gdml/geometry.gdml -- macros/${_mac})
set_tests_properties(vertex/${_mac} PROPERTIES LABELS extra)
add_test(NAME vertex-mt/${_mac} COMMAND remage-cli-cpp -g gdml/geometry.gdml -t 2 macros/${_mac})
add_test(NAME vertex-mt/${_mac} COMMAND ${REMAGE_PYEXE} -g gdml/geometry.gdml -t 2
macros/${_mac})
set_tests_properties(vertex-mt/${_mac} PROPERTIES LABELS "mt extra")
endforeach()

0 comments on commit 5db8ac6

Please sign in to comment.