| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import imp | 5 import imp |
| 6 import os.path | 6 import os.path |
| 7 import sys | 7 import sys |
| 8 import unittest | 8 import unittest |
| 9 | 9 |
| 10 try: | 10 try: |
| 11 imp.find_module("pylib") | 11 imp.find_module("pylib") |
| 12 except ImportError: | 12 except ImportError: |
| 13 sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | 13 sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
| 14 from pylib.apptest_gtest import _gtest_list_tests | 14 from devtoolslib.apptest_gtest import _gtest_list_tests |
| 15 | 15 |
| 16 | 16 |
| 17 class GTestListTestsTest(unittest.TestCase): | 17 class GTestListTestsTest(unittest.TestCase): |
| 18 """Tests |_gtest_list_tests()| handling of --gtest_list_tests output.""" | 18 """Tests |_gtest_list_tests()| handling of --gtest_list_tests output.""" |
| 19 | 19 |
| 20 def testSingleSuiteAndFixture(self): | 20 def testSingleSuiteAndFixture(self): |
| 21 """Tests a single suite with a single fixture.""" | 21 """Tests a single suite with a single fixture.""" |
| 22 gtest_output = "TestSuite.\n TestFixture\n" | 22 gtest_output = "TestSuite.\n TestFixture\n" |
| 23 expected_test_list = ["TestSuite.TestFixture"] | 23 expected_test_list = ["TestSuite.TestFixture"] |
| 24 self.assertEquals(_gtest_list_tests(gtest_output), expected_test_list) | 24 self.assertEquals(_gtest_list_tests(gtest_output), expected_test_list) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 48 self.assertRaises(Exception, _gtest_list_tests, "Foo") | 48 self.assertRaises(Exception, _gtest_list_tests, "Foo") |
| 49 self.assertRaises(Exception, _gtest_list_tests, "Foo\n") | 49 self.assertRaises(Exception, _gtest_list_tests, "Foo\n") |
| 50 self.assertRaises(Exception, _gtest_list_tests, "Foo.Bar\n") | 50 self.assertRaises(Exception, _gtest_list_tests, "Foo.Bar\n") |
| 51 self.assertRaises(Exception, _gtest_list_tests, "Foo.\nBar\n") | 51 self.assertRaises(Exception, _gtest_list_tests, "Foo.\nBar\n") |
| 52 self.assertRaises(Exception, _gtest_list_tests, "Foo.\r\nBar\r\nGaz\r\n") | 52 self.assertRaises(Exception, _gtest_list_tests, "Foo.\r\nBar\r\nGaz\r\n") |
| 53 self.assertRaises(Exception, _gtest_list_tests, "Foo.\nBar.\n Gaz\n") | 53 self.assertRaises(Exception, _gtest_list_tests, "Foo.\nBar.\n Gaz\n") |
| 54 | 54 |
| 55 | 55 |
| 56 if __name__ == "__main__": | 56 if __name__ == "__main__": |
| 57 unittest.main() | 57 unittest.main() |
| OLD | NEW |