Bump to updated WebAssembly runner from xharness (#37178)
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Sat, 30 May 2020 08:02:50 +0000 (10:02 +0200)
committerGitHub <noreply@github.com>
Sat, 30 May 2020 08:02:50 +0000 (10:02 +0200)
.config/dotnet-tools.json
eng/Version.Details.xml
eng/Versions.props
eng/testing/WasmRunnerTemplate.sh
eng/testing/tests.targets
src/libraries/Common/tests/AndroidTestRunner/AndroidTestRunner.cs
src/libraries/Common/tests/AndroidTestRunner/AndroidTestRunner.csproj
src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs
src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.csproj
src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.cs
src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.csproj

index 51d9b24..1654c6c 100644 (file)
@@ -15,7 +15,7 @@
       ]
     },
     "microsoft.dotnet.xharness.cli": {
-      "version": "1.0.0-prerelease.20271.3",
+      "version": "1.0.0-prerelease.20279.2",
       "commands": [
         "xharness"
       ]
index a4ea9bf..5ec27d0 100644 (file)
       <Uri>https://github.com/mono/linker</Uri>
       <Sha>d51be363c75855fb19d7c30c2600cd627d7e359d</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.XHarness.Tests.Runners" Version="1.0.0-prerelease.20277.1">
+    <Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.20279.2">
       <Uri>https://github.com/dotnet/xharness</Uri>
-      <Sha>8f6cc04f53cb6759758ffc97c9c8ca3ab4802f7f</Sha>
+      <Sha>94251a8d989891191b5dd915eec82de36d8404a1</Sha>
     </Dependency>
   </ToolsetDependencies>
 </Dependencies>
index b4838ec..750a30f 100644 (file)
     <SystemDataSqlClientVersion>4.8.0</SystemDataSqlClientVersion>
     <!-- Testing -->
     <MicrosoftNETTestSdkVersion>16.7.0-preview-20200521-01</MicrosoftNETTestSdkVersion>
-    <MicrosoftDotNetXHarnessTestsRunnersVersion>1.0.0-prerelease.20277.1</MicrosoftDotNetXHarnessTestsRunnersVersion>
+    <MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.20279.2</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
     <XUnitVersion>2.4.1</XUnitVersion>
     <CoverletCollectorVersion>1.2.1</CoverletCollectorVersion>
     <TraceEventVersion>2.0.5</TraceEventVersion>
index 611a28e..8ae1e35 100644 (file)
@@ -1,12 +1,10 @@
 set -ev
 
 EXECUTION_DIR=$(dirname $0)
-TEST_NAME=$1
-TARGET_ARCH=$2
 
-echo "Test: $1 Arch: $2"
+echo "Test: $1"
 
 cd $EXECUTION_DIR
-v8 --expose_wasm runtime.js -- --enable-gc --run WasmTestRunner.dll $TEST_NAME.dll
+v8 --expose_wasm runtime.js -- --enable-gc --run WasmTestRunner.dll $*
 
 exit 0
index c84fec8..6d1655b 100644 (file)
@@ -83,6 +83,7 @@
       <RunTestsCommand>"$(RunScriptOutputPath)" --runtime-path "$(TestHostRootPath.TrimEnd('\/'))"</RunTestsCommand>
       <RunTestsCommand Condition="'$(TestRspFile)' != '' and '$(RuntimeFlavor)' != 'Mono'">$(RunTestsCommand) --rsp-file "$(TestRspFile)"</RunTestsCommand>
       <RunTestsCommand Condition="'$(TargetsMobile)' == 'true'">"$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture)</RunTestsCommand>
+      <RunTestsCommand Condition="'$(TargetOS)' == 'Browser'">"$(RunScriptOutputPath)" $(AssemblyName).dll $(_withoutCategories.Replace(';', ' -notrait category='))</RunTestsCommand>
     </PropertyGroup>
 
     <!-- Invoke the run script with the test host as the runtime path. -->
index 9f232f5..1360ad0 100644 (file)
@@ -12,8 +12,8 @@ using System.Threading;
 using System.Threading.Tasks;
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;
-using Microsoft.DotNet.XHarness.Tests.Runners;
-using Microsoft.DotNet.XHarness.Tests.Runners.Core;
+using Microsoft.DotNet.XHarness.TestRunners.Common;
+using Microsoft.DotNet.XHarness.TestRunners.Xunit;
 
 public class SimpleAndroidTestRunner : AndroidApplicationEntryPoint, IDevice
 {
@@ -72,8 +72,6 @@ public class SimpleAndroidTestRunner : AndroidApplicationEntryPoint, IDevice
 
     protected override IDevice Device => this;
 
-    protected override TestRunnerType TestRunner => TestRunnerType.Xunit;
-
     protected override string? IgnoreFilesDirectory => null;
 
     protected override string IgnoredTraitsFilePath => "xunit-excludes.txt";
index 6f73d8e..d035012 100644 (file)
@@ -6,6 +6,6 @@
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="AndroidTestRunner.cs" />
-    <PackageReference Include="Microsoft.DotNet.XHarness.Tests.Runners" Version="$(MicrosoftDotNetXHarnessTestsRunnersVersion)" />
+    <PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="$(MicrosoftDotNetXHarnessTestRunnersXunitVersion)" />
   </ItemGroup>
 </Project>
index 22979b7..9fbfbf4 100644 (file)
@@ -12,8 +12,8 @@ using System.Threading;
 using System.Threading.Tasks;
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;
-using Microsoft.DotNet.XHarness.Tests.Runners;
-using Microsoft.DotNet.XHarness.Tests.Runners.Core;
+using Microsoft.DotNet.XHarness.TestRunners.Common;
+using Microsoft.DotNet.XHarness.TestRunners.Xunit;
 
 public class SimpleTestRunner : iOSApplicationEntryPoint, IDevice
 {
@@ -128,8 +128,6 @@ public class SimpleTestRunner : iOSApplicationEntryPoint, IDevice
 
     protected override IDevice Device => this;
 
-    protected override TestRunnerType TestRunner => TestRunnerType.Xunit;
-
     protected override string? IgnoreFilesDirectory => null;
 
     protected override string IgnoredTraitsFilePath => "xunit-excludes.txt";
index 906eea3..74636ca 100644 (file)
@@ -6,6 +6,6 @@
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="AppleTestRunner.cs" />
-    <PackageReference Include="Microsoft.DotNet.XHarness.Tests.Runners" Version="$(MicrosoftDotNetXHarnessTestsRunnersVersion)" />
+    <PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="$(MicrosoftDotNetXHarnessTestRunnersXunitVersion)" />
   </ItemGroup>
 </Project>
index 0ee5116..46c3c8b 100644 (file)
@@ -3,27 +3,40 @@
 // See the LICENSE file in the project root for more information.
 
 using System;
-using System.Linq;
-using System.Text;
-using System.IO;
 using System.Collections.Generic;
-using System.Reflection;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Runtime.InteropServices;
-using System.Runtime.CompilerServices;
 
-public class WasmTestRunner
+using Microsoft.DotNet.XHarness.TestRunners.Xunit;
+
+public class SimpleWasmTestRunner : WasmApplicationEntryPoint
 {
+    protected override string TestAssembly { get; set; } = "";
+    protected override IEnumerable<string> ExcludedTraits { get; set; } = new List<string>();
+
     public static int Main(string[] args)
     {
-        Console.Write("Args: ");
-        foreach (string arg in args)
+        var testAssembly = args[0];
+        var excludedTraits = new List<string>();
+
+        for (int i = 1; i < args.Length; i++)
         {
-            Console.Write(arg);
+            var option = args[i];
+            switch (option)
+            {
+                case "-notrait":
+                    excludedTraits.Add (args[i + 1]);
+                    i++;
+                    break;
+                default:
+                    throw new ArgumentException($"Invalid argument '{option}'.");
+            }
         }
-        Console.WriteLine(".");
 
-        return 0;
+        var runner = new SimpleWasmTestRunner()
+        {
+            TestAssembly = testAssembly,
+            ExcludedTraits = excludedTraits
+        };
+
+        return runner.Run();
     }
 }
index 7d68c49..df27382 100644 (file)
@@ -6,6 +6,6 @@
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="WasmTestRunner.cs" />
-    <PackageReference Include="Microsoft.DotNet.XHarness.Tests.Runners" Version="$(MicrosoftDotNetXHarnessTestsRunnersVersion)" />
+    <PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="$(MicrosoftDotNetXHarnessTestRunnersXunitVersion)" />
   </ItemGroup>
 </Project>