Bug 892439: runcppunittests.py should accept either test files or test directories from the command line; r=ted
--- 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)