Skip to content
Snippets Groups Projects
Commit fb3cdf4a authored by Frank Gaede's avatar Frank Gaede
Browse files

- added script run_tests.sh to run

    the tests after initializing w/ thisdd4hep.sh
parent 411c607c
No related branches found
No related tags found
No related merge requests found
......@@ -84,11 +84,15 @@ add_subdirectory(UtilityApps)
#---Configuration-------------------------------------------------------------------
configure_file(cmake/thisdd4hep.csh thisdd4hep.csh @ONLY)
configure_file(cmake/thisdd4hep.sh thisdd4hep.sh @ONLY)
configure_file(cmake/run_test.sh run_test.sh @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/thisdd4hep.csh ${CMAKE_BINARY_DIR}/thisdd4hep.sh
DESTINATION bin
)
install(PROGRAMS ${CMAKE_BINARY_DIR}/run_test.sh
DESTINATION bin
)
# PERMISSIONS OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, GROUP_READ, GROUP_EXECUTE, WORLD_READ, WORLD_EXECUTE,
#-----------------------------------------------------------------------------------
display_std_variables()
......
......@@ -4,6 +4,7 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/DDCore/include
${CMAKE_SOURCE_DIR}/DDG4/include
${CMAKE_SOURCE_DIR}/DDSegmentation/include
${CMAKE_SOURCE_DIR}/include
${ROOT_INCLUDE_DIR}
......@@ -11,16 +12,18 @@ include_directories(
link_libraries(DD4hepG4 DD4hepCore DDSegmentation ${ROOT_LIBRARIES} Reflex ${Geant4_LIBRARIES})
#--------------------------------------------------
#ADD_TEST( t_init source "${CMAKE_CURRENT_WORK_DIR}/thisdd4hep.sh" )
SET( test_name "test_example" )
ADD_EXECUTABLE( ${test_name} ./src/${test_name}.cc )
ADD_TEST( t_${test_name} "${EXECUTABLE_OUTPUT_PATH}/${test_name}" )
ADD_EXECUTABLE(${test_name} ./src/${test_name}.cc )
ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test.sh" ${EXECUTABLE_OUTPUT_PATH}/${test_name} )
SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES PASS_REGULAR_EXPRESSION "TEST_PASSED" )
SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "TEST_FAILED" )
SET( test_name "test_units" )
ADD_EXECUTABLE( ${test_name} ./src/${test_name}.cc )
ADD_TEST( t_${test_name} "${EXECUTABLE_OUTPUT_PATH}/${test_name}" ${CMAKE_CURRENT_SOURCE_DIR}/units.xml )
ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test.sh"
${EXECUTABLE_OUTPUT_PATH}/${test_name} ${CMAKE_CURRENT_SOURCE_DIR}/units.xml )
SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES PASS_REGULAR_EXPRESSION "TEST_PASSED" )
SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "TEST_FAILED" )
......
#!/bin/bash
#
# Simple script to run DD4hep tests
# - sources thisdd4hep.sh first and then
# calls the command (given as first argument)
# with all following arguments
#
# ---- initialize DD4hep for this shell
. @CMAKE_INSTALL_PREFIX@/bin/thisdd4hep.sh
#----- parse command line - first argument is the
# test to run
command=$1
theargs=""
shift
for i in "$@" ; do
if [ $i != ${command} ] ; then
theargs="${theargs} $i"
fi
done
echo "---running test : '" ${command} ${theargs} "'"
${command} ${theargs}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment