Bug 892439: runcppunittests.py should accept either test files or test directories from the command line; r=ted
authorDan Minor <dminor@mozilla.com>
Fri, 12 Jul 2013 07:42:14 -0400
changeset 150584 1eb8567e0743cb0c1252721ead67493e976d5fa6
parent 150583 8ef0e9fa1f16874abbf282d212be14452ed31747
child 150585 d218deb5ac962653a92bd415f13639ee12042edf
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs892439
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 892439: runcppunittests.py should accept either test files or test directories from the command line; r=ted
testing/runcppunittests.py
--- a/testing/runcppunittests.py
+++ b/testing/runcppunittests.py
@@ -134,17 +134,23 @@ def main():
     parser = CPPUnittestOptions()
     options, args = parser.parse_args()
     if not args:
         print >>sys.stderr, """Usage: %s <test binary> [<test binary>...]""" % sys.argv[0]
         sys.exit(1)
     if not options.xre_path:
         print >>sys.stderr, """Error: --xre-path is required"""
         sys.exit(1)
-    progs = [os.path.abspath(p) for p in args]
+    progs = []
+    for p in args:
+        if os.path.isdir(p):
+            #filter out .py files packaged with the unit tests
+            progs.extend([os.path.abspath(os.path.join(p, x)) for x in os.listdir(p) if not x.endswith('.py')])
+        else:
+            progs.append(os.path.abspath(p))
     options.xre_path = os.path.abspath(options.xre_path)
     tester = CPPUnitTests()
     try:
         result = tester.run_tests(progs, options.xre_path, options.symbols_path)
     except Exception, e:
         log.error(str(e))
         result = False
     sys.exit(0 if result else 1)