Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Use test-main.mjs for net8 runtimes . #2345

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/BenchmarkDotNet/Toolchains/MonoWasm/WasmExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ public ExecuteResult Execute(ExecuteParameters executeParameters)
private static Process CreateProcess(BenchmarkCase benchmarkCase, ArtifactsPaths artifactsPaths, string args, IResolver resolver)
{
WasmRuntime runtime = (WasmRuntime)benchmarkCase.GetRuntime();
string mainJs = runtime.RuntimeMoniker < RuntimeMoniker.WasmNet70 ? "main.js" : "test-main.js";
string mainJs = runtime.RuntimeMoniker switch
{
< RuntimeMoniker.WasmNet70 => "main.js",
RuntimeMoniker.WasmNet70 => "test-main.js",
_ => "test-main.mjs"
};

var start = new ProcessStartInfo
{
Expand Down
7 changes: 6 additions & 1 deletion src/BenchmarkDotNet/Toolchains/MonoWasm/WasmGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ public WasmGenerator(string targetFrameworkMoniker, string cliPath, string packa
{
Aot = aot;
CustomRuntimePack = customRuntimePack;
MainJS = (targetFrameworkMoniker == "net5.0" || targetFrameworkMoniker == "net6.0") ? "main.js" : "test-main.js";
MainJS = targetFrameworkMoniker switch
{
"net5.0" or "net6.0" => "main.js",
"net7.0" => "test-main.js",
_ => "test-main.mjs"
};
}

protected override void GenerateProject(BuildPartition buildPartition, ArtifactsPaths artifactsPaths, ILogger logger)
Expand Down