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

Unified Diff: build/android/pylib/gtest/test_package_test.py

Issue 441783002: [Android] Update gtest test list parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit errors. Created 6 years, 4 months 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 | « build/android/pylib/gtest/test_package.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/gtest/test_package_test.py
diff --git a/build/android/pylib/gtest/test_package_test.py b/build/android/pylib/gtest/test_package_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..9e91c5ae9bb8d0b0fd66afe11b658d234558e553
--- /dev/null
+++ b/build/android/pylib/gtest/test_package_test.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import unittest
+
+from pylib.gtest import test_package
+
+# pylint: disable=W0212
+
+
+class TestPackageTest(unittest.TestCase):
+
+ def testParseGTestListTests_simple(self):
+ raw_output = [
+ 'TestCaseOne.',
+ ' testOne',
+ ' testTwo',
+ 'TestCaseTwo.',
+ ' testThree',
+ ' testFour',
+ ]
+ actual = test_package.TestPackage._ParseGTestListTests(raw_output)
+ expected = [
+ 'TestCaseOne.testOne',
+ 'TestCaseOne.testTwo',
+ 'TestCaseTwo.testThree',
+ 'TestCaseTwo.testFour',
+ ]
+ self.assertEqual(expected, actual)
+
+ def testParseGTestListTests_parameterized_old(self):
+ raw_output = [
+ 'PTestCase.',
+ ' testWithValueParam/0',
+ ' testWithValueParam/1',
+ ]
+ actual = test_package.TestPackage._ParseGTestListTests(raw_output)
+ expected = [
+ 'PTestCase.testWithValueParam/0',
+ 'PTestCase.testWithValueParam/1',
+ ]
+ self.assertEqual(expected, actual)
+
+ def testParseGTestListTests_parameterized_new(self):
+ raw_output = [
+ 'PTestCase.',
+ ' testWithValueParam/0 # GetParam() = 0',
+ ' testWithValueParam/1 # GetParam() = 1',
+ ]
+ actual = test_package.TestPackage._ParseGTestListTests(raw_output)
+ expected = [
+ 'PTestCase.testWithValueParam/0',
+ 'PTestCase.testWithValueParam/1',
+ ]
+ self.assertEqual(expected, actual)
+
+
+if __name__ == '__main__':
+ unittest.main(verbosity=2)
+
« no previous file with comments | « build/android/pylib/gtest/test_package.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698