зеркало из https://github.com/mozilla/gecko-dev.git
Bug 473817 - allow conditional 'include' in reftest manifests. r=dbaron, a=test-only
This commit is contained in:
Родитель
e11874b2fd
Коммит
94e66b3075
|
@ -40,7 +40,15 @@ must be one of the following:
|
|||
|
||||
1. Inclusion of another manifest
|
||||
|
||||
include <relative_path>
|
||||
<failure-type>* include <relative_path>
|
||||
|
||||
<failure-type> is the same as listed below for a test item. As for
|
||||
test items, multiple failure types listed on the same line are
|
||||
combined by using the last matching failure type listed. However,
|
||||
the failure type on a manifest is combined with the failure type on
|
||||
the test (or on a nested manifest) with the rule that the last in the
|
||||
following list wins: fails, random, skip. (In other words, skip
|
||||
always wins, and random beats fails.)
|
||||
|
||||
2. A test item
|
||||
|
||||
|
|
|
@ -121,6 +121,12 @@ const TYPE_LOAD = 'load'; // test without a reference (just test that it doe
|
|||
// not assert, crash, hang, or leak)
|
||||
const TYPE_SCRIPT = 'script'; // test contains individual test results
|
||||
|
||||
// The order of these constants matters, since when we have a status
|
||||
// listed for a *manifest*, we combine the status with the status for
|
||||
// the test by using the *larger*.
|
||||
// FIXME: In the future, we may also want to use this rule for combining
|
||||
// statuses that are on the same line (rather than making the last one
|
||||
// win).
|
||||
const EXPECTED_PASS = 0;
|
||||
const EXPECTED_FAIL = 1;
|
||||
const EXPECTED_RANDOM = 2;
|
||||
|
@ -505,12 +511,12 @@ function ReadTopManifest(aFileURL)
|
|||
var url = gIOService.newURI(aFileURL, null, null);
|
||||
if (!url)
|
||||
throw "Expected a file or http URL for the manifest.";
|
||||
ReadManifest(url);
|
||||
ReadManifest(url, EXPECTED_PASS);
|
||||
}
|
||||
|
||||
// Note: If you materially change the reftest manifest parsing,
|
||||
// please keep the parser in print-manifest-dirs.py in sync.
|
||||
function ReadManifest(aURL)
|
||||
function ReadManifest(aURL, inherited_status)
|
||||
{
|
||||
var secMan = CC[NS_SCRIPTSECURITYMANAGER_CONTRACTID]
|
||||
.getService(CI.nsIScriptSecurityManager);
|
||||
|
@ -558,6 +564,7 @@ function ReadManifest(aURL)
|
|||
var maxAsserts = 0;
|
||||
var needs_focus = false;
|
||||
var slow = false;
|
||||
|
||||
while (items[0].match(/^(fails|needs-focus|random|skip|asserts|slow|silentfail)/)) {
|
||||
var item = items.shift();
|
||||
var stat;
|
||||
|
@ -613,6 +620,8 @@ function ReadManifest(aURL)
|
|||
}
|
||||
}
|
||||
|
||||
expected_status = Math.max(expected_status, inherited_status);
|
||||
|
||||
if (minAsserts > maxAsserts) {
|
||||
throw "Bad range in manifest file " + aURL.spec + " line " + lineNo;
|
||||
}
|
||||
|
@ -649,7 +658,7 @@ function ReadManifest(aURL)
|
|||
var incURI = gIOService.newURI(items[1], null, listURL);
|
||||
secMan.checkLoadURI(aURL, incURI,
|
||||
CI.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
||||
ReadManifest(incURI);
|
||||
ReadManifest(incURI, expected_status);
|
||||
} else if (items[0] == TYPE_LOAD) {
|
||||
if (items.length != 2 ||
|
||||
(expected_status != EXPECTED_PASS &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче