diff options
Diffstat (limited to 'Tests/RunCMake/CTestCommandLine')
8 files changed, 28 insertions, 2 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/BadCTestTestfile-stderr.txt b/Tests/RunCMake/CTestCommandLine/BadCTestTestfile-stderr.txt index 97e2a10..b27da43 100644 --- a/Tests/RunCMake/CTestCommandLine/BadCTestTestfile-stderr.txt +++ b/Tests/RunCMake/CTestCommandLine/BadCTestTestfile-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at CTestTestfile.cmake:[0-9]+ \(subdirs\): subdirs called with incorrect number of arguments + -Errors while running CTest$ +Errors while running CTest +Output from these tests are in: .*/Testing/Temporary/LastTest.log +Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.$ diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index e05ad79..6cf1476 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -380,3 +380,20 @@ run_MemCheckSan(Leak "simulate_sanitizer=1:report_bugs=1:history_size=5:exitcode run_MemCheckSan(Memory "simulate_sanitizer=1:report_bugs=1:history_size=5:exitcode=55") run_MemCheckSan(Thread "report_bugs=1:history_size=5:exitcode=55") run_MemCheckSan(UndefinedBehavior "simulate_sanitizer=1") + +run_cmake_command(test-dir-invalid-arg ${CMAKE_CTEST_COMMAND} --test-dir) +run_cmake_command(test-dir-non-existing-dir ${CMAKE_CTEST_COMMAND} --test-dir non-existing-dir) + +function(run_testDir) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/testDir) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/sub") + file(WRITE "${RunCMake_TEST_BINARY_DIR}/sub/CTestTestfile.cmake" " + add_test(Test1 \"${CMAKE_COMMAND}\" -E true) + add_test(Test2 \"${CMAKE_COMMAND}\" -E true) + ") + run_cmake_command(testDir ${CMAKE_CTEST_COMMAND} --test-dir "${RunCMake_TEST_BINARY_DIR}/sub") +endfunction() +run_testDir() diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stderr.txt index 7593783..a993ac6 100644 --- a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stderr.txt +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stderr.txt @@ -1 +1,3 @@ -^Errors while running CTest$ +^Errors while running CTest +Output from these tests are in: .*/Testing/Temporary/LastTest.log +Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.$ diff --git a/Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-result.txt b/Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-stderr.txt b/Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-stderr.txt new file mode 100644 index 0000000..15908a7 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-stderr.txt @@ -0,0 +1 @@ +CMake Error: '--test-dir' requires an argument diff --git a/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-result.txt b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stderr.txt b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stderr.txt new file mode 100644 index 0000000..017ccb0 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stderr.txt @@ -0,0 +1 @@ +Failed to change working directory to ".*/non-existing-dir" : No such file or directory diff --git a/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stdout.txt b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stdout.txt new file mode 100644 index 0000000..ddcd238 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stdout.txt @@ -0,0 +1 @@ +Internal ctest changing into directory: .*/non-existing-dir |