Skip to content
Snippets Groups Projects
Unverified Commit 8bfb74ca authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony Committed by GitHub
Browse files

Fix MantidPlot ctest PYTHONPATH for Windows

parent 885caf22
No related branches found
No related tags found
No related merge requests found
......@@ -910,7 +910,16 @@ else ()
endif ()
# Add an environment property MANTID_SOURCE so that the script can find the source of xmlrunner
set (TEST_ENVIRONMENT "MANTID_SOURCE=${CMAKE_SOURCE_DIR};PYTHONPATH=$ENV{PYTHONPATH}:${PYTHON_XMLRUNNER_DIR};MANTID_SCREENSHOT_REPORT=${SCREENSHOTS_DIR}" )
if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" )
set ( _python_path $ENV{PYTHONPATH};${PYTHON_XMLRUNNER_DIR} )
# cmake list separator and Windows environment seprator are the same so escape the cmake one
string ( REPLACE ";" "\\;" _python_path "${_python_path}" )
else()
set ( _python_path $ENV{PYTHONPATH}:${PYTHON_XMLRUNNER_DIR} )
endif ()
list ( APPEND _test_environment "PYTHONPATH=${_python_path}" )
list ( APPEND _test_environment "MANTID_SOURCE=${CMAKE_SOURCE_DIR}" )
list ( APPEND _test_environment "MANTID_SCREENSHOT_REPORT=${SCREENSHOTS_DIR}" )
# Make a ctest target for each file
foreach ( PYFILE ${MANTIDPLOT_TEST_PY_FILES} )
# Add the test. Name of test = name of the file
......@@ -918,7 +927,7 @@ foreach ( PYFILE ${MANTIDPLOT_TEST_PY_FILES} )
# Set the previously-built environment
set_tests_properties ( ${PYFILE} PROPERTIES
RUN_SERIAL 1
ENVIRONMENT "${TEST_ENVIRONMENT}"
ENVIRONMENT "${_test_environment}"
TIMEOUT ${TESTING_TIMEOUT} )
endforeach ()
......
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