Backed out changeset a5e2394cd75d

This commit is contained in:
Steve Fink
2011-05-12 11:13:14 -07:00
parent f6a3720827
commit dba618560e
11 changed files with 14 additions and 81 deletions

View File

@@ -15,6 +15,6 @@ script regress-352789.js
script regress-355101.js script regress-355101.js
script regress-355474-01.js script regress-355474-01.js
skip script regress-373678.js # obsolete test skip script regress-373678.js # obsolete test
require-or(debugMode,skip) script regress-429249.js skip script regress-429249.js
script regress-461233.js script regress-461233.js
script regress-463360.js script regress-463360.js

View File

@@ -32,4 +32,4 @@ script 15.8-1.js
script 15.9.5.js script 15.9.5.js
script 8.6.2.1-1.js script 8.6.2.1-1.js
script 9.9-1.js script 9.9-1.js
require-or(debugMode,skip) script trapflatclosure.js skip script trapflatclosure.js

View File

@@ -11,5 +11,5 @@ script regress-320854.js
script regress-327170.js script regress-327170.js
script regress-368516.js script regress-368516.js
script regress-385393-03.js script regress-385393-03.js
require-or(debugMode,skip) script regress-429248.js skip script regress-429248.js
script regress-430740.js script regress-430740.js

View File

@@ -164,16 +164,16 @@ skip script regress-418730.js # obsolete test
script regress-420612.js script regress-420612.js
script regress-420869-01.js script regress-420869-01.js
skip script regress-421621.js # obsolete test skip script regress-421621.js # obsolete test
require-or(debugMode,skip) script regress-422137.js skip script regress-422137.js
script regress-422592.js script regress-422592.js
script regress-424683-01.js script regress-424683-01.js
script regress-426711.js script regress-426711.js
script regress-427196-01.js script regress-427196-01.js
script regress-427196-02.js script regress-427196-02.js
script regress-427196-03.js script regress-427196-03.js
require-or(debugMode,skip) script regress-429264.js skip script regress-429264.js
script regress-429739.js script regress-429739.js
require-or(debugMode,skip) script regress-431428.js skip script regress-431428.js
skip script regress-432075.js # obsolete test skip script regress-432075.js # obsolete test
script regress-434837-01.js script regress-434837-01.js
fails script regress-435345-01.js fails script regress-435345-01.js

View File

@@ -46,4 +46,4 @@ script regress-379925.js
script regress-380506.js script regress-380506.js
script regress-410571.js script regress-410571.js
script regress-410649.js script regress-410649.js
require-or(debugMode,skip) script regress-429252.js skip script regress-429252.js

View File

@@ -358,7 +358,6 @@ if __name__ == '__main__':
call(cmd) call(cmd)
sys.exit() sys.exit()
results = None
if not test_list: if not test_list:
print 'no tests selected' print 'no tests selected'
else: else:
@@ -375,5 +374,5 @@ if __name__ == '__main__':
if output_file != sys.stdout: if output_file != sys.stdout:
output_file.close() output_file.close()
if results is None or not results.all_passed(): if not results.all_passed():
sys.exit(1) sys.exit(1)

View File

@@ -131,7 +131,6 @@ def parse(filename, xul_tester, reldir = ''):
expect = True expect = True
random = False random = False
slow = False slow = False
debugMode = False
pos = 0 pos = 0
while pos < len(parts): while pos < len(parts):
@@ -163,25 +162,6 @@ def parse(filename, xul_tester, reldir = ''):
if xul_tester.test(cond): if xul_tester.test(cond):
random = True random = True
pos += 1 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': elif parts[pos] == 'script':
script = parts[pos+1] script = parts[pos+1]
pos += 2 pos += 2
@@ -199,5 +179,5 @@ def parse(filename, xul_tester, reldir = ''):
assert script is not None assert script is not None
ans.append(TestCase(os.path.join(reldir, script), ans.append(TestCase(os.path.join(reldir, script),
enable, expect, random, slow, debugMode)) enable, expect, random, slow))
return ans return ans

View File

@@ -76,12 +76,8 @@ class Test(object):
def get_command(self, js_cmd_prefix): def get_command(self, js_cmd_prefix):
dir, filename = os.path.split(self.path) 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 './'. # There is a test that requires the path to start with './'.
cmd += [ '-f', './' + self.path ] return js_cmd_prefix + Test.prefix_command(dir) + [ '-f', './' + self.path ]
return cmd
def run(self, js_cmd_prefix, timeout=30.0): def run(self, js_cmd_prefix, timeout=30.0):
cmd = self.get_command(js_cmd_prefix) cmd = self.get_command(js_cmd_prefix)
@@ -91,13 +87,12 @@ class Test(object):
class TestCase(Test): class TestCase(Test):
"""A test case consisting of a test and an expected result.""" """A test case consisting of a test and an expected result."""
def __init__(self, path, enable, expect, random, slow, debugMode): def __init__(self, path, enable, expect, random, slow):
Test.__init__(self, path) Test.__init__(self, path)
self.enable = enable # bool: True => run test, False => don't run self.enable = enable # bool: True => run test, False => don't run
self.expect = expect # bool: expected result, True => pass self.expect = expect # bool: expected result, True => pass
self.random = random # bool: True => ignore output as 'random' self.random = random # bool: True => ignore output as 'random'
self.slow = slow # bool: True => test may run slowly self.slow = slow # bool: True => test may run slowly
self.debugMode = debugMode # bool: True => must be run in debug mode
def __str__(self): def __str__(self):
ans = self.path ans = self.path
@@ -109,8 +104,6 @@ class TestCase(Test):
ans += ', random' ans += ', random'
if self.slow: if self.slow:
ans += ', slow' ans += ', slow'
if self.debugMode:
ans += ', debugMode'
return ans return ans
class TestOutput: class TestOutput:

View File

@@ -92,11 +92,3 @@ skip-if(!browserIsRemote) != test-displayport-2.html test-displayport-ref.html #
# IPC Position-fixed frames/layers test # IPC Position-fixed frames/layers test
== test-pos-fixed.html test-pos-fixed-ref.html == 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

View File

@@ -106,13 +106,6 @@ must be one of the following:
fast on a 32-bit system but inordinately slow on a fast on a 32-bit system but inordinately slow on a
64-bit system). 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) asserts(count)
Loading the test and reference is known to assert exactly Loading the test and reference is known to assert exactly
count times. count times.

View File

@@ -547,7 +547,7 @@ function ReadManifest(aURL, inherited_status)
} }
var streamBuf = getStreamContent(inputStream); var streamBuf = getStreamContent(inputStream);
inputStream.close(); 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. // Build the sandbox for fails-if(), etc., condition evaluation.
var sandbox = BuildConditionSandbox(aURL); var sandbox = BuildConditionSandbox(aURL);
@@ -581,7 +581,7 @@ function ReadManifest(aURL, inherited_status)
var needs_focus = false; var needs_focus = false;
var slow = false; var slow = false;
while (items[0].match(/^(fails|needs-focus|random|skip|asserts|slow|require-or|silentfail)/)) { while (items[0].match(/^(fails|needs-focus|random|skip|asserts|slow|silentfail)/)) {
var item = items.shift(); var item = items.shift();
var stat; var stat;
var cond; var cond;
@@ -612,30 +612,6 @@ function ReadManifest(aURL, inherited_status)
} else if (item == "slow") { } else if (item == "slow") {
cond = false; cond = false;
slow = true; 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\((.*?)\)$/))) { } else if ((m = item.match(/^slow-if\((.*?)\)$/))) {
cond = false; cond = false;
if (Components.utils.evalInSandbox("(" + m[1] + ")", sandbox)) if (Components.utils.evalInSandbox("(" + m[1] + ")", sandbox))