diff --git a/CMakeLists.txt b/CMakeLists.txt index 998a1eca..d412d39b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2347,8 +2347,14 @@ if(Python3_Interpreter_FOUND) OUTPUT_QUIET ERROR_QUIET) endif() if(_pybind_deps_rc EQUAL 0) + # The suite runs in a folder of its own: an in-memory deck (DeckFile.from_text) takes its side + # files (wave_frequencies.txt, current_profile.txt, ...) from the working directory, and tests + # such as wavekin_modes write theirs into the build folder while this one runs under ctest -j. + set(_cabledyn_python_test_cwd "${CMAKE_BINARY_DIR}/python_package_cwd") + file(MAKE_DIRECTORY "${_cabledyn_python_test_cwd}") add_test(NAME python_package - COMMAND ${Python3_EXECUTABLE} -m pytest ${CMAKE_CURRENT_SOURCE_DIR}/python/tests -q) + COMMAND ${Python3_EXECUTABLE} -m pytest ${CMAKE_CURRENT_SOURCE_DIR}/python/tests -q + WORKING_DIRECTORY "${_cabledyn_python_test_cwd}") if(WIN32 AND CABLEDYN_RUNTIME_DLLS) # Python 3.8+ deliberately ignores PATH for dependent-DLL resolution. # Exercise the self-contained deployment set whose shared library and GNU/OpenBLAS