diff options
Diffstat (limited to 'Tests/GoogleTest/Test/main1.cxx')
-rw-r--r-- | Tests/GoogleTest/Test/main1.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/GoogleTest/Test/main1.cxx b/Tests/GoogleTest/Test/main1.cxx new file mode 100644 index 0000000..03d604b --- /dev/null +++ b/Tests/GoogleTest/Test/main1.cxx @@ -0,0 +1,30 @@ +#include <gtest/gtest.h> + +#include <string> + +namespace { +bool shouldFail = false; +} + +TEST(GoogleTest, LinksAndRuns) +{ + ASSERT_TRUE(true); +} + +TEST(GoogleTest, ConditionalFail) +{ + ASSERT_FALSE(shouldFail); +} + +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + + if (argc > 1) { + if (argv[1] != std::string("--forceFail")) { + throw "Unexpected argument"; + } + shouldFail = true; + } + return RUN_ALL_TESTS(); +} |