Skip to content
Snippets Groups Projects
Commit 85fe686b authored by Bienchen's avatar Bienchen Committed by BIOPZ-Johner Niklaus
Browse files

Message about missing Python test scripts

parent 16e708cc
No related branches found
No related tags found
No related merge requests found
...@@ -719,6 +719,10 @@ macro(promod3_unittest) ...@@ -719,6 +719,10 @@ macro(promod3_unittest)
endif() endif()
foreach(py_test ${PY_TESTS}) foreach(py_test ${PY_TESTS})
set(py_twp "${CMAKE_CURRENT_SOURCE_DIR}/${py_test}")
if(NOT EXISTS "${py_twp}")
message(FATAL_ERROR "Python test script does not exist: ${py_twp}")
endif()
set(python_path $ENV{PYTHONPATH}) set(python_path $ENV{PYTHONPATH})
if(python_path) if(python_path)
set(python_path "${python_path}:") set(python_path "${python_path}:")
...@@ -730,7 +734,7 @@ macro(promod3_unittest) ...@@ -730,7 +734,7 @@ macro(promod3_unittest)
"${python_path}${OST_ROOT}/${LIB_DIR}/python${PYTHON_VERSION}/site-packages") "${python_path}${OST_ROOT}/${LIB_DIR}/python${PYTHON_VERSION}/site-packages")
set (PY_TESTS_CMD "PYTHONPATH=${python_path} ${PYTHON_BINARY}") set (PY_TESTS_CMD "PYTHONPATH=${python_path} ${PYTHON_BINARY}")
add_custom_target("${py_test}_run" add_custom_target("${py_test}_run"
sh -c "${PY_TESTS_CMD} ${CMAKE_CURRENT_SOURCE_DIR}/${py_test}" sh -c "${PY_TESTS_CMD} ${py_twp}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "running checks ${py_test}" VERBATIM) COMMENT "running checks ${py_test}" VERBATIM)
add_dependencies("${py_test}_run" "test_data_${_ARG_MODULE}") add_dependencies("${py_test}_run" "test_data_${_ARG_MODULE}")
...@@ -739,7 +743,7 @@ macro(promod3_unittest) ...@@ -739,7 +743,7 @@ macro(promod3_unittest)
# continues and we get output for all unit tests. Just calling 'echo' # continues and we get output for all unit tests. Just calling 'echo'
# giveth $?=0. # giveth $?=0.
add_custom_target("${py_test}_run_xml" add_custom_target("${py_test}_run_xml"
sh -c "${PY_TESTS_CMD} ${CMAKE_CURRENT_SOURCE_DIR}/${py_test} xml || echo" sh -c "${PY_TESTS_CMD} ${py_twp} xml || echo"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "running checks ${py_test}" VERBATIM) COMMENT "running checks ${py_test}" VERBATIM)
add_dependencies("${py_test}_run_xml" "test_data_${_ARG_MODULE}") add_dependencies("${py_test}_run_xml" "test_data_${_ARG_MODULE}")
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment