From: Alexander Köplinger Date: Wed, 3 Jun 2020 14:28:31 +0000 (+0200) Subject: Run WASM tests with xharness (#37346) X-Git-Tag: submit/tizen/20210909.063632~7621 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33be17f20056cb35559ca96b442da7da723fb8ef;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Run WASM tests with xharness (#37346) Uses the xharness tool to drive the test execution rather than calling v8 directly. Also includes a fix for running the tests in JavaScriptCore which doesn't provide performance.now(). --- diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f03ff79..46328fe 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "1.0.0-prerelease.20279.2", + "version": "1.0.0-prerelease.20303.2", "commands": [ "xharness" ] diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c55978f..5b58be2 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -174,9 +174,9 @@ https://github.com/mono/linker 95d8c21c8d9bfc8cad107ff36fa44851f61bb28c - + https://github.com/dotnet/xharness - bf873c70b1f983f4c9c7280ccb0481142ef64206 + 2de89cbfa1ad6f5003ba524d520a29d690fa04e7 diff --git a/eng/Versions.props b/eng/Versions.props index 12359b0..a0de8d7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -106,7 +106,7 @@ 4.8.0 16.7.0-preview-20200529-01 - 1.0.0-prerelease.20301.2 + 1.0.0-prerelease.20303.2 2.4.1 1.3.0 2.0.5 diff --git a/eng/testing/WasmRunnerTemplate.sh b/eng/testing/WasmRunnerTemplate.sh index 8ae1e35..6e2ebd2 100644 --- a/eng/testing/WasmRunnerTemplate.sh +++ b/eng/testing/WasmRunnerTemplate.sh @@ -1,10 +1,20 @@ -set -ev +#!/usr/bin/env bash EXECUTION_DIR=$(dirname $0) echo "Test: $1" cd $EXECUTION_DIR -v8 --expose_wasm runtime.js -- --enable-gc --run WasmTestRunner.dll $* -exit 0 +XHARNESS_OUT="$EXECUTION_DIR/xharness-output" + +dotnet xharness wasm test --engine=v8 \ + --js-file=runtime.js \ + --output-directory=$XHARNESS_OUT \ + -- --enable-gc --run WasmTestRunner.dll $* + +_exitCode=$? + +echo "Xharness artifacts: $XHARNESS_OUT" + +exit $_exitCode diff --git a/src/mono/wasm/Makefile b/src/mono/wasm/Makefile index f036ae3..10ed3f9 100644 --- a/src/mono/wasm/Makefile +++ b/src/mono/wasm/Makefile @@ -120,4 +120,4 @@ app-builder: $(DOTNET) build $(TOP)/tools-local/tasks/mobile.tasks/WasmAppBuilder run-tests-%: - PATH="$(JSVU):$(PATH)" $(DOTNET) build $(TOP)/src/libraries/$*/tests/ /t:Test /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release + PATH="$(JSVU):$(PATH)" $(DOTNET) build $(TOP)/src/libraries/$*/tests/ /t:Test /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=$(CONFIG) diff --git a/src/mono/wasm/runtime-test.js b/src/mono/wasm/runtime-test.js index 10e4fa6f..93c68a5 100644 --- a/src/mono/wasm/runtime-test.js +++ b/src/mono/wasm/runtime-test.js @@ -48,6 +48,15 @@ if (typeof crypto == 'undefined') { } } +if (typeof performance == 'undefined') { + // performance.now() is used by emscripten and doesn't work in JSC + var performance = { + now: function () { + return Date.now (); + } + } +} + try { if (typeof arguments == "undefined") arguments = WScript.Arguments;