Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
<!--Remove once this is fixed, https://github.com/dotnet/runtime/issues/71506 -->
<IlcTrimMetadata>false</IlcTrimMetadata>

<!-- this test project is too slow with extra start of another runtime -->
<WasmXHarnessMonoArgs>$(WasmXHarnessMonoArgs) --no-memory-snapshot</WasmXHarnessMonoArgs>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetOS)' == 'browser'">
Expand All @@ -18,6 +15,8 @@
<TestArchiveTestsRoot>$(TestArchiveRoot)browserornodejs/</TestArchiveTestsRoot>
<TestArchiveTestsDir>$(TestArchiveTestsRoot)$(OSPlatformConfig)/</TestArchiveTestsDir>
<DefineConstants>$(DefineConstants);TARGET_BROWSER</DefineConstants>
<WasmXHarnessMonoArgs>--setenv=XHARNESS_LOG_TEST_START=true --no-memory-snapshot</WasmXHarnessMonoArgs>
<WasmXHarnessTestsTimeout>00:45:00</WasmXHarnessTestsTimeout>
</PropertyGroup>

<ItemGroup>
Expand Down
14 changes: 12 additions & 2 deletions src/mono/wasm/runtime/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,18 @@ export function setup_proxy_console(id: string, console: Console, origin: string
}
}

if (typeof payload === "string" && id !== "main")
payload = `[${id}] ${payload}`;
if (typeof payload === "string") {
if (payload[0] == "[") {
const now = new Date().toISOString();
if (id !== "main") {
payload = `[${id}][${now}] ${payload}`;
} else {
payload = `[${now}] ${payload}`;
}
} else if (id !== "main") {
payload = `[${id}] ${payload}`;
}
}

if (asJson) {
func(JSON.stringify({
Expand Down
7 changes: 4 additions & 3 deletions src/mono/wasm/test-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ if (is_node && process.versions.node.split(".")[0] < 14) {

if (is_node) {
// the emscripten 3.1.34 stopped handling these when MODULARIZE is enabled
process.on('uncaughtException', function(ex) {
process.on('uncaughtException', function (ex) {
// ignore UnhandledPromiseRejection exceptions with exit status
if (ex !== 'unwind' && (ex.name !== "UnhandledPromiseRejection" || !ex.message.includes('"#<ExitStatus>"'))) {
throw ex;
throw ex;
}
});
});
}

if (!is_node && !is_browser && typeof globalThis.crypto === 'undefined') {
Expand Down Expand Up @@ -387,6 +387,7 @@ async function run() {
const main_assembly_name = runArgs.applicationArguments[1];
const app_args = runArgs.applicationArguments.slice(2);
const result = await App.runtime.runMain(main_assembly_name, app_args);
console.log(`test-main.js exiting ${app_args.length > 1 ? main_assembly_name + " " + app_args[0] : main_assembly_name} with result ${result}`);
mono_exit(result);
} catch (error) {
if (error.name != "ExitStatus") {
Expand Down