Bug 1057453 - 'mach test filename' should test a single file. r=gps
authorTomasz Kołodziejski <tkolodziejski@mozilla.com>
Wed, 03 Sep 2014 13:06:00 +0200
changeset 203493 f5134820671ac0eecc952364abeafb1be86967db
parent 203492 4a4e0c618649904bf572156453b83f7c59bf96c7
child 203494 68655854f53d6e8117665febc7736aa5a27cdbf0
push id48682
push usercbook@mozilla.com
push dateThu, 04 Sep 2014 06:22:54 +0000
treeherdermozilla-inbound@68655854f53d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1057453
milestone35.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 1057453 - 'mach test filename' should test a single file. r=gps
testing/mochitest/mach_commands.py
--- a/testing/mochitest/mach_commands.py
+++ b/testing/mochitest/mach_commands.py
@@ -214,19 +214,19 @@ class MochitestRunner(MozbuildObject):
 
         keep_open denotes whether to keep the browser open after tests
         complete.
         """
         if rerun_failures and test_paths:
             print('Cannot specify both --rerun-failures and a test path.')
             return 1
 
-        # Need to call relpath before os.chdir() below.
+        # Make absolute paths relative before calling os.chdir() below.
         if test_paths:
-            test_paths = [self._wrap_path_argument(p).relpath() for p in test_paths]
+            test_paths = [self._wrap_path_argument(p).relpath() if os.path.isabs(p) else p for p in test_paths]
 
         failure_file_path = os.path.join(self.statedir, 'mochitest_failures.json')
 
         if rerun_failures and not os.path.exists(failure_file_path):
             print('No failure file present. Did you run mochitests before?')
             return 1
 
         # runtests.py is ambiguous, so we load the file/module manually.