Consider the following definition:
add_test( NAME python_test_long COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.py --executable $<TARGET_FILE:sum_up> )
The preceding definition can be re-expressed by explicitly specifying the WORKING_DIRECTORY in which the script will be run, as follows:
add_test( NAME python_test_long COMMAND ${PYTHON_EXECUTABLE} test.py --executable $<TARGET_FILE:sum_up> WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
We will also mention that test names can contain the / character, which may be useful when organizing related tests by name; for example:
add_test( NAME python/long COMMAND ${PYTHON_EXECUTABLE} test.py --executable $<TARGET_FILE:sum_up> WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ...