From d88da49d028d8d01c1e49761be577ed1cc1f5c1d Mon Sep 17 00:00:00 2001 From: shiqian Date: Fri, 25 Jul 2008 21:13:11 +0000 Subject: Adds a test for the GTEST_PRINT_TIME env var. By Balazs.Dan@gmail.com. --- test/gtest_env_var_test.py | 1 + test/gtest_env_var_test_.cc | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/test/gtest_env_var_test.py b/test/gtest_env_var_test.py index 64d17e85..1b86b5a9 100755 --- a/test/gtest_env_var_test.py +++ b/test/gtest_env_var_test.py @@ -101,6 +101,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, 'repeat', '999', '1') if IS_WINDOWS: diff --git a/test/gtest_env_var_test_.cc b/test/gtest_env_var_test_.cc index 81056e84..16b31103 100644 --- a/test/gtest_env_var_test_.cc +++ b/test/gtest_env_var_test_.cc @@ -81,6 +81,11 @@ void PrintFlag(const char* flag) { return; } + if (strcmp(flag, "print_time") == 0) { + cout << GTEST_FLAG(print_time); + return; + } + if (strcmp(flag, "repeat") == 0) { cout << GTEST_FLAG(repeat); return; -- cgit v1.2.3