зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1248555: run each WebAssembly spec test in its own script; r=mbx
MozReview-Commit-ID: 3DsyJamjqKy --HG-- extra : rebase_source : 2d880e37e89f91ceb729b216fe7629ec6d26a13e
This commit is contained in:
Родитель
dfb8d11072
Коммит
4dbae087a1
|
@ -1,5 +1,18 @@
|
||||||
load(libdir + "wasm.js");
|
load(libdir + "wasm.js");
|
||||||
load(scriptdir + "spec/list.js");
|
|
||||||
|
// This is meant to be a small and dumb interpreter for wast files. Either it
|
||||||
|
// is imported by another script, which needs to define an array of arguments
|
||||||
|
// called importedArgs, or args need to be passed to the command line.
|
||||||
|
//
|
||||||
|
// Possible arguments include:
|
||||||
|
// -d enable debug verbose mode
|
||||||
|
// -c computes line numbers in wast files (disabled by default as it
|
||||||
|
// slows down the parser a lot)
|
||||||
|
// -s soft fail mode: if a test fails, don't abort but continue to
|
||||||
|
// the next one.
|
||||||
|
// * anything else is considered a relative path to the wast file to
|
||||||
|
// load and run. The path is relative to to the runner script,
|
||||||
|
// i.e. this file..
|
||||||
|
|
||||||
if (typeof assert === 'undefined') {
|
if (typeof assert === 'undefined') {
|
||||||
var assert = function(c, msg) {
|
var assert = function(c, msg) {
|
||||||
|
@ -295,7 +308,7 @@ function exec(e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var args = scriptArgs;
|
var args = typeof importedArgs !== 'undefined' ? importedArgs : scriptArgs;
|
||||||
|
|
||||||
// Whether we should keep on executing tests if one of them failed or throw.
|
// Whether we should keep on executing tests if one of them failed or throw.
|
||||||
var softFail = false;
|
var softFail = false;
|
||||||
|
@ -331,16 +344,13 @@ for (let arg of args) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targets.length)
|
|
||||||
specTests = targets;
|
|
||||||
|
|
||||||
top_loop:
|
top_loop:
|
||||||
for (var test of specTests) {
|
for (var test of targets) {
|
||||||
module = null;
|
module = null;
|
||||||
|
|
||||||
debug(`Running test ${test}...`);
|
debug(`Running test ${test}...`);
|
||||||
|
|
||||||
let source = read(scriptdir + "spec/" + test);
|
let source = read(scriptdir + test);
|
||||||
|
|
||||||
let root = new parseSExpression(source);
|
let root = new parseSExpression(source);
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
rm -rf ./*.wast ./list.js
|
rm -rf ./*.wast ./list.js ./*.wast.js
|
||||||
|
|
||||||
git clone https://github.com/WebAssembly/spec spec
|
git clone https://github.com/WebAssembly/spec spec
|
||||||
mv spec/ml-proto/test/*.wast ./
|
mv spec/ml-proto/test/*.wast ./
|
||||||
rm -rf spec/
|
rm -rf spec/
|
||||||
|
|
||||||
echo "// This is automatically generated by import_tests.sh. Do no modify by hand!" > list.js
|
|
||||||
echo "var specTests = [];" >> list.js
|
|
||||||
for i in $(ls *.wast);
|
for i in $(ls *.wast);
|
||||||
do
|
do
|
||||||
echo "specTests.push(\"$i\");" >> list.js
|
echo "var importedArgs = ['$i']; load(scriptdir + '../spec.js');" > $i.js
|
||||||
done;
|
done;
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
// This is automatically generated by import_tests.sh. Do no modify by hand!
|
|
||||||
var specTests = [];
|
|
||||||
//specTests.push("address.wast"); // TODO wrapping offsets
|
|
||||||
//specTests.push("binary.wast"); // TODO binary text format
|
|
||||||
specTests.push("block_comments.wast");
|
|
||||||
specTests.push("block.wast");
|
|
||||||
specTests.push("break-drop.wast");
|
|
||||||
//specTests.push("conversions.wast"); // TODO custom NaN
|
|
||||||
//specTests.push("endianness.wast"); // TODO i64 loads/stores
|
|
||||||
//specTests.push("exports.wast"); // TODO real memory exports
|
|
||||||
//specTests.push("f32_cmp.wast"); // TODO custom NaN
|
|
||||||
//specTests.push("f32.wast"); // TODO f32.trunc
|
|
||||||
//specTests.push("f64_cmp.wast"); // TODO custom NaN
|
|
||||||
//specTests.push("f64.wast"); // TODO f64.trunc
|
|
||||||
specTests.push("fac.wast");
|
|
||||||
//specTests.push("float_exprs.wast"); // TODO custom NaN
|
|
||||||
//specTests.push("float_literals.wast"); // TODO custom NaN
|
|
||||||
//specTests.push("float_memory.wast"); // TODO custom NaN
|
|
||||||
//specTests.push("float_misc.wast"); // TODO copysign
|
|
||||||
specTests.push("forward.wast");
|
|
||||||
//specTests.push("func_ptrs.wast"); // TODO pass table index in bad indirect error message
|
|
||||||
specTests.push("functions.wast");
|
|
||||||
specTests.push("i32.wast");
|
|
||||||
specTests.push("i64.wast");
|
|
||||||
specTests.push("imports.wast");
|
|
||||||
specTests.push("int_exprs.wast");
|
|
||||||
specTests.push("int_literals.wast");
|
|
||||||
//specTests.push("labels.wast"); // TODO br_if value/cond
|
|
||||||
//specTests.push("left-to-right.wast"); // TODO i64 loads/stores
|
|
||||||
specTests.push("memory_redundancy.wast");
|
|
||||||
//specTests.push("memory_trap.wast"); // TODO current_memory opcode
|
|
||||||
//specTests.push("memory.wast"); // TODO alignment
|
|
||||||
specTests.push("names.wast");
|
|
||||||
//specTests.push("nan-propagation.wast"); // TODO f32 trunc
|
|
||||||
//specTests.push("resizing.wast"); // TODO grow_memory opcode
|
|
||||||
specTests.push("runaway-recursion.wast");
|
|
||||||
//specTests.push("select.wast"); // TODO custom NaN
|
|
||||||
//specTests.push("start.wast"); // TODO start opcode
|
|
||||||
//specTests.push("store_retval.wast"); // TODO i64 loads/stores
|
|
||||||
specTests.push("switch.wast");
|
|
||||||
//specTests.push("traps.wast"); // TODO trap on OOB
|
|
||||||
specTests.push("unreachable.wast");
|
|
Загрузка…
Ссылка в новой задаче