diff options
author | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-09-18 18:06:35 +0000 |
---|---|---|
committer | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-09-18 18:06:35 +0000 |
commit | f6b0dc0b408f38bb04079b14198d6bdf703e5e56 (patch) | |
tree | 44f4cc83029ced9b2281947e2aa9690fbdd6b15d /test | |
parent | 9e672bd5e303a9803fa5135c3c9f0122efa4c6bb (diff) | |
download | googletest-f6b0dc0b408f38bb04079b14198d6bdf703e5e56.tar.gz googletest-f6b0dc0b408f38bb04079b14198d6bdf703e5e56.tar.bz2 googletest-f6b0dc0b408f38bb04079b14198d6bdf703e5e56.zip |
Makes Google Test compile (and all tests pass) on cygwin (possibly on wingw too).
Diffstat (limited to 'test')
-rwxr-xr-x | test/gtest_output_test.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/gtest_output_test.py b/test/gtest_output_test.py index f91050c0..68cfe5ec 100755 --- a/test/gtest_output_test.py +++ b/test/gtest_output_test.py @@ -104,6 +104,20 @@ def RemoveTime(output): return re.sub(r'\(\d+ ms', '(? ms', output) +def RemoveTestCounts(output): + """Removes test counts from a Google Test program's output.""" + + output = re.sub(r'\d+ tests from \d+ test cases', + '? tests from ? test cases', output) + return re.sub(r'\d+ tests\.', '? tests.', output) + + +def RemoveDeathTests(output): + """Removes death test information from a Google Test program's output.""" + + return re.sub(r'\n.*DeathTest.*', '', output) + + def NormalizeOutput(output): """Normalizes output (the output of gtest_output_test_.exe).""" @@ -182,7 +196,11 @@ class GTestOutputTest(unittest.TestCase): golden = golden_file.read() golden_file.close() - self.assertEquals(golden, output) + # We want the test to pass regardless of death tests being + # supported or not. + self.assert_(output == golden or + RemoveTestCounts(output) == + RemoveTestCounts(RemoveDeathTests(golden))) if __name__ == '__main__': |