From 935848a8a7164631b9410a0e6f7c5574b01bb85c Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Tue, 28 Nov 2017 11:06:02 -0500 Subject: GoogleTest: Add test for missing test executable Add a test to verify expected behavior when a test executable on which gtest_discover_tests is invoked was not built. (The test for the newly added timeout conveniently sets up this situation, so this new test was almost trivial to add.) --- Tests/RunCMake/GoogleTest/GoogleTest-test-missing-result.txt | 1 + Tests/RunCMake/GoogleTest/GoogleTest-test-missing-stderr.txt | 2 ++ Tests/RunCMake/GoogleTest/RunCMakeTest.cmake | 7 +++++++ 3 files changed, 10 insertions(+) create mode 100644 Tests/RunCMake/GoogleTest/GoogleTest-test-missing-result.txt create mode 100644 Tests/RunCMake/GoogleTest/GoogleTest-test-missing-stderr.txt diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test-missing-result.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test-missing-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/GoogleTest/GoogleTest-test-missing-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test-missing-stderr.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test-missing-stderr.txt new file mode 100644 index 0000000..55a4a7a --- /dev/null +++ b/Tests/RunCMake/GoogleTest/GoogleTest-test-missing-stderr.txt @@ -0,0 +1,2 @@ +Unable to find executable: timeout_test_NOT_BUILT +Errors while running CTest diff --git a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake index 7a50579..73014d1 100644 --- a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake +++ b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake @@ -41,6 +41,13 @@ function(run_GoogleTest) -L TEST2 --no-label-summary ) + + run_cmake_command(GoogleTest-test-missing + ${CMAKE_CTEST_COMMAND} + -C Debug + -R timeout + --no-label-summary + ) endfunction() run_GoogleTest() -- cgit v0.12