Change the default to gtest format.
The test infrastructure expects gtest format, so switch it to be the default.
Bug: 128906261
Test: Unit tests pass.
Test: bionic unit tests have the gtest format.
Change-Id: I8b6395bea11f269e553b5fae8f5fb0408cbf1963
diff --git a/Options.cpp b/Options.cpp
index 5de9157..0b2ba51 100644
--- a/Options.cpp
+++ b/Options.cpp
@@ -44,6 +44,7 @@
{"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}},
{
@@ -225,7 +226,8 @@
strings_["gtest_filter"] = "";
bools_.clear();
bools_["gtest_print_time"] = ::testing::GTEST_FLAG(print_time);
- bools_["gtest_format"] = false;
+ 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;
@@ -299,6 +301,11 @@
return false;
}
}
+
+ // If no_gtest_format was specified, it overrides gtest_format.
+ if (bools_.at("no_gtest_format")) {
+ bools_["gtest_format"] = false;
+ }
return true;
}