1 2 3 4 5 6
include(CTest) add_test(NAME dirNotExist COMMAND ${CMAKE_COMMAND} -E touch someFile.txt WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thisDirWillNotExist )