For more advanced scenarios, look for at [Building Test Subsets](../../testing/coreclr/windows-test-instructions.md#building-test-subsets) and [Generating Core_Root](../../testing/coreclr/windows-test-instructions.md#generating-core_root)
### Running library tests
-Build library tests by passing the `libs.tests` subset together with the `/p:TestNativeAot=true` to build the libraries, i.e. `clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs+libs.tests /p:TestNativeAot=true` together with the full arguments as specified [above](#building). Then, to run a specific library, go to the tests directory of the library and run the usual command to run tests for the library (see [Running tests for a single library](../../testing/libraries/testing.md#running-tests-for-a-single-library)) but add the `/p:TestNativeAot=true`, i.e. `dotnet.cmd build /t:Test /p:TestNativeAot=true`.
+Build library tests by passing the `libs.tests` subset together with the `/p:TestNativeAot=true` to build the libraries, i.e. `clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs+libs.tests /p:TestNativeAot=true` together with the full arguments as specified [above](#building). Then, to run a specific library, go to the tests directory of the library and run the usual command to run tests for the library (see [Running tests for a single library](../../testing/libraries/testing.md#running-tests-for-a-single-library)) but add the `/p:TestNativeAot=true` and the build configuration that was used, i.e. `dotnet.cmd build /t:Test /p:TestNativeAot=true -c Release`.
## Design Documentation
throw new ArgumentNullException(nameof(member));
// Need to walk up the inheritance chain if member is not found
- // Leverage the existing cache mechanism of per type to store members
+ // Leverage the existing cache mechanism on per type to store members
RuntimeTypeInfo? runtimeType = this;
while (runtimeType != null)
{
var discoverer = xunitTestFx.CreateDiscoverer(asmInfo);
discoverer.Find(false, discoverySink, TestFrameworkOptions.ForDiscovery());
discoverySink.Finished.WaitOne();
+
XunitFilters filters = new XunitFilters();
- filters.ExcludedTraits.Add("category", new List<string> { "failing" });
+ // Quick hack wo much validation to get no traits passed
+ Dictionary<string, List<string>> noTraits = new Dictionary<string, List<string>>();
+ for (int i = 0; i < args.Length; i++)
+ {
+ if (args[i].Equals("-notrait", StringComparison.OrdinalIgnoreCase))
+ {
+ var traitKeyValue=args[i + 1].Split("=", StringSplitOptions.TrimEntries);
+ if (!noTraits.TryGetValue(traitKeyValue[0], out List<string> values))
+ {
+ noTraits.Add(traitKeyValue[0], values = new List<string>());
+ }
+ values.Add(traitKeyValue[1]);
+ }
+ }
+
+ foreach (KeyValuePair<string, List<string>> kvp in noTraits)
+ {
+ filters.ExcludedTraits.Add(kvp.Key, kvp.Value);
+ }
+
var filteredTestCases = discoverySink.TestCases.Where(filters.Filter).ToList();
var executor = xunitTestFx.CreateExecutor(asmName);
executor.RunTests(filteredTestCases, resultsSink, TestFrameworkOptions.ForExecution());
<!-- Run only a small randomly chosen set of passing test suites -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)*\tests\**\*.Tests.csproj" />
<ProjectExclusions Remove="$(MSBuildThisFileDirectory)System.Collections\tests\System.Collections.Tests.csproj" />
+ <ProjectExclusions Remove="$(MSBuildThisFileDirectory)System.Reflection\tests\System.Reflection.Tests.csproj"
+ Condition="'$(TargetOS)' == 'windows'" />
<ProjectExclusions Remove="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests.csproj" />
</ItemGroup>