зеркало из https://github.com/mozilla/gecko-dev.git
Bug 634648 - Mark tests that require to be run in debug mode (r=dbaron,dmandelin)
--HG-- extra : rebase_source : 6f152c72627ce61065e5f468c273099804b578d5
This commit is contained in:
Родитель
68805c3cda
Коммит
d8cf5c9318
|
@ -15,6 +15,6 @@ script regress-352789.js
|
|||
script regress-355101.js
|
||||
script regress-355474-01.js
|
||||
skip script regress-373678.js # obsolete test
|
||||
skip script regress-429249.js
|
||||
require-or(debugMode,skip) script regress-429249.js
|
||||
script regress-461233.js
|
||||
script regress-463360.js
|
||||
|
|
|
@ -32,4 +32,4 @@ script 15.8-1.js
|
|||
script 15.9.5.js
|
||||
script 8.6.2.1-1.js
|
||||
script 9.9-1.js
|
||||
skip script trapflatclosure.js
|
||||
require-or(debugMode,skip) script trapflatclosure.js
|
||||
|
|
|
@ -11,5 +11,5 @@ script regress-320854.js
|
|||
script regress-327170.js
|
||||
script regress-368516.js
|
||||
script regress-385393-03.js
|
||||
skip script regress-429248.js
|
||||
require-or(debugMode,skip) script regress-429248.js
|
||||
script regress-430740.js
|
||||
|
|
|
@ -164,16 +164,16 @@ skip script regress-418730.js # obsolete test
|
|||
script regress-420612.js
|
||||
script regress-420869-01.js
|
||||
skip script regress-421621.js # obsolete test
|
||||
skip script regress-422137.js
|
||||
require-or(debugMode,skip) script regress-422137.js
|
||||
script regress-422592.js
|
||||
script regress-424683-01.js
|
||||
script regress-426711.js
|
||||
script regress-427196-01.js
|
||||
script regress-427196-02.js
|
||||
script regress-427196-03.js
|
||||
skip script regress-429264.js
|
||||
require-or(debugMode,skip) script regress-429264.js
|
||||
script regress-429739.js
|
||||
skip script regress-431428.js
|
||||
require-or(debugMode,skip) script regress-431428.js
|
||||
skip script regress-432075.js # obsolete test
|
||||
script regress-434837-01.js
|
||||
fails script regress-435345-01.js
|
||||
|
|
|
@ -46,4 +46,4 @@ script regress-379925.js
|
|||
script regress-380506.js
|
||||
script regress-410571.js
|
||||
script regress-410649.js
|
||||
skip script regress-429252.js
|
||||
require-or(debugMode,skip) script regress-429252.js
|
||||
|
|
|
@ -358,6 +358,7 @@ if __name__ == '__main__':
|
|||
call(cmd)
|
||||
sys.exit()
|
||||
|
||||
results = None
|
||||
if not test_list:
|
||||
print 'no tests selected'
|
||||
else:
|
||||
|
@ -374,5 +375,5 @@ if __name__ == '__main__':
|
|||
if output_file != sys.stdout:
|
||||
output_file.close()
|
||||
|
||||
if not results.all_passed():
|
||||
if results is None or not results.all_passed():
|
||||
sys.exit(1)
|
||||
|
|
|
@ -131,6 +131,7 @@ def parse(filename, xul_tester, reldir = ''):
|
|||
expect = True
|
||||
random = False
|
||||
slow = False
|
||||
debugMode = False
|
||||
|
||||
pos = 0
|
||||
while pos < len(parts):
|
||||
|
@ -162,6 +163,25 @@ def parse(filename, xul_tester, reldir = ''):
|
|||
if xul_tester.test(cond):
|
||||
random = True
|
||||
pos += 1
|
||||
elif parts[pos].startswith('require-or'):
|
||||
cond = parts[pos][len('require-or('):-1]
|
||||
(preconditions, fallback_action) = re.split(",", cond)
|
||||
for precondition in re.split("&&", preconditions):
|
||||
if precondition == 'debugMode':
|
||||
debugMode = True
|
||||
elif precondition == 'true':
|
||||
pass
|
||||
else:
|
||||
if fallback_action == "skip":
|
||||
expect = enable = False
|
||||
elif fallback_action == "fail":
|
||||
expect = False
|
||||
elif fallback_action == "random":
|
||||
random = True
|
||||
else:
|
||||
raise Exception("Invalid precondition '%s' or fallback action '%s'" % (precondition, fallback_action))
|
||||
break
|
||||
pos += 1
|
||||
elif parts[pos] == 'script':
|
||||
script = parts[pos+1]
|
||||
pos += 2
|
||||
|
@ -178,6 +198,6 @@ def parse(filename, xul_tester, reldir = ''):
|
|||
pos += 1
|
||||
|
||||
assert script is not None
|
||||
ans.append(TestCase(os.path.join(reldir, script),
|
||||
enable, expect, random, slow))
|
||||
ans.append(TestCase(os.path.join(reldir, script),
|
||||
enable, expect, random, slow, debugMode))
|
||||
return ans
|
||||
|
|
|
@ -76,8 +76,12 @@ class Test(object):
|
|||
|
||||
def get_command(self, js_cmd_prefix):
|
||||
dir, filename = os.path.split(self.path)
|
||||
cmd = js_cmd_prefix + Test.prefix_command(dir)
|
||||
if self.debugMode:
|
||||
cmd += [ '-d' ]
|
||||
# There is a test that requires the path to start with './'.
|
||||
return js_cmd_prefix + Test.prefix_command(dir) + [ '-f', './' + self.path ]
|
||||
cmd += [ '-f', './' + self.path ]
|
||||
return cmd
|
||||
|
||||
def run(self, js_cmd_prefix, timeout=30.0):
|
||||
cmd = self.get_command(js_cmd_prefix)
|
||||
|
@ -87,12 +91,13 @@ class Test(object):
|
|||
class TestCase(Test):
|
||||
"""A test case consisting of a test and an expected result."""
|
||||
|
||||
def __init__(self, path, enable, expect, random, slow):
|
||||
def __init__(self, path, enable, expect, random, slow, debugMode):
|
||||
Test.__init__(self, path)
|
||||
self.enable = enable # bool: True => run test, False => don't run
|
||||
self.expect = expect # bool: expected result, True => pass
|
||||
self.random = random # bool: True => ignore output as 'random'
|
||||
self.slow = slow # bool: True => test may run slowly
|
||||
self.debugMode = debugMode # bool: True => must be run in debug mode
|
||||
|
||||
def __str__(self):
|
||||
ans = self.path
|
||||
|
@ -104,6 +109,8 @@ class TestCase(Test):
|
|||
ans += ', random'
|
||||
if self.slow:
|
||||
ans += ', slow'
|
||||
if self.debugMode:
|
||||
ans += ', debugMode'
|
||||
return ans
|
||||
|
||||
class TestOutput:
|
||||
|
|
|
@ -92,3 +92,11 @@ skip-if(!browserIsRemote) != test-displayport-2.html test-displayport-ref.html #
|
|||
|
||||
# IPC Position-fixed frames/layers test
|
||||
== test-pos-fixed.html test-pos-fixed-ref.html
|
||||
|
||||
# reftest syntax: require-or
|
||||
require-or(unrecognizedCondition,skip) script scripttest-fail.html
|
||||
require-or(true&&unrecognizedCondition,skip) script scripttest-fail.html
|
||||
require-or(unrecognizedCondition&&true,skip) script scripttest-fail.html
|
||||
require-or(unrecognizedCondition,fails) script scripttest-fail.html
|
||||
require-or(true,fails) script scripttest-pass.html
|
||||
require-or(true&&true,fails) script scripttest-pass.html
|
||||
|
|
|
@ -106,6 +106,13 @@ must be one of the following:
|
|||
fast on a 32-bit system but inordinately slow on a
|
||||
64-bit system).
|
||||
|
||||
require-or(cond1&&cond2&&...,fallback)
|
||||
Require some particular setup be performed or environmental
|
||||
condition(s) made true (eg setting debug mode) before the test
|
||||
is run. If any condition is unknown, unimplemented, or fails,
|
||||
revert to the fallback failure-type.
|
||||
Example: require-or(debugMode,skip)
|
||||
|
||||
asserts(count)
|
||||
Loading the test and reference is known to assert exactly
|
||||
count times.
|
||||
|
|
|
@ -547,7 +547,7 @@ function ReadManifest(aURL, inherited_status)
|
|||
}
|
||||
var streamBuf = getStreamContent(inputStream);
|
||||
inputStream.close();
|
||||
var lines = streamBuf.split(/(\n|\r|\r\n)/);
|
||||
var lines = streamBuf.split(/\n|\r|\r\n/);
|
||||
|
||||
// Build the sandbox for fails-if(), etc., condition evaluation.
|
||||
var sandbox = BuildConditionSandbox(aURL);
|
||||
|
@ -581,7 +581,7 @@ function ReadManifest(aURL, inherited_status)
|
|||
var needs_focus = false;
|
||||
var slow = false;
|
||||
|
||||
while (items[0].match(/^(fails|needs-focus|random|skip|asserts|slow|silentfail)/)) {
|
||||
while (items[0].match(/^(fails|needs-focus|random|skip|asserts|slow|require-or|silentfail)/)) {
|
||||
var item = items.shift();
|
||||
var stat;
|
||||
var cond;
|
||||
|
@ -612,6 +612,30 @@ function ReadManifest(aURL, inherited_status)
|
|||
} else if (item == "slow") {
|
||||
cond = false;
|
||||
slow = true;
|
||||
} else if ((m = item.match(/^require-or\((.*?)\)$/))) {
|
||||
var args = m[1].split(/,/);
|
||||
if (args.length != 2) {
|
||||
throw "Error 7 in manifest file " + aURL.spec + " line " + lineNo + ": wrong number of args to require-or";
|
||||
}
|
||||
var [precondition_str, fallback_action] = args;
|
||||
var preconditions = precondition_str.split(/&&/);
|
||||
cond = false;
|
||||
for each (var precondition in preconditions) {
|
||||
if (precondition === "debugMode") {
|
||||
// Currently unimplemented. Requires asynchronous
|
||||
// JSD call + getting an event while no JS is running
|
||||
stat = fallback_action;
|
||||
cond = true;
|
||||
break;
|
||||
} else if (precondition === "true") {
|
||||
// For testing
|
||||
} else {
|
||||
// Unknown precondition. Assume it is unimplemented.
|
||||
stat = fallback_action;
|
||||
cond = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ((m = item.match(/^slow-if\((.*?)\)$/))) {
|
||||
cond = false;
|
||||
if (Components.utils.evalInSandbox("(" + m[1] + ")", sandbox))
|
||||
|
|
Загрузка…
Ссылка в новой задаче