summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-06-05 14:16:29 +0000
committerKitware Robot <kwrobot@kitware.com>2017-06-05 10:16:39 -0400
commit2d3d88f3bb7076a26d9147f63453931595133aa1 (patch)
tree733b9e28eab84779f557990c82d74fc2577a7bb0 /Tests
parentc6ea3f01c3e78145b8fd3dd534d8803d8f7e7bd7 (diff)
parent92bbb70695893b617aa5addc1d3747d9146a9f2b (diff)
downloadcmake-2d3d88f3bb7076a26d9147f63453931595133aa1.tar.gz
Merge topic 'GoogleTest-disabled-tests'
92bbb706 GoogleTest: Add support for disabled tests Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Craig Scott <craig.scott@crascit.com> Merge-request: !920
Diffstat (limited to 'Tests')
-rw-r--r--Tests/GoogleTest/Test/CMakeLists.txt15
-rw-r--r--Tests/GoogleTest/Test/main2.h15
2 files changed, 29 insertions, 1 deletions
diff --git a/Tests/GoogleTest/Test/CMakeLists.txt b/Tests/GoogleTest/Test/CMakeLists.txt
index a1f08d4c8f..f798d313c8 100644
--- a/Tests/GoogleTest/Test/CMakeLists.txt
+++ b/Tests/GoogleTest/Test/CMakeLists.txt
@@ -53,12 +53,25 @@ gtest_add_tests(TARGET test_gtest2
)
set(expectedTests
GoogleTest.SomethingElse
+ GoogleTest.OffTest1
+ GoogleTest.OffTest2
+ GoogleTest.OffTest3
)
if(NOT testList STREQUAL "${expectedTests}")
message(FATAL_ERROR "Expected test list: ${expectedTests}
Actual test list: ${testList}")
endif()
-
+set(disabledTests
+ GoogleTest.OffTest1
+ GoogleTest.OffTest2
+ GoogleTest.OffTest3
+)
+foreach(T ${disabledTests})
+ get_test_property(${T} DISABLED testDisabled)
+ if(NOT testDisabled)
+ message(FATAL_ERROR "Test ${T} should be disabled but is not")
+ endif()
+endforeach()
# Non-keyword form, auto-find sources
add_executable(test_gtest3 main3.cxx)
diff --git a/Tests/GoogleTest/Test/main2.h b/Tests/GoogleTest/Test/main2.h
index 7243f538ac..7881c4fd80 100644
--- a/Tests/GoogleTest/Test/main2.h
+++ b/Tests/GoogleTest/Test/main2.h
@@ -4,3 +4,18 @@ TEST(GoogleTest, SomethingElse)
{
ASSERT_TRUE(true);
}
+
+TEST(GoogleTest, DISABLED_OffTest1)
+{
+ ASSERT_TRUE(true);
+}
+
+TEST(DISABLED_GoogleTest, OffTest2)
+{
+ ASSERT_TRUE(true);
+}
+
+TEST(DISABLED_GoogleTest, DISABLED_OffTest3)
+{
+ ASSERT_TRUE(true);
+}