summaryrefslogtreecommitdiff
path: root/tests/SystemTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/SystemTests.cpp')
-rw-r--r--tests/SystemTests.cpp83
1 files changed, 83 insertions, 0 deletions
diff --git a/tests/SystemTests.cpp b/tests/SystemTests.cpp
index 821c055..2b434a9 100644
--- a/tests/SystemTests.cpp
+++ b/tests/SystemTests.cpp
@@ -1328,6 +1328,89 @@ TEST_F(SystemTests, verify_gtest_flagfile) {
Verify("*.DISABLED_pass", expected, 0, std::vector<const char*>{flagfile.c_str()}));
}
+TEST_F(SystemTests, verify_repeat_stop_on_error) {
+ std::string expected =
+ "Note: Google Test filter = *.DISABLED_fail\n"
+ "[==========] Running 1 test from 1 test suite (20 jobs).\n"
+ "[ RUN ] SystemTests.DISABLED_fail\n"
+ "file:(XX) Failure in test SystemTests.DISABLED_fail\n"
+ "Expected equality of these values:\n"
+ " 1\n"
+ " 0\n"
+ "SystemTests.DISABLED_fail exited with exitcode 1.\n"
+ "[ FAILED ] SystemTests.DISABLED_fail (XX ms)\n"
+ "[==========] 1 test from 1 test suite ran. (XX ms total)\n"
+ "[ PASSED ] 0 tests.\n"
+ "[ FAILED ] 1 test, listed below:\n"
+ "[ FAILED ] SystemTests.DISABLED_fail\n"
+ "\n"
+ " 1 FAILED TEST\n"
+ "\n"
+ "Terminating repeat run due to failing tests (iteration 1).\n";
+ ASSERT_NO_FATAL_FAILURE(
+ Verify("*.DISABLED_fail", expected, 1,
+ std::vector<const char*>{"--gtest_repeat=2", "--gtest_break_on_failure"}));
+}
+
+TEST_F(SystemTests, verify_repeat_no_stop_on_error) {
+ std::string expected =
+ "Note: Google Test filter = *.DISABLED_fail\n"
+ "[==========] Running 1 test from 1 test suite (20 jobs).\n"
+ "[ RUN ] SystemTests.DISABLED_fail\n"
+ "file:(XX) Failure in test SystemTests.DISABLED_fail\n"
+ "Expected equality of these values:\n"
+ " 1\n"
+ " 0\n"
+ "SystemTests.DISABLED_fail exited with exitcode 1.\n"
+ "[ FAILED ] SystemTests.DISABLED_fail (XX ms)\n"
+ "[==========] 1 test from 1 test suite ran. (XX ms total)\n"
+ "[ PASSED ] 0 tests.\n"
+ "[ FAILED ] 1 test, listed below:\n"
+ "[ FAILED ] SystemTests.DISABLED_fail\n"
+ "\n"
+ " 1 FAILED TEST\n"
+ "\n"
+ "Repeating all tests (iteration 2) . . .\n"
+ "\n"
+ "[==========] Running 1 test from 1 test suite (20 jobs).\n"
+ "[ RUN ] SystemTests.DISABLED_fail\n"
+ "file:(XX) Failure in test SystemTests.DISABLED_fail\n"
+ "Expected equality of these values:\n"
+ " 1\n"
+ " 0\n"
+ "SystemTests.DISABLED_fail exited with exitcode 1.\n"
+ "[ FAILED ] SystemTests.DISABLED_fail (XX ms)\n"
+ "[==========] 1 test from 1 test suite ran. (XX ms total)\n"
+ "[ PASSED ] 0 tests.\n"
+ "[ FAILED ] 1 test, listed below:\n"
+ "[ FAILED ] SystemTests.DISABLED_fail\n"
+ "\n"
+ " 1 FAILED TEST\n";
+ ASSERT_NO_FATAL_FAILURE(
+ Verify("*.DISABLED_fail", expected, 1, std::vector<const char*>{"--gtest_repeat=2"}));
+}
+
+TEST_F(SystemTests, verify_single_no_terminate_message) {
+ std::string expected =
+ "Note: Google Test filter = *.DISABLED_fail\n"
+ "[==========] Running 1 test from 1 test suite (20 jobs).\n"
+ "[ RUN ] SystemTests.DISABLED_fail\n"
+ "file:(XX) Failure in test SystemTests.DISABLED_fail\n"
+ "Expected equality of these values:\n"
+ " 1\n"
+ " 0\n"
+ "SystemTests.DISABLED_fail exited with exitcode 1.\n"
+ "[ FAILED ] SystemTests.DISABLED_fail (XX ms)\n"
+ "[==========] 1 test from 1 test suite ran. (XX ms total)\n"
+ "[ PASSED ] 0 tests.\n"
+ "[ FAILED ] 1 test, listed below:\n"
+ "[ FAILED ] SystemTests.DISABLED_fail\n"
+ "\n"
+ " 1 FAILED TEST\n";
+ ASSERT_NO_FATAL_FAILURE(
+ Verify("*.DISABLED_fail", expected, 1, std::vector<const char*>{"--gtest_break_on_failure"}));
+}
+
// These tests are used by the verify_disabled tests.
TEST_F(SystemTests, always_pass) {}