-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
Copy pathWasmTestRunner.cs
62 lines (56 loc) · 1.94 KB
/
WasmTestRunner.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using Microsoft.DotNet.XHarness.TestRunners.Xunit;
public class SimpleWasmTestRunner : WasmApplicationEntryPoint
{
public static int Main(string[] args)
{
var testAssembly = args[0];
var excludedTraits = new List<string>();
var includedTraits = new List<string>();
var includedNamespaces = new List<string>();
var includedClasses = new List<string>();
var includedMethods = new List<string>();
for (int i = 1; i < args.Length; i++)
{
var option = args[i];
switch (option)
{
case "-notrait":
excludedTraits.Add (args[i + 1]);
i++;
break;
case "-trait":
includedTraits.Add (args[i + 1]);
i++;
break;
case "-namespace":
includedNamespaces.Add (args[i + 1]);
i++;
break;
case "-class":
includedClasses.Add (args[i + 1]);
i++;
break;
case "-method":
includedMethods.Add (args[i + 1]);
i++;
break;
default:
throw new ArgumentException($"Invalid argument '{option}'.");
}
}
var runner = new SimpleWasmTestRunner()
{
TestAssembly = testAssembly,
ExcludedTraits = excludedTraits,
IncludedTraits = includedTraits,
IncludedNamespaces = includedNamespaces,
IncludedClasses = includedClasses,
IncludedMethods = includedMethods
};
return runner.Run();
}
}