Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
Bug 1077372 - When a jpm add-on depends on addon-pathfinder then jpm …
Browse files Browse the repository at this point in the history
…test fails to run the pathfinder tests
  • Loading branch information
erikvold committed Oct 7, 2014
1 parent 5fbe678 commit 7cb18ec
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/sdk/deprecated/unit-test-finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {}
var ios = Cc['@mozilla.org/network/io-service;1']
.getService(Ci.nsIIOService);

const TEST_REGEX = /(([^\/]+\/)(?:lib\/)?)?(tests?\/test-[^\.\/]+)\.js$/;
const CFX_TEST_REGEX = /((?:[^\/]+\/)(?:lib\/)?)?(tests?\/test-[^\.\/]+)\.js$/;
const JPM_TEST_REGEX = /^(tests?\/test-[^\.\/]+)\.js$/;

const { mapcat, map, filter, fromEnumerator } = require("sdk/util/sequence");

Expand All @@ -51,6 +52,8 @@ const removeDups = (array) => array.reduce((result, value) => {
}, []);

const getSuites = function getSuites({ id, filter }) {
const TEST_REGEX = isNative ? JPM_TEST_REGEX : CFX_TEST_REGEX;

return getAddon(id).then(addon => {
let fileURI = addon.getResourceURI("tests/");
let isPacked = fileURI.scheme == "jar";
Expand All @@ -59,7 +62,7 @@ const getSuites = function getSuites({ id, filter }) {
let suites = [];
let addEntry = (entry) => {
if (filter(entry) && TEST_REGEX.test(entry)) {
let suite = (isNative ? "./" : "") + (RegExp.$2 || "") + RegExp.$3;
let suite = (isNative ? "./" : "") + (RegExp.$1 || "") + (RegExp.$2 || "");
suites.push(suite);
}
}
Expand Down

0 comments on commit 7cb18ec

Please sign in to comment.