Bug 880555 - Fix --test-manifest option for non mochitest-plain. r=jmaher
authorFelipe Gomes <felipc@gmail.com>
Mon, 17 Jun 2013 19:04:04 +0200
changeset 146798 8b4b7306f981ee04ddf0c109ad2c945d0bf32df1
parent 146797 ede58026dcb5505d80432a0d97297d7fa9059da1
child 146799 6f5a5f22d61d96cf5f1e0cc9dd135e0d2e779be7
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs880555
milestone24.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 880555 - Fix --test-manifest option for non mochitest-plain. r=jmaher
testing/mochitest/tests/SimpleTest/setup.js
--- a/testing/mochitest/tests/SimpleTest/setup.js
+++ b/testing/mochitest/tests/SimpleTest/setup.js
@@ -231,29 +231,30 @@ function filterTests(filterFile, runOnly
     excludetests = filter.excludetests;
   if (!('runtests' in filter) && !('excludetests' in filter)) {
     if (runOnly == 'true') {
       runtests = filter;
     } else
       excludetests = filter;
   }
 
+  var testRoot = config.testRoot || "tests";
   // Start with gTestList, and put everything that's in 'runtests' in
   // filteredTests.
   if (Object.keys(runtests).length) {
     for (var i = 0; i < gTestList.length; i++) {
       var test_path = gTestList[i];
       var tmp_path = test_path.replace(/^\//, '');
       for (var f in runtests) {
         // Remove leading /tests/ if exists
         file = f.replace(/^\//, '')
         file = file.replace(/^tests\//, '')
 
-        // Match directory or filename, gTestList has tests/<path>
-        if (tmp_path.match("^tests/" + file) != null) {
+        // Match directory or filename, gTestList has <testroot>/<path>
+        if (tmp_path.match(testRoot + "/" + file) != null) {
           filteredTests.push(test_path);
           break;
         }
       }
     }
   }
   else {
     filteredTests = gTestList.slice(0);
@@ -267,18 +268,18 @@ function filterTests(filterFile, runOnly
       var found = false;
       var test_path = filteredTests[i];
       var tmp_path = test_path.replace(/^\//, '');
       for (var f in excludetests) {
         // Remove leading /tests/ if exists
         file = f.replace(/^\//, '')
         file = file.replace(/^tests\//, '')
 
-        // Match directory or filename, gTestList has tests/<path>
-        if (tmp_path.match("^tests/" + file) != null) {
+        // Match directory or filename, gTestList has <testroot>/<path>
+        if (tmp_path.match(testRoot + "/" + file) != null) {
           found = true;
           break;
         }
       }
       if (!found) {
         refilteredTests.push(test_path);
       }
     }