From 1b7e164233d6c115cec6ec6c4a864c88a3b9c1f1 Mon Sep 17 00:00:00 2001 From: Kaustabh Datta Choudhury Date: Tue, 6 Jan 2015 01:16:13 +0530 Subject: [PATCH] Bug 1115338 - ./mach mochitest-browser path/to/individual/test should always run test (despite skip-if/run-if conditions in manifest). r=jmaher --- testing/mochitest/runtests.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index 6ef4423c3117..8ba68cfc4184 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -1624,7 +1624,6 @@ class Mochitest(MochitestUtilsMixin): """ self.setTestRoot(options) manifest = self.getTestManifest(options) - if manifest: # Python 2.6 doesn't allow unicode keys to be used for keyword # arguments. This gross hack works around the problem until we @@ -1645,13 +1644,20 @@ class Mochitest(MochitestUtilsMixin): # In the case where we have a single file, we don't want to filter based on options such as subsuite. tests = manifest.active_tests(disabled=disabled, options=None, **info) for test in tests: - if 'disabled' in test: - del test['disabled'] + if 'disabled' in test: + del test['disabled'] + else: - tests = manifest.active_tests(disabled=disabled, options=options, **info) + tests = manifest.active_tests(disabled=disabled, options=options, **info) + if len(tests) == 0: + tests = manifest.active_tests(disabled=True, options=options, **info) + paths = [] for test in tests: + if len(tests) == 1 and 'disabled' in test: + del test['disabled'] + pathAbs = os.path.abspath(test['path']) assert pathAbs.startswith(self.testRootAbs) tp = pathAbs[len(self.testRootAbs):].replace('\\', '/').strip('/')