diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2017-06-01 13:03:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-06-05 14:11:08 (GMT) |
commit | 92bbb70695893b617aa5addc1d3747d9146a9f2b (patch) | |
tree | 9825df16504b63f5aecf029bf0be26f1bba69921 /Tests/GoogleTest | |
parent | 6edd1806ddbfc4138dc9987d2a9c7c4fed56306b (diff) | |
download | CMake-92bbb70695893b617aa5addc1d3747d9146a9f2b.zip CMake-92bbb70695893b617aa5addc1d3747d9146a9f2b.tar.gz CMake-92bbb70695893b617aa5addc1d3747d9146a9f2b.tar.bz2 |
GoogleTest: Add support for disabled tests
Fixes: #10612
Diffstat (limited to 'Tests/GoogleTest')
-rw-r--r-- | Tests/GoogleTest/Test/CMakeLists.txt | 15 | ||||
-rw-r--r-- | Tests/GoogleTest/Test/main2.h | 15 |
2 files changed, 29 insertions, 1 deletions
diff --git a/Tests/GoogleTest/Test/CMakeLists.txt b/Tests/GoogleTest/Test/CMakeLists.txt index a1f08d4..f798d31 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 7243f53..7881c4f 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); +} |