1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-10 01:50:53 +09:00

[browser] Remove experimental args from NodeJS WBT runner (#111655)

This commit is contained in:
Marek Fišera 2025-02-10 18:37:51 +01:00 committed by GitHub
parent b1413ce920
commit 8f76618ea2
Signed by: github
GPG key ID: B5690EEEBB952194
4 changed files with 3 additions and 31 deletions

View file

@ -16,7 +16,7 @@ public class ConfigSrcTests : TestMainJsTestBase
// NOTE: port number determinizes dynamically, so could not generate absolute URI
[Theory]
[BuildAndRun(host: RunHost.V8 | RunHost.NodeJS)]
[BuildAndRun(host: RunHost.V8)]
public void ConfigSrcAbsolutePath(BuildArgs buildArgs, RunHost host, string id)
{
buildArgs = buildArgs with { ProjectName = $"configsrcabsolute_{buildArgs.Config}_{buildArgs.AOT}" };

View file

@ -8,8 +8,8 @@ namespace Wasm.Build.Tests;
public class NodeJSHostRunner : IHostRunner
{
public string GetTestCommand() => "wasm test";
public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh";
public string GetXharnessArgsOtherOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --locale={options.environmentLocale} --engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh";
public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace";
public string GetXharnessArgsOtherOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --locale={options.environmentLocale}";
public bool UseWasmConsoleOutput() => true;
public bool CanRunWBT() => true;
}

View file

@ -66,7 +66,6 @@ namespace Wasm.Build.Tests
DotnetWasmFromRuntimePack: false));
RunAndTestWasmApp(buildArgs,
extraXHarnessArgs: host == RunHost.NodeJS ? "--engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh" : "",
expectedExitCode: 42,
test: output =>
{

View file

@ -57,38 +57,11 @@ public abstract class WasmTemplateTestBase : BuildTestBase
if (runAnalyzers)
extraProperties += "<RunAnalyzers>true</RunAnalyzers>";
if (template == "wasmconsole")
{
UpdateRuntimeconfigTemplateForNode(_projectDir);
}
AddItemsPropertiesToProject(projectfile, extraProperties);
return projectfile;
}
private static void UpdateRuntimeconfigTemplateForNode(string projectDir)
{
// TODO: Can be removed once Node >= 20
string runtimeconfigTemplatePath = Path.Combine(projectDir, "runtimeconfig.template.json");
string runtimeconfigTemplateContent = File.ReadAllText(runtimeconfigTemplatePath);
var runtimeconfigTemplate = JsonObject.Parse(runtimeconfigTemplateContent);
if (runtimeconfigTemplate == null)
throw new Exception($"Unable to parse runtimeconfigtemplate at '{runtimeconfigTemplatePath}'");
var perHostConfigs = runtimeconfigTemplate?["wasmHostProperties"]?["perHostConfig"]?.AsArray();
if (perHostConfigs == null || perHostConfigs.Count == 0 || perHostConfigs[0] == null)
throw new Exception($"Unable to find perHostConfig in runtimeconfigtemplate at '{runtimeconfigTemplatePath}'");
perHostConfigs[0]!["host-args"] = new JsonArray(
"--experimental-wasm-simd",
"--experimental-wasm-eh"
);
File.WriteAllText(runtimeconfigTemplatePath, runtimeconfigTemplate!.ToString());
}
public (string projectDir, string buildOutput) BuildTemplateProject(BuildArgs buildArgs,
string id,
BuildProjectOptions buildProjectOptions)