diff options
author | Christopher Ferris <cferris@google.com> | 2019-06-18 12:04:57 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-06-18 12:04:57 -0700 |
commit | 54e7e597f658e5fc2570d476c7e6eb09c851016a (patch) | |
tree | a7e8bd6439418fb4ff5d2799316223a3bb15840b | |
parent | 24f44e5a9b4eb74715c1682eef8f195f5b08c9e7 (diff) | |
parent | 72551ac626ace15a91d18cfa4cecadacff0321fd (diff) | |
download | gtest_extras-54e7e597f658e5fc2570d476c7e6eb09c851016a.tar.gz |
Remove one line format. am: a3827163d5 am: e6faacb5e5 am: 210a7cb7df
am: 72551ac626
Change-Id: Iec519568eaf1f7c849e401fb20db79da4b704e1e
-rw-r--r-- | Isolate.cpp | 2 | ||||
-rw-r--r-- | IsolateMain.cpp | 5 | ||||
-rw-r--r-- | Options.cpp | 8 | ||||
-rw-r--r-- | Options.h | 1 | ||||
-rw-r--r-- | Test.cpp | 37 | ||||
-rw-r--r-- | Test.h | 4 | ||||
-rw-r--r-- | tests/OptionsTest.cpp | 51 | ||||
-rw-r--r-- | tests/SystemTests.cpp | 424 |
8 files changed, 142 insertions, 390 deletions
diff --git a/Isolate.cpp b/Isolate.cpp index 7782042..01113c1 100644 --- a/Isolate.cpp +++ b/Isolate.cpp @@ -301,7 +301,7 @@ size_t Isolate::CheckTestsFinished() { } } - test->Print(options_.gtest_format()); + test->Print(); switch (test->result()) { case TEST_PASS: diff --git a/IsolateMain.cpp b/IsolateMain.cpp index b25fc9c..e9a793b 100644 --- a/IsolateMain.cpp +++ b/IsolateMain.cpp @@ -59,11 +59,6 @@ static void PrintHelpInfo() { printf( " will be called slow.\n" " Only valid in isolation mode. Default slow threshold is 2000 ms.\n"); - ColoredPrintf(COLOR_GREEN, " --gtest_format\n"); - printf( - " Use the default gtest format, not the enhanced format.\n" - "\n" - "Default test option is "); ColoredPrintf(COLOR_GREEN, "-j"); printf( ".\n" diff --git a/Options.cpp b/Options.cpp index 0b2ba51..caf6db1 100644 --- a/Options.cpp +++ b/Options.cpp @@ -43,8 +43,6 @@ constexpr uint64_t kDefaultSlowThresholdMs = 2000; const std::unordered_map<std::string, Options::ArgInfo> Options::kArgs = { {"deadline_threshold_ms", {FLAG_REQUIRES_VALUE, &Options::SetNumeric}}, {"slow_threshold_ms", {FLAG_REQUIRES_VALUE, &Options::SetNumeric}}, - {"gtest_format", {FLAG_NONE, &Options::SetBool}}, - {"no_gtest_format", {FLAG_NONE, &Options::SetBool}}, {"gtest_list_tests", {FLAG_NONE, &Options::SetBool}}, {"gtest_filter", {FLAG_ENVIRONMENT_VARIABLE | FLAG_REQUIRES_VALUE, &Options::SetString}}, { @@ -226,8 +224,6 @@ bool Options::Process(const std::vector<const char*>& args, std::vector<const ch strings_["gtest_filter"] = ""; bools_.clear(); bools_["gtest_print_time"] = ::testing::GTEST_FLAG(print_time); - bools_["gtest_format"] = true; - bools_["no_gtest_format"] = false; bools_["gtest_also_run_disabled_tests"] = ::testing::GTEST_FLAG(also_run_disabled_tests); bools_["gtest_list_tests"] = false; @@ -302,10 +298,6 @@ bool Options::Process(const std::vector<const char*>& args, std::vector<const ch } } - // If no_gtest_format was specified, it overrides gtest_format. - if (bools_.at("no_gtest_format")) { - bools_["gtest_format"] = false; - } return true; } @@ -44,7 +44,6 @@ class Options { uint64_t total_shards() const { return numerics_.at("gtest_total_shards"); } bool print_time() const { return bools_.at("gtest_print_time"); } - bool gtest_format() const { return bools_.at("gtest_format"); } bool allow_disabled_tests() const { return bools_.at("gtest_also_run_disabled_tests"); } bool list_tests() const { return bools_.at("gtest_list_tests"); } @@ -49,7 +49,7 @@ void Test::CloseFd() { fd_.reset(); } -void Test::PrintGtestFormat() { +void Test::Print() { ColoredPrintf(COLOR_GREEN, "[ RUN ]"); printf(" %s\n", name_.c_str()); printf("%s", output_.c_str()); @@ -74,41 +74,6 @@ void Test::PrintGtestFormat() { fflush(stdout); } -void Test::Print(bool gtest_format) { - if (gtest_format) { - PrintGtestFormat(); - return; - } - - switch (result_) { - case TEST_XFAIL: - case TEST_PASS: - ColoredPrintf(COLOR_GREEN, "[ OK ]"); - break; - case TEST_XPASS: - case TEST_FAIL: - ColoredPrintf(COLOR_RED, "[ FAILED ]"); - break; - case TEST_TIMEOUT: - ColoredPrintf(COLOR_RED, "[ TIMEOUT ]"); - break; - case TEST_SKIPPED: - ColoredPrintf(COLOR_GREEN, "[ SKIPPED ]"); - break; - case TEST_NONE: - LOG(FATAL) << "Test result is TEST_NONE, this should not be possible."; - } - - printf(" %s", name_.c_str()); - if (::testing::GTEST_FLAG(print_time)) { - printf(" (%" PRId64 " ms)", (end_ns_ - start_ns_) / kNsPerMs); - } - printf("\n"); - - printf("%s", output_.c_str()); - fflush(stdout); -} - bool Test::Read() { char buffer[2048]; ssize_t bytes = TEMP_FAILURE_RETRY(read(fd_, buffer, sizeof(buffer) - 1)); @@ -38,9 +38,7 @@ class Test { public: Test(std::tuple<std::string, std::string>& test, size_t test_index, size_t run_index, int fd); - void PrintGtestFormat(); - - void Print(bool gtest_format); + void Print(); void Stop(); diff --git a/tests/OptionsTest.cpp b/tests/OptionsTest.cpp index c1bb59e..c7e7855 100644 --- a/tests/OptionsTest.cpp +++ b/tests/OptionsTest.cpp @@ -78,61 +78,11 @@ TEST(OptionsTest, check_defaults) { EXPECT_EQ("", options.filter()); EXPECT_EQ(1, options.num_iterations()); EXPECT_TRUE(options.print_time()); - EXPECT_TRUE(options.gtest_format()); EXPECT_FALSE(options.allow_disabled_tests()); EXPECT_FALSE(options.list_tests()); EXPECT_EQ(std::vector<const char*>{"ignore"}, child_args); } -TEST(OptionsTest, gtest_format) { - std::vector<const char*> cur_args{"ignore", "--gtest_format"}; - std::vector<const char*> child_args; - Options options; - ASSERT_TRUE(options.Process(cur_args, &child_args)); - EXPECT_TRUE(options.gtest_format()); - EXPECT_EQ(std::vector<const char*>{"ignore"}, child_args); -} - -TEST(OptionsTest, gtest_format_error_argument) { - CapturedStdout capture; - std::vector<const char*> cur_args{"ignore", "--gtest_format=not_allowed"}; - std::vector<const char*> child_args; - Options options; - bool parsed = options.Process(cur_args, &child_args); - capture.Stop(); - ASSERT_FALSE(parsed) << "Process did not fail properly."; - EXPECT_EQ("--gtest_format does not take an argument.\n", capture.str()); -} - -TEST(OptionsTest, no_gtest_format) { - std::vector<const char*> cur_args{"ignore", "--no_gtest_format"}; - std::vector<const char*> child_args; - Options options; - ASSERT_TRUE(options.Process(cur_args, &child_args)); - EXPECT_FALSE(options.gtest_format()); - EXPECT_EQ(std::vector<const char*>{"ignore"}, child_args); -} - -TEST(OptionsTest, no_gtest_format_and_gtest_format) { - std::vector<const char*> cur_args{"ignore", "--no_gtest_format", "--gtest_format"}; - std::vector<const char*> child_args; - Options options; - ASSERT_TRUE(options.Process(cur_args, &child_args)); - EXPECT_FALSE(options.gtest_format()); - EXPECT_EQ(std::vector<const char*>{"ignore"}, child_args); -} - -TEST(OptionsTest, no_gtest_format_error_argument) { - CapturedStdout capture; - std::vector<const char*> cur_args{"ignore", "--no_gtest_format=not_allowed"}; - std::vector<const char*> child_args; - Options options; - bool parsed = options.Process(cur_args, &child_args); - capture.Stop(); - ASSERT_FALSE(parsed) << "Process did not fail properly."; - EXPECT_EQ("--no_gtest_format does not take an argument.\n", capture.str()); -} - TEST(OptionsTest, gtest_list_tests) { std::vector<const char*> cur_args{"ignore", "--gtest_list_tests"}; std::vector<const char*> child_args; @@ -642,7 +592,6 @@ TEST(OptionsTest, verify_non_env_variables) { EXPECT_EQ("", options.filter()); EXPECT_EQ(1, options.num_iterations()); EXPECT_TRUE(options.print_time()); - EXPECT_TRUE(options.gtest_format()); EXPECT_FALSE(options.allow_disabled_tests()); EXPECT_FALSE(options.list_tests()); EXPECT_EQ(std::vector<const char*>{"ignore"}, child_args); diff --git a/tests/SystemTests.cpp b/tests/SystemTests.cpp index 847d44f..bffa98b 100644 --- a/tests/SystemTests.cpp +++ b/tests/SystemTests.cpp @@ -189,41 +189,6 @@ TEST_F(SystemTests, verify_pass) { std::string expected = "Note: Google Test filter = *.DISABLED_pass\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ OK ] SystemTests.DISABLED_pass (XX ms)\n" - "[==========] 1 test from 1 test suite ran. (XX ms total)\n" - "[ PASSED ] 1 test.\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_pass", expected, 0, std::vector<const char*>{"--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_pass_no_print_time) { - std::string expected = - "Note: Google Test filter = *.DISABLED_pass\n" - "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ OK ] SystemTests.DISABLED_pass\n" - "[==========] 1 test from 1 test suite ran. (XX ms total)\n" - "[ PASSED ] 1 test.\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_pass", expected, 0, - std::vector<const char*>{"--gtest_print_time=0", "--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_pass_color) { - std::string expected = - "\x1B[0;33mNote: Google Test filter = *.DISABLED_pass\x1B[m\n" - "\x1B[0;32m[==========]\x1B[m Running 1 test from 1 test suite (20 jobs).\n" - "\x1B[0;32m[ OK ]\x1B[m SystemTests.DISABLED_pass (XX ms)\n" - "\x1B[0;32m[==========]\x1B[m 1 test from 1 test suite ran. (XX ms total)\n" - "\x1B[0;32m[ PASSED ]\x1B[m 1 test.\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_pass", expected, 0, - std::vector<const char*>{"--gtest_color=yes", "--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_pass_gtest_format) { - std::string expected = - "Note: Google Test filter = *.DISABLED_pass\n" - "[==========] Running 1 test from 1 test suite (20 jobs).\n" "[ RUN ] SystemTests.DISABLED_pass\n" "[ OK ] SystemTests.DISABLED_pass (XX ms)\n" "[==========] 1 test from 1 test suite ran. (XX ms total)\n" @@ -231,7 +196,7 @@ TEST_F(SystemTests, verify_pass_gtest_format) { ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_pass", expected, 0)); } -TEST_F(SystemTests, verify_pass_gtest_format_no_print_time) { +TEST_F(SystemTests, verify_pass_no_print_time) { std::string expected = "Note: Google Test filter = *.DISABLED_pass\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" @@ -243,7 +208,7 @@ TEST_F(SystemTests, verify_pass_gtest_format_no_print_time) { Verify("*.DISABLED_pass", expected, 0, std::vector<const char*>{"--gtest_print_time=0"})); } -TEST_F(SystemTests, verify_pass_gtest_format_color) { +TEST_F(SystemTests, verify_pass_color) { std::string expected = "\x1B[0;33mNote: Google Test filter = *.DISABLED_pass\x1B[m\n" "\x1B[0;32m[==========]\x1B[m Running 1 test from 1 test suite (20 jobs).\n" @@ -259,61 +224,6 @@ TEST_F(SystemTests, verify_skip) { std::string expected = "Note: Google Test filter = *.DISABLED_skip_no_message\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ SKIPPED ] SystemTests.DISABLED_skip_no_message (XX ms)\n" - "[==========] 1 test from 1 test suite ran. (XX ms total)\n" - "[ PASSED ] 0 tests.\n" - "[ SKIPPED ] 1 test, listed below:\n" - "[ SKIPPED ] SystemTests.DISABLED_skip_no_message\n"; - ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_skip_no_message", expected, 0, - std::vector<const char*>{"--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_skip_with_message) { - std::string expected = - "Note: Google Test filter = *.DISABLED_skip_with_message\n" - "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ SKIPPED ] SystemTests.DISABLED_skip_with_message (XX ms)\n" - "This is a skip message\n" - "[==========] 1 test from 1 test suite ran. (XX ms total)\n" - "[ PASSED ] 0 tests.\n" - "[ SKIPPED ] 1 test, listed below:\n" - "[ SKIPPED ] SystemTests.DISABLED_skip_with_message\n"; - ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_skip_with_message", expected, 0, - std::vector<const char*>{"--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_skip_no_print_time) { - std::string expected = - "Note: Google Test filter = *.DISABLED_skip_no_message\n" - "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ SKIPPED ] SystemTests.DISABLED_skip_no_message\n" - "[==========] 1 test from 1 test suite ran. (XX ms total)\n" - "[ PASSED ] 0 tests.\n" - "[ SKIPPED ] 1 test, listed below:\n" - "[ SKIPPED ] SystemTests.DISABLED_skip_no_message\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_skip_no_message", expected, 0, - std::vector<const char*>{"--gtest_print_time=0", "--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_skip_color) { - std::string expected = - "\x1B[0;33mNote: Google Test filter = *.DISABLED_skip_no_message\x1B[m\n" - "\x1B[0;32m[==========]\x1B[m Running 1 test from 1 test suite (20 jobs).\n" - "\x1B[0;32m[ SKIPPED ]\x1B[m SystemTests.DISABLED_skip_no_message (XX ms)\n" - "\x1B[0;32m[==========]\x1B[m 1 test from 1 test suite ran. (XX ms total)\n" - "\x1B[0;32m[ PASSED ]\x1B[m 0 tests.\n" - "\x1B[0;32m[ SKIPPED ]\x1B[m 1 test, listed below:\n" - "\x1B[0;32m[ SKIPPED ]\x1B[m SystemTests.DISABLED_skip_no_message\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_skip_no_message", expected, 0, - std::vector<const char*>{"--gtest_color=yes", "--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_skip_gtest_format) { - std::string expected = - "Note: Google Test filter = *.DISABLED_skip_no_message\n" - "[==========] Running 1 test from 1 test suite (20 jobs).\n" "[ RUN ] SystemTests.DISABLED_skip_no_message\n" "[ SKIPPED ] SystemTests.DISABLED_skip_no_message (XX ms)\n" "[==========] 1 test from 1 test suite ran. (XX ms total)\n" @@ -323,7 +233,7 @@ TEST_F(SystemTests, verify_skip_gtest_format) { ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_skip_no_message", expected, 0)); } -TEST_F(SystemTests, verify_skip_gtest_format_with_message) { +TEST_F(SystemTests, verify_skip_with_message) { std::string expected = "Note: Google Test filter = *.DISABLED_skip_with_message\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" @@ -337,7 +247,7 @@ TEST_F(SystemTests, verify_skip_gtest_format_with_message) { ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_skip_with_message", expected, 0)); } -TEST_F(SystemTests, verify_skip_gtest_format_no_print_time) { +TEST_F(SystemTests, verify_skip_no_print_time) { std::string expected = "Note: Google Test filter = *.DISABLED_skip_no_message\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" @@ -351,7 +261,7 @@ TEST_F(SystemTests, verify_skip_gtest_format_no_print_time) { std::vector<const char*>{"--gtest_print_time=0"})); } -TEST_F(SystemTests, verify_skip_gtest_format_color) { +TEST_F(SystemTests, verify_skip_color) { std::string expected = "\x1B[0;33mNote: Google Test filter = *.DISABLED_skip_no_message\x1B[m\n" "\x1B[0;32m[==========]\x1B[m Running 1 test from 1 test suite (20 jobs).\n" @@ -369,39 +279,6 @@ TEST_F(SystemTests, verify_xfail_fail_expect_to_fail) { std::string expected = "Note: Google Test filter = *.xfail_fail\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ OK ] DISABLED_SystemTestsXfail.xfail_fail (XX ms)\n" - "file:(XX) Failure in test DISABLED_SystemTestsXfail.xfail_fail\n" - "Expected equality of these values:\n" - " 1\n" - " 0\n" - "DISABLED_SystemTestsXfail.xfail_fail exited with exitcode 1.\n" - "[==========] 1 test from 1 test suite ran. (XX ms total)\n" - "[ PASSED ] 1 test. (1 expected failure)\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.xfail_fail", expected, 0, std::vector<const char*>{"--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_xfail_fail_expect_to_fail_color) { - std::string expected = - "\x1B[0;33mNote: Google Test filter = *.xfail_fail\x1B[m\n" - "\x1B[0;32m[==========]\x1B[m Running 1 test from 1 test suite (20 jobs).\n" - "\x1B[0;32m[ OK ]\x1B[m DISABLED_SystemTestsXfail.xfail_fail (XX ms)\n" - "file:(XX) Failure in test DISABLED_SystemTestsXfail.xfail_fail\n" - "Expected equality of these values:\n" - " 1\n" - " 0\n" - "DISABLED_SystemTestsXfail.xfail_fail exited with exitcode 1.\n" - "\x1B[0;32m[==========]\x1B[m 1 test from 1 test suite ran. (XX ms total)\n" - "\x1B[0;32m[ PASSED ]\x1B[m 1 test. (1 expected failure)\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.xfail_fail", expected, 0, - std::vector<const char*>{"--gtest_color=yes", "--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_xfail_fail_expect_to_fail_gtest_format) { - std::string expected = - "Note: Google Test filter = *.xfail_fail\n" - "[==========] Running 1 test from 1 test suite (20 jobs).\n" "[ RUN ] DISABLED_SystemTestsXfail.xfail_fail\n" "file:(XX) Failure in test DISABLED_SystemTestsXfail.xfail_fail\n" "Expected equality of these values:\n" @@ -418,21 +295,6 @@ TEST_F(SystemTests, verify_xfail_pass_expect_to_fail) { std::string expected = "Note: Google Test filter = *.xfail_pass\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ FAILED ] DISABLED_SystemTestsXfail.xfail_pass (XX ms)\n" - "[==========] 1 test from 1 test suite ran. (XX ms total)\n" - "[ PASSED ] 0 tests.\n" - "[ FAILED ] 1 test should have failed, listed below:\n" - "[ FAILED ] DISABLED_SystemTestsXfail.xfail_pass\n" - "\n" - " 1 SHOULD HAVE FAILED TEST\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.xfail_pass", expected, 1, std::vector<const char*>{"--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_xfail_pass_expect_to_fail_gtest_format) { - std::string expected = - "Note: Google Test filter = *.xfail_pass\n" - "[==========] Running 1 test from 1 test suite (20 jobs).\n" "[ RUN ] DISABLED_SystemTestsXfail.xfail_pass\n" "[ FAILED ] DISABLED_SystemTestsXfail.xfail_pass (XX ms)\n" "[==========] 1 test from 1 test suite ran. (XX ms total)\n" @@ -448,6 +310,7 @@ TEST_F(SystemTests, verify_xfail_pass_expect_to_fail_color) { std::string expected = "\x1B[0;33mNote: Google Test filter = *.xfail_pass\x1B[m\n" "\x1B[0;32m[==========]\x1B[m Running 1 test from 1 test suite (20 jobs).\n" + "\x1B[0;32m[ RUN ]\x1B[m DISABLED_SystemTestsXfail.xfail_pass\n" "\x1B[0;31m[ FAILED ]\x1B[m DISABLED_SystemTestsXfail.xfail_pass (XX ms)\n" "\x1B[0;32m[==========]\x1B[m 1 test from 1 test suite ran. (XX ms total)\n" "\x1B[0;32m[ PASSED ]\x1B[m 0 tests.\n" @@ -456,66 +319,24 @@ TEST_F(SystemTests, verify_xfail_pass_expect_to_fail_color) { "\n" " 1 SHOULD HAVE FAILED TEST\n"; ASSERT_NO_FATAL_FAILURE( - Verify("*.xfail_pass", expected, 1, - std::vector<const char*>{"--gtest_color=yes", "--no_gtest_format"})); + Verify("*.xfail_pass", expected, 1, std::vector<const char*>{"--gtest_color=yes"})); } TEST_F(SystemTests, verify_deathtest_pass) { std::string expected = "Note: Google Test filter = *.DISABLED_death_pass\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ OK ] SystemTestsDeathTest.DISABLED_death_pass (XX ms)\n" + "[ RUN ] SystemTestsDeathTest.DISABLED_death_pass\n" + "[ OK ] SystemTestsDeathTest.DISABLED_death_pass (XX ms)\n" "[==========] 1 test from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 1 test.\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_death_pass", expected, 0, std::vector<const char*>{"--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_death_pass", expected, 0)); } TEST_F(SystemTests, verify_fail) { std::string expected = "Note: Google Test filter = *.DISABLED_fail\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ FAILED ] SystemTests.DISABLED_fail (XX ms)\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" - "[==========] 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*>{"--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_fail_color) { - std::string expected = - "\x1B[0;33mNote: Google Test filter = *.DISABLED_fail\x1B[m\n" - "\x1B[0;32m[==========]\x1B[m Running 1 test from 1 test suite (20 jobs).\n" - "\x1B[0;31m[ FAILED ]\x1B[m SystemTests.DISABLED_fail (XX ms)\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" - "\x1B[0;32m[==========]\x1B[m 1 test from 1 test suite ran. (XX ms total)\n" - "\x1B[0;32m[ PASSED ]\x1B[m 0 tests.\n" - "\x1B[0;31m[ FAILED ]\x1B[m 1 test, listed below:\n" - "\x1B[0;31m[ FAILED ]\x1B[m SystemTests.DISABLED_fail\n" - "\n" - " 1 FAILED TEST\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_fail", expected, 1, - std::vector<const char*>{"--gtest_color=yes", "--no_gtest_format"})); -} - -TEST_F(SystemTests, verify_fail_gtest_format) { - 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" @@ -532,7 +353,7 @@ TEST_F(SystemTests, verify_fail_gtest_format) { ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_fail", expected, 1)); } -TEST_F(SystemTests, verify_fail_gtest_format_color) { +TEST_F(SystemTests, verify_fail_color) { std::string expected = "\x1B[0;33mNote: Google Test filter = *.DISABLED_fail\x1B[m\n" "\x1B[0;32m[==========]\x1B[m Running 1 test from 1 test suite (20 jobs).\n" @@ -557,64 +378,65 @@ TEST_F(SystemTests, verify_deathtest_fail) { std::string expected = "Note: Google Test filter = *.DISABLED_death_fail\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ FAILED ] SystemTestsDeathTest.DISABLED_death_fail (XX ms)\n" + "[ RUN ] SystemTestsDeathTest.DISABLED_death_fail\n" "file:(XX) Failure in test SystemTestsDeathTest.DISABLED_death_fail\n" "Death test: DeathTestHelperFail()\n" " Result: failed to die.\n" " Error msg:\n" "[ DEATH ] \n" "SystemTestsDeathTest.DISABLED_death_fail exited with exitcode 1.\n" + "[ FAILED ] SystemTestsDeathTest.DISABLED_death_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 ] SystemTestsDeathTest.DISABLED_death_fail\n" "\n" " 1 FAILED TEST\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_death_fail", expected, 1, std::vector<const char*>{"--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_death_fail", expected, 1)); } TEST_F(SystemTests, verify_crash) { std::string expected = "Note: Google Test filter = *.DISABLED_crash\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ FAILED ] SystemTests.DISABLED_crash (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_crash\n" #if defined(__APPLE__) "SystemTests.DISABLED_crash terminated by signal: Segmentation fault: 11.\n" #else "SystemTests.DISABLED_crash terminated by signal: Segmentation fault.\n" #endif + "[ FAILED ] SystemTests.DISABLED_crash (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_crash\n" "\n" " 1 FAILED TEST\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_crash", expected, 1, std::vector<const char*>{"--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_crash", expected, 1)); } TEST_F(SystemTests, verify_warning_slow) { std::string expected = "Note: Google Test filter = *.DISABLED_sleep5\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ OK ] SystemTests.DISABLED_sleep5 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_sleep5\n" + "[ OK ] SystemTests.DISABLED_sleep5 (XX ms)\n" "[==========] 1 test from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 1 test.\n" "[ SLOW ] 1 test, listed below:\n" "[ SLOW ] SystemTests.DISABLED_sleep5 (XX ms, exceeded 3000 ms)\n" "\n" " 1 SLOW TEST\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_sleep5", expected, 0, - std::vector<const char*>{"--slow_threshold_ms=3000", "--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_sleep5", expected, 0, + std::vector<const char*>{"--slow_threshold_ms=3000"})); } TEST_F(SystemTests, verify_warning_slow_color) { std::string expected = "\x1B[0;33mNote: Google Test filter = *.DISABLED_sleep5\x1B[m\n" "\x1B[0;32m[==========]\x1B[m Running 1 test from 1 test suite (20 jobs).\n" - "\x1B[0;32m[ OK ]\x1B[m SystemTests.DISABLED_sleep5 (XX ms)\n" + "\x1B[0;32m[ RUN ]\x1B[m SystemTests.DISABLED_sleep5\n" + "\x1B[0;32m[ OK ]\x1B[m SystemTests.DISABLED_sleep5 (XX ms)\n" "\x1B[0;32m[==========]\x1B[m 1 test from 1 test suite ran. (XX ms total)\n" "\x1B[0;32m[ PASSED ]\x1B[m 1 test.\n" "\x1B[0;33m[ SLOW ]\x1B[m 1 test, listed below:\n" @@ -623,25 +445,24 @@ TEST_F(SystemTests, verify_warning_slow_color) { " 1 SLOW TEST\n"; ASSERT_NO_FATAL_FAILURE( Verify("*.DISABLED_sleep5", expected, 0, - std::vector<const char*>{"--slow_threshold_ms=3000", "--gtest_color=yes", - "--no_gtest_format"})); + std::vector<const char*>{"--slow_threshold_ms=3000", "--gtest_color=yes"})); } TEST_F(SystemTests, verify_timeout) { std::string expected = "Note: Google Test filter = *.DISABLED_sleep_forever\n" "[==========] Running 1 test from 1 test suite (20 jobs).\n" - "[ TIMEOUT ] SystemTests.DISABLED_sleep_forever (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_sleep_forever\n" "SystemTests.DISABLED_sleep_forever killed because of timeout at XX ms.\n" + "[ FAILED ] SystemTests.DISABLED_sleep_forever (XX ms)\n" "[==========] 1 test from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 0 tests.\n" "[ TIMEOUT ] 1 test, listed below:\n" "[ TIMEOUT ] SystemTests.DISABLED_sleep_forever (stopped at XX ms)\n" "\n" " 1 TIMEOUT TEST\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_sleep_forever", expected, 1, - std::vector<const char*>{"--deadline_threshold_ms=3000", "--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_sleep_forever", expected, 1, + std::vector<const char*>{"--deadline_threshold_ms=3000"})); } // Verify that tests that timeout do not get marked as slow too when @@ -650,9 +471,11 @@ TEST_F(SystemTests, verify_timeout_not_slow) { std::string expected = "Note: Google Test filter = *.DISABLED_sleep*\n" "[==========] Running 2 tests from 1 test suite (20 jobs).\n" - "[ OK ] SystemTests.DISABLED_sleep5 (XX ms)\n" - "[ TIMEOUT ] SystemTests.DISABLED_sleep_forever (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_sleep5\n" + "[ OK ] SystemTests.DISABLED_sleep5 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_sleep_forever\n" "SystemTests.DISABLED_sleep_forever killed because of timeout at XX ms.\n" + "[ FAILED ] SystemTests.DISABLED_sleep_forever (XX ms)\n" "[==========] 2 tests from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 1 test.\n" "[ SLOW ] 1 test, listed below:\n" @@ -662,18 +485,18 @@ TEST_F(SystemTests, verify_timeout_not_slow) { "\n" " 1 SLOW TEST\n" " 1 TIMEOUT TEST\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_sleep*", expected, 1, - std::vector<const char*>{"--slow_threshold_ms=1000", "--deadline_threshold_ms=10000", - "--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify( + "*.DISABLED_sleep*", expected, 1, + std::vector<const char*>{"--slow_threshold_ms=1000", "--deadline_threshold_ms=10000"})); } TEST_F(SystemTests, verify_timeout_color) { std::string expected = "\x1B[0;33mNote: Google Test filter = *.DISABLED_sleep_forever\x1B[m\n" "\x1B[0;32m[==========]\x1B[m Running 1 test from 1 test suite (20 jobs).\n" - "\x1B[0;31m[ TIMEOUT ]\x1B[m SystemTests.DISABLED_sleep_forever (XX ms)\n" + "\x1B[0;32m[ RUN ]\x1B[m SystemTests.DISABLED_sleep_forever\n" "SystemTests.DISABLED_sleep_forever killed because of timeout at XX ms.\n" + "\x1B[0;31m[ FAILED ]\x1B[m SystemTests.DISABLED_sleep_forever (XX ms)\n" "\x1B[0;32m[==========]\x1B[m 1 test from 1 test suite ran. (XX ms total)\n" "\x1B[0;32m[ PASSED ]\x1B[m 0 tests.\n" "\x1B[0;31m[ TIMEOUT ]\x1B[m 1 test, listed below:\n" @@ -682,21 +505,22 @@ TEST_F(SystemTests, verify_timeout_color) { " 1 TIMEOUT TEST\n"; ASSERT_NO_FATAL_FAILURE( Verify("*.DISABLED_sleep_forever", expected, 1, - std::vector<const char*>{"--deadline_threshold_ms=3000", "--gtest_color=yes", - "--no_gtest_format"})); + std::vector<const char*>{"--deadline_threshold_ms=3000", "--gtest_color=yes"})); } TEST_F(SystemTests, verify_order_isolated) { std::string expected = "Note: Google Test filter = *.DISABLED_order_*\n" "[==========] Running 3 tests from 1 test suite (20 jobs).\n" - "[ OK ] SystemTests.DISABLED_order_3 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_order_2 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_order_1 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_3\n" + "[ OK ] SystemTests.DISABLED_order_3 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_2\n" + "[ OK ] SystemTests.DISABLED_order_2 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_1\n" + "[ OK ] SystemTests.DISABLED_order_1 (XX ms)\n" "[==========] 3 tests from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n"; - ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_order_*", expected, 0, std::vector<const char*>{"--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_order_*", expected, 0)); } TEST_F(SystemTests, verify_order_not_isolated) { @@ -716,8 +540,8 @@ TEST_F(SystemTests, verify_order_not_isolated) { "[----------] Global test environment tear-down\n" "[==========] 3 tests from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n"; - ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_order_*", expected, 0, - std::vector<const char*>{"--no_isolate", "--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE( + Verify("*.DISABLED_order_*", expected, 0, std::vector<const char*>{"--no_isolate"})); } TEST_F(SystemTests, verify_fail_ge10) { @@ -762,26 +586,31 @@ TEST_F(SystemTests, verify_job_count_single) { std::string expected = "Note: Google Test filter = *.DISABLED_job_*\n" "[==========] Running 3 tests from 1 test suite (1 job).\n" - "[ OK ] SystemTests.DISABLED_job_1 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_job_2 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_job_3 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_job_1\n" + "[ OK ] SystemTests.DISABLED_job_1 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_job_2\n" + "[ OK ] SystemTests.DISABLED_job_2 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_job_3\n" + "[ OK ] SystemTests.DISABLED_job_3 (XX ms)\n" "[==========] 3 tests from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n"; - ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_job_*", expected, 0, - std::vector<const char*>{"-j1", "--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_job_*", expected, 0, std::vector<const char*>{"-j1"})); } TEST_F(SystemTests, verify_job_count_multiple) { std::string expected = "Note: Google Test filter = *.DISABLED_job_*\n" "[==========] Running 3 tests from 1 test suite (2 jobs).\n" - "[ OK ] SystemTests.DISABLED_job_2 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_job_1 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_job_3 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_job_2\n" + "[ OK ] SystemTests.DISABLED_job_2 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_job_1\n" + "[ OK ] SystemTests.DISABLED_job_1 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_job_3\n" + "[ OK ] SystemTests.DISABLED_job_3 (XX ms)\n" "[==========] 3 tests from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n"; - ASSERT_NO_FATAL_FAILURE(Verify("*.DISABLED_job_*", expected, 0, - std::vector<const char*>{"-j", "2", "--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE( + Verify("*.DISABLED_job_*", expected, 0, std::vector<const char*>{"-j", "2"})); } TEST_F(SystemTests, verify_help) { @@ -823,33 +652,41 @@ TEST_F(SystemTests, verify_repeat) { std::string expected = "Note: Google Test filter = *.DISABLED_order_*\n" "[==========] Running 3 tests from 1 test suite (20 jobs).\n" - "[ OK ] SystemTests.DISABLED_order_3 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_order_2 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_order_1 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_3\n" + "[ OK ] SystemTests.DISABLED_order_3 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_2\n" + "[ OK ] SystemTests.DISABLED_order_2 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_1\n" + "[ OK ] SystemTests.DISABLED_order_1 (XX ms)\n" "[==========] 3 tests from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n" "\n" "Repeating all tests (iteration 2) . . .\n" "\n" "[==========] Running 3 tests from 1 test suite (20 jobs).\n" - "[ OK ] SystemTests.DISABLED_order_3 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_order_2 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_order_1 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_3\n" + "[ OK ] SystemTests.DISABLED_order_3 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_2\n" + "[ OK ] SystemTests.DISABLED_order_2 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_1\n" + "[ OK ] SystemTests.DISABLED_order_1 (XX ms)\n" "[==========] 3 tests from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n" "\n" "Repeating all tests (iteration 3) . . .\n" "\n" "[==========] Running 3 tests from 1 test suite (20 jobs).\n" - "[ OK ] SystemTests.DISABLED_order_3 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_order_2 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_order_1 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_3\n" + "[ OK ] SystemTests.DISABLED_order_3 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_2\n" + "[ OK ] SystemTests.DISABLED_order_2 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_order_1\n" + "[ OK ] SystemTests.DISABLED_order_1 (XX ms)\n" "[==========] 3 tests from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n"; uint64_t time_ns = NanoTime(); ASSERT_NO_FATAL_FAILURE( - Verify("*.DISABLED_order_*", expected, 0, - std::vector<const char*>{"--gtest_repeat=3", "--no_gtest_format"})); + Verify("*.DISABLED_order_*", expected, 0, std::vector<const char*>{"--gtest_repeat=3"})); time_ns = NanoTime() - time_ns; // Make sure that the total test time is about 18 seconds. double seconds = double(time_ns) / 1000000000; @@ -864,7 +701,7 @@ TEST_F(SystemTests, verify_repeat) { TEST_F(SystemTests, verify_results_as_tests_finish) { // This test verifies that test output comes out as the test finishes. Exec(std::vector<const char*>{"--gtest_filter=*.DISABLED_order_*", - "--gtest_also_run_disabled_tests", "-j20", "--no_gtest_format"}); + "--gtest_also_run_disabled_tests", "-j20"}); std::string output; std::vector<char> buffer(4096); @@ -879,7 +716,7 @@ TEST_F(SystemTests, verify_results_as_tests_finish) { buffer[bytes] = '\0'; output += buffer.data(); // See if the output has come out now. - if (output.find("[ OK ] SystemTests.DISABLED_order_2") != std::string::npos) { + if (output.find("[ OK ] SystemTests.DISABLED_order_2") != std::string::npos) { uint64_t test_ns = NanoTime() - time_ns; double test_sec = double(test_ns) / 1000000000; // This should happen after 3 seconds, but before 4.5 seconds. @@ -1006,14 +843,15 @@ TEST_F(SystemTests, verify_disabled_not_displayed_with_no_tests) { } TEST_F(SystemTests, verify_disabled) { - std::vector<const char*> args{"--gtest_filter=*always_pass", "-j2", "--no_gtest_format"}; + std::vector<const char*> args{"--gtest_filter=*always_pass", "-j2"}; ASSERT_NO_FATAL_FAILURE(ExecAndCapture(args)); ASSERT_EQ(0, exitcode_) << "Test output:\n" << raw_output_; std::string expected = "Note: Google Test filter = *always_pass\n" "[==========] Running 1 test from 1 test suite (2 jobs).\n" - "[ OK ] SystemTests.always_pass (XX ms)\n" + "[ RUN ] SystemTests.always_pass\n" + "[ OK ] SystemTests.always_pass (XX ms)\n" "[==========] 1 test from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 1 test.\n" "\n" @@ -1023,15 +861,15 @@ TEST_F(SystemTests, verify_disabled) { } TEST_F(SystemTests, verify_disabled_color) { - std::vector<const char*> args{"--gtest_filter=*always_pass", "-j2", "--gtest_color=yes", - "--no_gtest_format"}; + std::vector<const char*> args{"--gtest_filter=*always_pass", "-j2", "--gtest_color=yes"}; ASSERT_NO_FATAL_FAILURE(ExecAndCapture(args)); ASSERT_EQ(0, exitcode_) << "Test output:\n" << raw_output_; std::string expected = "\x1B[0;33mNote: Google Test filter = *always_pass\x1B[m\n" "\x1B[0;32m[==========]\x1B[m Running 1 test from 1 test suite (2 jobs).\n" - "\x1B[0;32m[ OK ]\x1B[m SystemTests.always_pass (XX ms)\n" + "\x1B[0;32m[ RUN ]\x1B[m SystemTests.always_pass\n" + "\x1B[0;32m[ OK ]\x1B[m SystemTests.always_pass (XX ms)\n" "\x1B[0;32m[==========]\x1B[m 1 test from 1 test suite ran. (XX ms total)\n" "\x1B[0;32m[ PASSED ]\x1B[m 1 test.\n" "\n" @@ -1077,7 +915,7 @@ TEST_F(SystemTests, verify_SIGINT) { TEST_F(SystemTests, verify_SIGQUIT) { // Verify that SIGQUIT prints all of the running tests. Exec(std::vector<const char*>{"--gtest_filter=*.DISABLED_job*", "--gtest_also_run_disabled_tests", - "-j20", "--no_gtest_format"}); + "-j20"}); // It is expected that all of the tests will be sleeping so nothing will // complete by the time the signal is sent. sleep(1); @@ -1107,9 +945,12 @@ TEST_F(SystemTests, verify_SIGQUIT) { " SystemTests.DISABLED_job_1 (elapsed time XX ms)\n" " SystemTests.DISABLED_job_2 (elapsed time XX ms)\n" " SystemTests.DISABLED_job_3 (elapsed time XX ms)\n" - "[ OK ] SystemTests.DISABLED_job_2 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_job_3 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_job_1 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_job_2\n" + "[ OK ] SystemTests.DISABLED_job_2 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_job_3\n" + "[ OK ] SystemTests.DISABLED_job_3 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_job_1\n" + "[ OK ] SystemTests.DISABLED_job_1 (XX ms)\n" "[==========] 3 tests from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n", sanitized_output_); @@ -1119,7 +960,7 @@ TEST_F(SystemTests, verify_SIGQUIT) { TEST_F(SystemTests, verify_SIGQUIT_after_test_finish) { // Verify that SIGQUIT prints all of the tests after a test finishes. Exec(std::vector<const char*>{"--gtest_filter=*.DISABLED_sigquit_*", - "--gtest_also_run_disabled_tests", "-j20", "--no_gtest_format"}); + "--gtest_also_run_disabled_tests", "-j20"}); // It is expected that one tests will have finished, but the rest will still // be running. sleep(1); @@ -1145,12 +986,15 @@ TEST_F(SystemTests, verify_SIGQUIT_after_test_finish) { ASSERT_EQ( "Note: Google Test filter = *.DISABLED_sigquit_*\n" "[==========] Running 3 tests from 1 test suite (20 jobs).\n" - "[ OK ] SystemTests.DISABLED_sigquit_no_sleep (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_sigquit_no_sleep\n" + "[ OK ] SystemTests.DISABLED_sigquit_no_sleep (XX ms)\n" "List of current running tests:\n" " SystemTests.DISABLED_sigquit_sleep_5 (elapsed time XX ms)\n" " SystemTests.DISABLED_sigquit_sleep_6 (elapsed time XX ms)\n" - "[ OK ] SystemTests.DISABLED_sigquit_sleep_5 (XX ms)\n" - "[ OK ] SystemTests.DISABLED_sigquit_sleep_6 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_sigquit_sleep_5\n" + "[ OK ] SystemTests.DISABLED_sigquit_sleep_5 (XX ms)\n" + "[ RUN ] SystemTests.DISABLED_sigquit_sleep_6\n" + "[ OK ] SystemTests.DISABLED_sigquit_sleep_6 (XX ms)\n" "[==========] 3 tests from 1 test suite ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n", sanitized_output_); @@ -1208,54 +1052,62 @@ TEST_F(SystemTests, verify_sharding) { "Note: Google Test filter = SystemTestsShard*.DISABLED*\n" "Note: This is test shard 1 of 4\n" "[==========] Running 3 tests from 3 test suites (20 jobs).\n" - "[ OK ] SystemTestsShard1.DISABLED_case1_test1 (XX ms)\n" - "[ OK ] SystemTestsShard2.DISABLED_case2_test1 (XX ms)\n" - "[ OK ] SystemTestsShard3.DISABLED_case3_test1 (XX ms)\n" + "[ RUN ] SystemTestsShard1.DISABLED_case1_test1\n" + "[ OK ] SystemTestsShard1.DISABLED_case1_test1 (XX ms)\n" + "[ RUN ] SystemTestsShard2.DISABLED_case2_test1\n" + "[ OK ] SystemTestsShard2.DISABLED_case2_test1 (XX ms)\n" + "[ RUN ] SystemTestsShard3.DISABLED_case3_test1\n" + "[ OK ] SystemTestsShard3.DISABLED_case3_test1 (XX ms)\n" "[==========] 3 tests from 3 test suites ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n"; ASSERT_NE(-1, setenv("GTEST_TOTAL_SHARDS", "4", 1)); ASSERT_NE(-1, setenv("GTEST_SHARD_INDEX", "0", 1)); - ASSERT_NO_FATAL_FAILURE(Verify("SystemTestsShard*.DISABLED*", expected, 0, - std::vector<const char*>{"--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("SystemTestsShard*.DISABLED*", expected, 0)); expected = "Note: Google Test filter = SystemTestsShard*.DISABLED*\n" "Note: This is test shard 2 of 4\n" "[==========] Running 3 tests from 3 test suites (20 jobs).\n" - "[ OK ] SystemTestsShard1.DISABLED_case1_test2 (XX ms)\n" - "[ OK ] SystemTestsShard2.DISABLED_case2_test2 (XX ms)\n" - "[ OK ] SystemTestsShard3.DISABLED_case3_test2 (XX ms)\n" + "[ RUN ] SystemTestsShard1.DISABLED_case1_test2\n" + "[ OK ] SystemTestsShard1.DISABLED_case1_test2 (XX ms)\n" + "[ RUN ] SystemTestsShard2.DISABLED_case2_test2\n" + "[ OK ] SystemTestsShard2.DISABLED_case2_test2 (XX ms)\n" + "[ RUN ] SystemTestsShard3.DISABLED_case3_test2\n" + "[ OK ] SystemTestsShard3.DISABLED_case3_test2 (XX ms)\n" "[==========] 3 tests from 3 test suites ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n"; ASSERT_NE(-1, setenv("GTEST_SHARD_INDEX", "1", 1)); - ASSERT_NO_FATAL_FAILURE(Verify("SystemTestsShard*.DISABLED*", expected, 0, - std::vector<const char*>{"--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("SystemTestsShard*.DISABLED*", expected, 0)); expected = "Note: Google Test filter = SystemTestsShard*.DISABLED*\n" "Note: This is test shard 3 of 4\n" "[==========] Running 3 tests from 3 test suites (20 jobs).\n" - "[ OK ] SystemTestsShard1.DISABLED_case1_test3 (XX ms)\n" - "[ OK ] SystemTestsShard2.DISABLED_case2_test3 (XX ms)\n" - "[ OK ] SystemTestsShard3.DISABLED_case3_test3 (XX ms)\n" + "[ RUN ] SystemTestsShard1.DISABLED_case1_test3\n" + "[ OK ] SystemTestsShard1.DISABLED_case1_test3 (XX ms)\n" + "[ RUN ] SystemTestsShard2.DISABLED_case2_test3\n" + "[ OK ] SystemTestsShard2.DISABLED_case2_test3 (XX ms)\n" + "[ RUN ] SystemTestsShard3.DISABLED_case3_test3\n" + "[ OK ] SystemTestsShard3.DISABLED_case3_test3 (XX ms)\n" "[==========] 3 tests from 3 test suites ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n"; ASSERT_NE(-1, setenv("GTEST_SHARD_INDEX", "2", 1)); - ASSERT_NO_FATAL_FAILURE(Verify("SystemTestsShard*.DISABLED*", expected, 0, - std::vector<const char*>{"--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("SystemTestsShard*.DISABLED*", expected, 0)); expected = "Note: Google Test filter = SystemTestsShard*.DISABLED*\n" "Note: This is test shard 4 of 4\n" "[==========] Running 3 tests from 3 test suites (20 jobs).\n" - "[ OK ] SystemTestsShard1.DISABLED_case1_test4 (XX ms)\n" - "[ OK ] SystemTestsShard2.DISABLED_case2_test4 (XX ms)\n" - "[ OK ] SystemTestsShard3.DISABLED_case3_test4 (XX ms)\n" + "[ RUN ] SystemTestsShard1.DISABLED_case1_test4\n" + "[ OK ] SystemTestsShard1.DISABLED_case1_test4 (XX ms)\n" + "[ RUN ] SystemTestsShard2.DISABLED_case2_test4\n" + "[ OK ] SystemTestsShard2.DISABLED_case2_test4 (XX ms)\n" + "[ RUN ] SystemTestsShard3.DISABLED_case3_test4\n" + "[ OK ] SystemTestsShard3.DISABLED_case3_test4 (XX ms)\n" "[==========] 3 tests from 3 test suites ran. (XX ms total)\n" "[ PASSED ] 3 tests.\n"; ASSERT_NE(-1, setenv("GTEST_SHARD_INDEX", "3", 1)); - ASSERT_NO_FATAL_FAILURE(Verify("SystemTestsShard*.DISABLED*", expected, 0, - std::vector<const char*>{"--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("SystemTestsShard*.DISABLED*", expected, 0)); } TEST_F(SystemTests, verify_sharding_color) { @@ -1263,16 +1115,18 @@ TEST_F(SystemTests, verify_sharding_color) { "\x1B[0;33mNote: Google Test filter = SystemTestsShard*.DISABLED*\x1B[m\n" "\x1B[0;33mNote: This is test shard 1 of 4\x1B[m\n" "\x1B[0;32m[==========]\x1B[m Running 3 tests from 3 test suites (20 jobs).\n" - "\x1B[0;32m[ OK ]\x1B[m SystemTestsShard1.DISABLED_case1_test1 (XX ms)\n" - "\x1B[0;32m[ OK ]\x1B[m SystemTestsShard2.DISABLED_case2_test1 (XX ms)\n" - "\x1B[0;32m[ OK ]\x1B[m SystemTestsShard3.DISABLED_case3_test1 (XX ms)\n" + "\x1B[0;32m[ RUN ]\x1B[m SystemTestsShard1.DISABLED_case1_test1\n" + "\x1B[0;32m[ OK ]\x1B[m SystemTestsShard1.DISABLED_case1_test1 (XX ms)\n" + "\x1B[0;32m[ RUN ]\x1B[m SystemTestsShard2.DISABLED_case2_test1\n" + "\x1B[0;32m[ OK ]\x1B[m SystemTestsShard2.DISABLED_case2_test1 (XX ms)\n" + "\x1B[0;32m[ RUN ]\x1B[m SystemTestsShard3.DISABLED_case3_test1\n" + "\x1B[0;32m[ OK ]\x1B[m SystemTestsShard3.DISABLED_case3_test1 (XX ms)\n" "\x1B[0;32m[==========]\x1B[m 3 tests from 3 test suites ran. (XX ms total)\n" "\x1B[0;32m[ PASSED ]\x1B[m 3 tests.\n"; ASSERT_NE(-1, setenv("GTEST_TOTAL_SHARDS", "4", 1)); ASSERT_NE(-1, setenv("GTEST_SHARD_INDEX", "0", 1)); - ASSERT_NO_FATAL_FAILURE( - Verify("SystemTestsShard*.DISABLED*", expected, 0, - std::vector<const char*>{"--gtest_color=yes", "--no_gtest_format"})); + ASSERT_NO_FATAL_FAILURE(Verify("SystemTestsShard*.DISABLED*", expected, 0, + std::vector<const char*>{"--gtest_color=yes"})); } TEST_F(SystemTests, verify_sharding_error) { |