Commit 366f3428 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

fixed an issue in setting the test-specific runtime environment

parent b356b986
......@@ -17,5 +17,5 @@ INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${python_cmd} -m compileall ${CMAKE_INSTA
gaudi_add_test(QMTest QMTEST
ENVIRONMENT
JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/tests/pyjobopts:${CMAKE_CURRENT_SOURCE_DIR}/tests
PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}/tests/python)
PYTHONPATH+=${CMAKE_CURRENT_SOURCE_DIR}/tests/python)
......@@ -76,9 +76,4 @@ gaudi_add_test(QMTest QMTEST
ENVIRONMENT
STDOPTS=${CMAKE_CURRENT_SOURCE_DIR}/options
JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/options
GAUDIEXAMPLESROOT=${CMAKE_CURRENT_SOURCE_DIR}
PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}/tests/qmtest)
gaudi_env(SET STDOPTS \${GAUDIEXAMPLESROOT}/options
PREPEND JOBOPTSEARCHPATH \${STDOPTS}
PREPEND PYTHONPATH \${GAUDIEXAMPLESROOT}/tests/qmtest)
PYTHONPATH+=${CMAKE_CURRENT_SOURCE_DIR}/tests/qmtest)
......@@ -43,7 +43,7 @@ gaudi_install_python_modules()
gaudi_install_scripts()
#---Test-----------------------------------------------------------------------
gaudi_add_test(QMTest QMTEST ENVIRONMENT GAUDIKERNELROOT=${CMAKE_CURRENT_SOURCE_DIR})
gaudi_add_test(QMTest QMTEST)
#---Special options
if(HIDE_WARNINGS)
......
......@@ -25,4 +25,4 @@ if(BUILD_TESTS)
endif()
#---Test-----------------------------------------------------------------------
gaudi_add_test(QMTest QMTEST ENVIRONMENT GAUDISVCROOT=${CMAKE_CURRENT_SOURCE_DIR})
gaudi_add_test(QMTest QMTEST)
......@@ -1030,8 +1030,16 @@ endfunction()
#-------------------------------------------------------------------------------
# gaudi_add_test(<name>
# [FRAMEWORK options1 options2 ...|QMTEST|COMMAND cmd args ...]
# [ENVIRONMENT variable=value ...])
# [ENVIRONMENT variable[+]=value ...])
#
# Declare a run-time test in the subdirectory.
# The test can be of the types:
# FRAMEWORK - run a job with the specified options
# QMTEST - run the QMTest tests in the standard directory
# COMMAND - execute a command
# If special environment settings are needed, they can be specified in the
# section ENVIRONMENT as <var>=<value> or <var>+=<value>, where the secon format
# prepends the value to the PATH-like variable.
#-------------------------------------------------------------------------------
function(gaudi_add_test name)
CMAKE_PARSE_ARGUMENTS(ARG "QMTEST" "" "ENVIRONMENT;FRAMEWORK;COMMAND" ${ARGN})
......@@ -1043,7 +1051,9 @@ function(gaudi_add_test name)
set(ARG_ENVIRONMENT ${ARG_ENVIRONMENT}
QMTESTLOCALDIR=${CMAKE_CURRENT_SOURCE_DIR}/tests/qmtest
QMTESTRESULTS=${CMAKE_CURRENT_BINARY_DIR}/tests/qmtest/results.qmr
QMTESTRESULTSDIR=${CMAKE_CURRENT_BINARY_DIR}/tests/qmtest)
QMTESTRESULTSDIR=${CMAKE_CURRENT_BINARY_DIR}/tests/qmtest
QMTEST_CLASS_PATH+=${CMAKE_SOURCE_DIR}/GaudiPolicy/qmtest_classes
GAUDI_QMTEST_HTML_OUTPUT=${CMAKE_BINARY_DIR}/test_results)
set(cmdline run_qmtest.py ${package})
elseif(ARG_FRAMEWORK)
......@@ -1064,7 +1074,14 @@ function(gaudi_add_test name)
endif()
foreach(var ${ARG_ENVIRONMENT})
set(extra_env ${extra_env} -s ${var})
string(FIND ${var} "+=" is_prepend)
if(NOT is_prepend LESS 0)
# the argument contains +=
string(REPLACE "+=" "=" var ${var})
set(extra_env ${extra_env} -p ${var})
else()
set(extra_env ${extra_env} -s ${var})
endif()
endforeach()
add_test(${package}.${name}
......@@ -1074,9 +1091,6 @@ function(gaudi_add_test name)
-p ${ld_library_path}=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-p PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-p QMTEST_CLASS_PATH=${CMAKE_SOURCE_DIR}/GaudiPolicy/qmtest_classes
-s GAUDI_QMTEST_HTML_OUTPUT=${CMAKE_BINARY_DIR}/test_results
--xml ${env_xml}
${cmdline})
endfunction()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment