| 1 |
enable_language(CXX) |
| 2 |
include(GoogleTest) |
| 3 |
|
| 4 |
enable_testing() |
| 5 |
|
| 6 |
include(xcode_sign_adhoc.cmake) |
| 7 |
|
| 8 |
add_executable(fake_gtest fake_gtest.cpp) |
| 9 |
xcode_sign_adhoc(fake_gtest) |
| 10 |
|
| 11 |
gtest_discover_tests( |
| 12 |
fake_gtest |
| 13 |
TEST_PREFIX TEST: |
| 14 |
TEST_SUFFIX !1 |
| 15 |
EXTRA_ARGS how now "\"brown\" cow" |
| 16 |
PROPERTIES LABELS TEST1 |
| 17 |
) |
| 18 |
|
| 19 |
gtest_discover_tests( |
| 20 |
fake_gtest |
| 21 |
TEST_PREFIX TEST: |
| 22 |
TEST_SUFFIX !2 |
| 23 |
EXTRA_ARGS how now "\"brown\" cow" |
| 24 |
PROPERTIES LABELS TEST2 |
| 25 |
) |
| 26 |
|
| 27 |
gtest_discover_tests( |
| 28 |
fake_gtest |
| 29 |
TEST_PREFIX TEST: |
| 30 |
TEST_SUFFIX !3 |
| 31 |
TEST_FILTER basic* |
| 32 |
EXTRA_ARGS how now "\"brown\" cow" |
| 33 |
PROPERTIES LABELS TEST3 |
| 34 |
) |
| 35 |
|
| 36 |
gtest_discover_tests( |
| 37 |
fake_gtest |
| 38 |
TEST_PREFIX TEST: |
| 39 |
TEST_SUFFIX !4 |
| 40 |
TEST_FILTER typed* |
| 41 |
EXTRA_ARGS how now "\"brown\" cow" |
| 42 |
PROPERTIES LABELS TEST4 |
| 43 |
) |
| 44 |
|
| 45 |
gtest_discover_tests( |
| 46 |
fake_gtest |
| 47 |
TEST_PREFIX TEST: |
| 48 |
TEST_SUFFIX !5 |
| 49 |
TEST_FILTER value* |
| 50 |
EXTRA_ARGS how now "\"brown\" cow" |
| 51 |
PROPERTIES LABELS TEST5 |
| 52 |
NO_PRETTY_VALUES |
| 53 |
) |
| 54 |
|
| 55 |
gtest_discover_tests( |
| 56 |
fake_gtest |
| 57 |
TEST_PREFIX TEST: |
| 58 |
TEST_SUFFIX !6 |
| 59 |
TEST_FILTER typed* |
| 60 |
EXTRA_ARGS how now "\"brown\" cow" |
| 61 |
PROPERTIES LABELS TEST6 |
| 62 |
NO_PRETTY_TYPES |
| 63 |
) |
| 64 |
|
| 65 |
gtest_discover_tests( |
| 66 |
fake_gtest |
| 67 |
TEST_PREFIX TEST: |
| 68 |
TEST_SUFFIX !7 |
| 69 |
TEST_FILTER dynamic* |
| 70 |
EXTRA_ARGS how now "\"brown\" cow" |
| 71 |
PROPERTIES LABELS TEST7 |
| 72 |
NO_PRETTY_VALUES |
| 73 |
NO_PRETTY_TYPES |
| 74 |
) |
| 75 |
|
| 76 |
gtest_discover_tests( |
| 77 |
fake_gtest |
| 78 |
TEST_PREFIX TEST: |
| 79 |
TEST_SUFFIX !8 |
| 80 |
TEST_FILTER notests* |
| 81 |
EXTRA_ARGS how now "\"brown\" cow" |
| 82 |
PROPERTIES LABELS TEST8 |
| 83 |
) |
| 84 |
|
| 85 |
add_executable(no_tests_defined no_tests_defined.cpp) |
| 86 |
xcode_sign_adhoc(no_tests_defined) |
| 87 |
|
| 88 |
gtest_discover_tests( |
| 89 |
no_tests_defined |
| 90 |
) |
| 91 |
|
| 92 |
# Note change in behavior of TIMEOUT keyword in 3.10.3 |
| 93 |
# where it was renamed to DISCOVERY_TIMEOUT to prevent it |
| 94 |
# from shadowing the TIMEOUT test property. Verify the |
| 95 |
# 3.10.3 and later behavior, old behavior added in 3.10.1 |
| 96 |
# is not supported. |
| 97 |
add_executable(property_timeout_test timeout_test.cpp) |
| 98 |
xcode_sign_adhoc(property_timeout_test) |
| 99 |
target_compile_definitions(property_timeout_test PRIVATE sleepSec=10) |
| 100 |
|
| 101 |
gtest_discover_tests( |
| 102 |
property_timeout_test |
| 103 |
TEST_PREFIX property_ |
| 104 |
TEST_SUFFIX _no_discovery |
| 105 |
PROPERTIES TIMEOUT 2 |
| 106 |
) |
| 107 |
gtest_discover_tests( |
| 108 |
property_timeout_test |
| 109 |
TEST_PREFIX property_ |
| 110 |
TEST_SUFFIX _with_discovery |
| 111 |
DISCOVERY_TIMEOUT 20 |
| 112 |
PROPERTIES TIMEOUT 2 |
| 113 |
) |
| 114 |
|
| 115 |
add_executable(skip_test skip_test.cpp) |
| 116 |
xcode_sign_adhoc(skip_test) |
| 117 |
|
| 118 |
gtest_discover_tests( |
| 119 |
skip_test |
| 120 |
) |
| 121 |
|
| 122 |
gtest_add_tests( |
| 123 |
TARGET skip_test |
| 124 |
) |