Makes gtest print elapsed time by default.
This commit is contained in:
@@ -90,7 +90,7 @@ def TestEnvVarAffectsFlag(command):
|
||||
TestFlag(command, 'color', 'yes', 'auto')
|
||||
TestFlag(command, 'filter', 'FooTest.Bar', '*')
|
||||
TestFlag(command, 'output', 'tmp/foo.xml', '')
|
||||
TestFlag(command, 'print_time', '1', '0')
|
||||
TestFlag(command, 'print_time', '0', '1')
|
||||
TestFlag(command, 'repeat', '999', '1')
|
||||
TestFlag(command, 'throw_on_failure', '1', '0')
|
||||
TestFlag(command, 'death_test_style', 'threadsafe', 'fast')
|
||||
|
||||
@@ -976,6 +976,8 @@ GTEST_DEFINE_bool_(internal_skip_environment_and_ad_hoc_tests, false,
|
||||
// of them are intended to fail), and then compare the test results
|
||||
// with the "golden" file.
|
||||
int main(int argc, char **argv) {
|
||||
testing::GTEST_FLAG(print_time) = false;
|
||||
|
||||
// We just run the tests, knowing some of them are intended to fail.
|
||||
// We will use a separate Python script to compare the output of
|
||||
// this program with the golden file.
|
||||
|
||||
@@ -1204,7 +1204,7 @@ class GTestFlagSaverTest : public Test {
|
||||
GTEST_FLAG(filter) = "";
|
||||
GTEST_FLAG(list_tests) = false;
|
||||
GTEST_FLAG(output) = "";
|
||||
GTEST_FLAG(print_time) = false;
|
||||
GTEST_FLAG(print_time) = true;
|
||||
GTEST_FLAG(repeat) = 1;
|
||||
GTEST_FLAG(throw_on_failure) = false;
|
||||
}
|
||||
@@ -1227,7 +1227,7 @@ class GTestFlagSaverTest : public Test {
|
||||
EXPECT_STREQ("", GTEST_FLAG(filter).c_str());
|
||||
EXPECT_FALSE(GTEST_FLAG(list_tests));
|
||||
EXPECT_STREQ("", GTEST_FLAG(output).c_str());
|
||||
EXPECT_FALSE(GTEST_FLAG(print_time));
|
||||
EXPECT_TRUE(GTEST_FLAG(print_time));
|
||||
EXPECT_EQ(1, GTEST_FLAG(repeat));
|
||||
EXPECT_FALSE(GTEST_FLAG(throw_on_failure));
|
||||
|
||||
@@ -1239,7 +1239,7 @@ class GTestFlagSaverTest : public Test {
|
||||
GTEST_FLAG(filter) = "abc";
|
||||
GTEST_FLAG(list_tests) = true;
|
||||
GTEST_FLAG(output) = "xml:foo.xml";
|
||||
GTEST_FLAG(print_time) = true;
|
||||
GTEST_FLAG(print_time) = false;
|
||||
GTEST_FLAG(repeat) = 100;
|
||||
GTEST_FLAG(throw_on_failure) = true;
|
||||
}
|
||||
@@ -4325,7 +4325,7 @@ struct Flags {
|
||||
filter(""),
|
||||
list_tests(false),
|
||||
output(""),
|
||||
print_time(false),
|
||||
print_time(true),
|
||||
repeat(1),
|
||||
throw_on_failure(false) {}
|
||||
|
||||
@@ -4436,7 +4436,7 @@ class InitGoogleTestTest : public Test {
|
||||
GTEST_FLAG(filter) = "";
|
||||
GTEST_FLAG(list_tests) = false;
|
||||
GTEST_FLAG(output) = "";
|
||||
GTEST_FLAG(print_time) = false;
|
||||
GTEST_FLAG(print_time) = true;
|
||||
GTEST_FLAG(repeat) = 1;
|
||||
GTEST_FLAG(throw_on_failure) = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user