Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1402)

Unified Diff: scripts/common/unittests/gtest_utils_test.py

Issue 109223007: GTTF: Make runtest.py use the new test launcher's JSON summary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/common/gtest_utils.py ('k') | scripts/slave/runtest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/common/unittests/gtest_utils_test.py
===================================================================
--- scripts/common/unittests/gtest_utils_test.py (revision 240792)
+++ scripts/common/unittests/gtest_utils_test.py (working copy)
@@ -638,5 +638,49 @@
self.assertEqual(['Foo.Bar'], parser.FailedTests(True, True))
+class TestGTestJSONParserTests(unittest.TestCase):
+ def testPassedTests(self):
+ parser = gtest_utils.GTestJSONParser()
+ parser._ProcessJSONData({'per_iteration_data': [ # pylint: disable=W0212
+ {
+ 'Test.One': [{'status': 'SUCCESS', 'output_snippet': ''}],
+ 'Test.Two': [{'status': 'SUCCESS', 'output_snippet': ''}],
+ }
+ ]})
+
+ self.assertEqual(['Test.One', 'Test.Two'], parser.PassedTests())
+ self.assertEqual([], parser.FailedTests())
+ self.assertEqual(0, parser.FlakyTests())
+
+ def testFailedTests(self):
+ parser = gtest_utils.GTestJSONParser()
+ parser._ProcessJSONData({'per_iteration_data': [ # pylint: disable=W0212
+ {
+ 'Test.One': [{'status': 'FAILURE', 'output_snippet': ''}],
+ 'Test.Two': [{'status': 'FAILURE', 'output_snippet': ''}],
+ }
+ ]})
+
+ self.assertEqual([], parser.PassedTests())
+ self.assertEqual(['Test.One', 'Test.Two'], parser.FailedTests())
+ self.assertEqual(0, parser.FlakyTests())
+
+ def testFlakyTests(self):
+ parser = gtest_utils.GTestJSONParser()
+ parser._ProcessJSONData({'per_iteration_data': [ # pylint: disable=W0212
+ {
+ 'Test.One': [{'status': 'FAILURE', 'output_snippet': ''}],
+ 'Test.Two': [
+ {'status': 'FAILURE', 'output_snippet': ''},
+ {'status': 'SUCCESS', 'output_snippet': ''},
+ ],
+ }
+ ]})
+
+ self.assertEqual(['Test.Two'], parser.PassedTests())
+ self.assertEqual(['Test.One'], parser.FailedTests())
+ self.assertEqual(1, parser.FlakyTests())
+
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « scripts/common/gtest_utils.py ('k') | scripts/slave/runtest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698