diff --git a/buildconfig/CMake/Bootstrap.cmake b/buildconfig/CMake/Bootstrap.cmake index f3da2c3fc3cbb832fc9d79a754a348368316c6bb..940906e2e5032412b1e08c391cdb60b365783567 100644 --- a/buildconfig/CMake/Bootstrap.cmake +++ b/buildconfig/CMake/Bootstrap.cmake @@ -113,6 +113,7 @@ if(MSVC) "The location of the pythonw executable. This suppresses the new terminal window on startup" FORCE ) + set(THIRD_PARTY_BIN "${THIRD_PARTY_DIR}/bin;${THIRD_PARTY_DIR}/lib/qt4/bin;${THIRD_PARTY_DIR}/lib/qt5/bin;${MSVC_PYTHON_EXECUTABLE_DIR}" ) diff --git a/buildconfig/CMake/MSVCSetup.cmake b/buildconfig/CMake/MSVCSetup.cmake index 3286a3d322361578820e1cc997ceede4d4ebe1bd..e5bb8cedc406c32b1ee3108aa4b66b40c1f2c558 100644 --- a/buildconfig/CMake/MSVCSetup.cmake +++ b/buildconfig/CMake/MSVCSetup.cmake @@ -128,18 +128,23 @@ else () set (PARAVIEW_PYTHON_PATHS "" ) endif () +set(MSVC_BIN_DIR ${PROJECT_BINARY_DIR}/bin/$<CONFIG>) + configure_file ( ${PACKAGING_DIR}/mantidpython.bat.in ${PROJECT_BINARY_DIR}/mantidpython.bat.in @ONLY ) # place it in the appropriate directory file(GENERATE OUTPUT - ${PROJECT_BINARY_DIR}/bin/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>/mantidpython.bat + ${MSVC_BIN_DIR}/mantidpython.bat INPUT ${PROJECT_BINARY_DIR}/mantidpython.bat.in ) # install version set ( MANTIDPYTHON_PREAMBLE "set PYTHONHOME=%_BIN_DIR%\nset PATH=%_BIN_DIR%;%_BIN_DIR%\\..\\plugins;%_BIN_DIR%\\..\\PVPlugins;%PATH%" ) +# Semi-colon gen exp prevents future generators converting to CMake lists +set ( MSVC_IDE_ENV "PYTHONPATH=${MSVC_BIN_DIR}$<SEMICOLON>PYTHONHOME=${MSVC_PYTHON_EXECUTABLE_DIR}" ) + if (MAKE_VATES) set ( PV_LIBS "%_BIN_DIR%\\..\\lib\\paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}") set ( PARAVIEW_PYTHON_PATHS ";${PV_LIBS}\\site-packages;${PV_LIBS}\\site-packages\\vtk" ) @@ -150,6 +155,17 @@ endif () configure_file ( ${PACKAGING_DIR}/mantidpython.bat.in ${PROJECT_BINARY_DIR}/mantidpython.bat.install @ONLY ) +########################################################################## +# Custom targets to fix-up and run Python entry point code +########################################################################## + +add_custom_target(SystemTests) +add_dependencies(SystemTests Framework StandardTestData SystemTestData) +set_target_properties(SystemTests PROPERTIES + VS_DEBUGGER_COMMAND "${PYTHON_EXECUTABLE}" + VS_DEBUGGER_COMMAND_ARGUMENTS "${CMAKE_SOURCE_DIR}/Testing/SystemTests/scripts/runSystemTests.py --executable \"${MSVC_BIN_DIR}/mantidpython.bat\" --exec-args \" --classic\"" + VS_DEBUGGER_ENVIRONMENT "${MSVC_IDE_ENV}" + ) ########################################################################### # (Fake) installation variables to keep windows sweet ########################################################################### diff --git a/dev-docs/source/SystemTests.rst b/dev-docs/source/SystemTests.rst index 2c24218b31951668f26149122176146ca8a1c333..7b032e94e87df980874c28adcef2062ab295c20e 100644 --- a/dev-docs/source/SystemTests.rst +++ b/dev-docs/source/SystemTests.rst @@ -201,6 +201,22 @@ fixed when running CMake, e.g. cd build systemtest + +Selecting Tests to Run From IDE +------------------------------- + +System tests can be ran from the MSVC IDE using the ``SystemTests`` target, +which behaves in a similar way to unit test targets. One key advantage is +that it allows you to start Mantid in a debug environment rather than attach +to one midway through. + +To select an individual test, or range of tests, go to the ``SystemTests`` +properties, go to ```Command Arguments``` and append flags as appropriate. + +For example, adding ``-R ISIS`` will run any tests which match the regular +expression ``ISIS``. + + Selecting Tests To Run ---------------------- @@ -217,6 +233,7 @@ e.g. would run all of the tests whose name contains SNS. + Running the tests on multiple cores ----------------------------------- diff --git a/qt/applications/workbench/CMakeLists.txt b/qt/applications/workbench/CMakeLists.txt index 9049e1223f937f874559ca2837732a945adb4c30..c9d43bee6de7ca62597cd9d9add1c7d18370c908 100644 --- a/qt/applications/workbench/CMakeLists.txt +++ b/qt/applications/workbench/CMakeLists.txt @@ -12,6 +12,12 @@ add_python_package(workbench INSTALL_BIN_DIR "${WORKBENCH_BIN_DIR}" ) +set_target_properties(workbench PROPERTIES + VS_DEBUGGER_COMMAND $<$<BOOL:${WIN32}>:${PYTHON_EXECUTABLE}> + VS_DEBUGGER_COMMAND_ARGUMENTS $<$<BOOL:${WIN32}>:${MSVC_BIN_DIR}/workbench-script.pyw> + VS_DEBUGGER_ENVIRONMENT $<$<BOOL:${WIN32}>:${MSVC_IDE_ENV}> + ) + set(_images_qrc_file ${CMAKE_CURRENT_LIST_DIR}/resources.qrc) if (WIN32)