mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-16 00:11:28 +00:00
Implement v128 instructions (#508)
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const os = require("os");
|
||||
const v8 = require("v8");
|
||||
const glob = require("glob");
|
||||
const colorsUtil = require("../cli/util/colors");
|
||||
const optionsUtil = require("../cli/util/options");
|
||||
@ -48,6 +49,9 @@ if (args.help) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const features = process.env.ASC_FEATURES ? process.env.ASC_FEATURES.split(",") : [];
|
||||
const featuresConfig = require("./features.json");
|
||||
|
||||
var successes = 0;
|
||||
var failedTests = [];
|
||||
var failedInstantiates = new Map();
|
||||
@ -89,6 +93,40 @@ tests.forEach(filename => {
|
||||
const stderr = asc.createMemoryStream(chunk => process.stderr.write(chunk.toString().replace(/^(?!$)/mg, " ")));
|
||||
stderr.isTTY = true;
|
||||
|
||||
const configPath = path.join(basedir, basename + ".json");
|
||||
const config = fs.existsSync(configPath)
|
||||
? require(configPath)
|
||||
: {};
|
||||
|
||||
var asc_flags = [];
|
||||
var v8_flags = "";
|
||||
var v8_no_flags = "";
|
||||
var missing_features = [];
|
||||
if (config.features) {
|
||||
config.features.forEach(feature => {
|
||||
if (!features.includes(feature)) missing_features.push(feature);
|
||||
var featureConfig = featuresConfig[feature];
|
||||
if (featureConfig.asc_flags) {
|
||||
featureConfig.asc_flags.forEach(flag => {
|
||||
Array.prototype.push.apply(asc_flags, flag.split(" "));
|
||||
});
|
||||
}
|
||||
if (featureConfig.v8_flags) {
|
||||
featureConfig.v8_flags.forEach(flag => {
|
||||
if (v8_flags) v8_flags += " ";
|
||||
v8_flags += flag;
|
||||
if (v8_no_flags) v8_no_flags += " ";
|
||||
v8_no_flags += "--no-" + flag.substring(2);
|
||||
});
|
||||
v8.setFlagsFromString(v8_flags);
|
||||
}
|
||||
});
|
||||
if (missing_features.length) {
|
||||
console.log("- " + colorsUtil.yellow("feature SKIPPED") + " (" + missing_features.join(", ") + ")\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var failed = false;
|
||||
|
||||
// TODO: also save stdout/stderr and diff it (-> expected failures)
|
||||
@ -102,6 +140,8 @@ tests.forEach(filename => {
|
||||
"--debug",
|
||||
"--textFile" // -> stdout
|
||||
];
|
||||
if (asc_flags)
|
||||
Array.prototype.push.apply(cmd, asc_flags);
|
||||
if (args.createBinary)
|
||||
cmd.push("--binaryFile", basename + ".untouched.wasm");
|
||||
asc.main(cmd, {
|
||||
@ -167,6 +207,8 @@ tests.forEach(filename => {
|
||||
"--binaryFile", // -> stdout
|
||||
"-O3"
|
||||
];
|
||||
if (asc_flags)
|
||||
Array.prototype.push.apply(cmd, asc_flags);
|
||||
if (args.create)
|
||||
cmd.push("--textFile", basename + ".optimized.wat");
|
||||
asc.main(cmd, {
|
||||
@ -261,6 +303,7 @@ tests.forEach(filename => {
|
||||
console.log();
|
||||
});
|
||||
});
|
||||
if (v8_no_flags) v8.setFlagsFromString(v8_no_flags);
|
||||
});
|
||||
|
||||
if (failedTests.length) {
|
||||
|
Reference in New Issue
Block a user