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

Unified Diff: mojo/tools/mopy/gtest_list_tests_unittest.py

Issue 741323002: Handle and surface application test failures. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Address comments. Created 6 years, 1 month 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 | « mojo/tools/mopy/gtest_list_tests.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/tools/mopy/gtest_list_tests_unittest.py
diff --git a/mojo/tools/mopy/gtest_list_tests_unittest.py b/mojo/tools/mopy/gtest_list_tests_unittest.py
index 917c6f9c7d30059dcdd5be55925592d6117e2784..44dc276d52a50d3de5dbc40b585a34e6d6fffc0f 100644
--- a/mojo/tools/mopy/gtest_list_tests_unittest.py
+++ b/mojo/tools/mopy/gtest_list_tests_unittest.py
@@ -11,14 +11,8 @@ class GTestListTestsTest(unittest.TestCase):
def testSingleSuiteAndFixture(self):
"""Tests a single suite with a single fixture."""
- gtest_output = "TestSuite.\n TestFixture1"
- expected_test_list = ["TestSuite.TestFixture1"]
- self.assertEquals(gtest_list_tests(gtest_output), expected_test_list)
-
- def testExtraBlankLinesAndSpaces(self):
- """Tests handling of extra blank lines and extra spaces before fixtures."""
- gtest_output = "TestSuite.\n\n TestFixture1\n\n"
- expected_test_list = ["TestSuite.TestFixture1"]
+ gtest_output = "TestSuite.\n TestFixture\n"
+ expected_test_list = ["TestSuite.TestFixture"]
self.assertEquals(gtest_list_tests(gtest_output), expected_test_list)
def testWindowsNewlines(self):
@@ -29,7 +23,7 @@ class GTestListTestsTest(unittest.TestCase):
def testSingleSuiteAndMultipleFixtures(self):
"""Tests a single suite with multiple fixtures."""
- gtest_output = "TestSuite.\n TestFixture1\n TestFixture2"
+ gtest_output = "TestSuite.\n TestFixture1\n TestFixture2\n"
expected_test_list = ["TestSuite.TestFixture1", "TestSuite.TestFixture2"]
self.assertEquals(gtest_list_tests(gtest_output), expected_test_list)
@@ -41,5 +35,15 @@ class GTestListTestsTest(unittest.TestCase):
"TestSuite2.TestFixtureA", "TestSuite2.TestFixtureB"]
self.assertEquals(gtest_list_tests(gtest_output), expected_test_list)
+ def testUnrecognizedFormats(self):
+ """Tests examples of unrecognized --gtest_list_tests output."""
+ self.assertRaises(Exception, gtest_list_tests, "Foo")
+ self.assertRaises(Exception, gtest_list_tests, "Foo\n")
+ self.assertRaises(Exception, gtest_list_tests, "Foo.Bar\n")
+ self.assertRaises(Exception, gtest_list_tests, "Foo.\nBar\n")
+ self.assertRaises(Exception, gtest_list_tests, "Foo.\r\nBar\r\nGaz\r\n")
+ self.assertRaises(Exception, gtest_list_tests, "Foo.\nBar.\n Gaz\n")
+
+
if __name__ == "__main__":
unittest.main()
« no previous file with comments | « mojo/tools/mopy/gtest_list_tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698