Skip to content
Closed
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
3e5900d
Switch to xunit3 for single file
agocke Jan 16, 2026
ad4e927
Switch to xunit3 unconditionally
agocke Jan 17, 2026
f14edd1
WIP
agocke Jan 18, 2026
104ba64
Move CBOR tests to xunit3
agocke Jan 18, 2026
27e260a
Simple name cluanup of Abstractions ns and RootNamespace chanfes
agocke Jan 18, 2026
d86dfb5
WIP
agocke Jan 19, 2026
fb4696a
WIP
agocke Jan 20, 2026
ae4b874
WIP
agocke Jan 21, 2026
e9d947f
WIP
agocke Jan 21, 2026
c09fc04
WIP
agocke Feb 25, 2026
2506b40
Merge remote-tracking branch 'upstream/main' into xunit3
agocke Feb 25, 2026
2449ec2
Backflow from https://github.com/dotnet/dotnet / 29e2749 build 303682
dotnet-maestro[bot] Feb 28, 2026
a7f4dc6
Update dependencies from build 303682
dotnet-maestro[bot] Feb 28, 2026
fd9dc89
Merge remote-tracking branch 'upstream/darc-main-d4f68257-b103-4c5b-8…
agocke Feb 28, 2026
2db602c
Merge remote-tracking branch 'upstream/main' into xunit3
agocke Feb 28, 2026
d7163d7
Merge remote-tracking branch 'upstream/main' into xunit3
agocke Feb 28, 2026
c8fb448
Fix some more uses of the ConditionalTheory nameof overload
agocke Feb 28, 2026
578e86d
Run xunit v3 tests as executables instead of via dotnet exec
agocke Feb 28, 2026
d047202
Replace SkipTestException with Xunit.Sdk.SkipException
agocke Feb 28, 2026
6947ca8
Convert simple if/throw SkipException patterns to Assert.SkipWhen/Ski…
agocke Feb 28, 2026
c27315b
WIP
agocke Mar 1, 2026
ef1f6bb
Fixup more tests, and skip some System.Diagnostics tests that have di…
agocke Mar 1, 2026
e5a5759
Fix libraries xunit3 tests failing on Helix with Permission Denied
agocke Mar 1, 2026
cef6950
Merge remote-tracking branch 'upstream/main' into xunit3
agocke Mar 1, 2026
46430e5
Fix xunit3 empty MemberData failures in crypto tests
agocke Mar 1, 2026
c838430
Fix xunit3 empty MemberData failures in crypto tests
agocke Mar 1, 2026
c58a133
Fix PerCompilationTypeAttribute for xunit v3 compatibility
agocke Mar 2, 2026
6203711
Remove obsolete build-break throws from IsolatedStorage test MemberDa…
agocke Mar 2, 2026
4fd1f09
Fix xunit3 empty MemberData in FileSystem UNC path tests
agocke Mar 2, 2026
14daea8
Fix xunit3 empty MemberData failures in VB, Immutable, and IsolatedSt…
agocke Mar 2, 2026
82dc328
Fix xunit3 test failures in Debug, Reflection, and Globalization tests
agocke Mar 2, 2026
f43ecdc
Skip DispatchProxy tests failing under xunit3 with ActiveIssue
agocke Mar 2, 2026
f658a30
Skip DCS_CollectionTypeInCollectibleALC under xunit3
agocke Mar 2, 2026
772732a
Skip SatelliteLoadsCorrectly_FromName under xunit3
agocke Mar 2, 2026
b85c0d6
Merge remote-tracking branch 'upstream/main' into xunit3
agocke Mar 2, 2026
6f3b46e
Fix merge conflict
agocke Mar 2, 2026
d17b5a5
Fix xunit3 test failures: SqlXmlTest paths, TinyAssembly resolution, …
agocke Mar 2, 2026
a6651df
Fix xunit3 empty MemberData in RegexExperiment test
agocke Mar 5, 2026
b90e02a
Merge remote-tracking branch 'upstream/main' into xunit3
agocke Mar 5, 2026
cb57605
Fix Tensor build errors
agocke Mar 5, 2026
fdb536b
More obsolete
agocke Mar 5, 2026
edae283
Fix up obsoletions
agocke Mar 6, 2026
8d1b4ee
Merge remote-tracking branch 'upstream/main' into xunit3
agocke Mar 6, 2026
cafda2d
Merge remote-tracking branch 'upstream/main' into xunit3
agocke Mar 9, 2026
d6ee800
Fix xunit v3 obsolete API usages (ForMismatchedValues, ConditionalFact)
agocke Mar 9, 2026
73b6324
Fix xunit v3 migration: ConditionalTheory and Debug test failures
agocke Mar 10, 2026
82d3253
Fix xunit v3: SignatureTypes MemberData + migration docs
agocke Mar 10, 2026
398ebc0
Fix three test failures exposed by xunit v3 migration
agocke Mar 10, 2026
748749c
Fix Wasm.Build.Tests xunit v3 migration
agocke Mar 10, 2026
e484bf5
Fix xunit v3 migration build errors
agocke Mar 11, 2026
c462353
Fix NETSDK1084 on android, ILVerification.Tests xunit v3, remove stal…
agocke Mar 11, 2026
8eab22a
Fix xunit v3 namespace conflicts in 5 more test projects
agocke Mar 11, 2026
94499f8
Fix xunit v3 UseAppHost, validation, and CLI argument issues
agocke Mar 11, 2026
3c7732f
Fix WASM/mobile/NativeAOT xunit v3 build issues
agocke Mar 11, 2026
f59c85d
Fix UseAppHost for mobile/WASM/NativeAOT and ILLink descriptor
agocke Mar 11, 2026
790abcb
Fix NETSDK1067 for WASM/mobile SelfContained and NETSDK1150 for Nativ…
agocke Mar 11, 2026
6f0b123
Fix NET481 test runner, NativeAOT rd.xml, ThreadPool namespace, NETSD…
agocke Mar 11, 2026
543b9eb
Use Microsoft.DotNet.XUnitAssert for .NETCoreApp targets
agocke Mar 20, 2026
6c1aae0
Merge upstream/main into xunit3
agocke Mar 20, 2026
74ba9e0
Merge upstream/main into xunit3
agocke Mar 20, 2026
4f00ef5
Fix CI build failures from upstream merge
agocke Mar 21, 2026
b81c8ab
Merge upstream/main into xunit3
agocke Mar 22, 2026
b9a346d
Merge remote-tracking branch 'upstream/main' into xunit3
agocke Mar 23, 2026
5065c8a
Fix xunit v3 test execution and assert assembly resolution
agocke Mar 24, 2026
805fc33
Fix CI failures: ILLink descriptors, -notrait→-trait- syntax, install…
agocke Mar 24, 2026
a0da926
Fix NativeAOT test execution: custom entry point for xunit v3
agocke Mar 24, 2026
6a6a818
Refactor: update SingleFileTestRunner for xunit v3 instead of separat…
agocke Mar 24, 2026
ab5dd0b
Fix SingleFileTestRunner: set DefaultRunnerReporter on XunitProject
agocke Mar 24, 2026
3956ada
Fix NativeAOT Assembly.Location to return process path
agocke Mar 24, 2026
42b5f88
Merge branch 'main' into xunit3
agocke Mar 24, 2026
4d766ac
Merge remote-tracking branch 'upstream/main' into xunit3
agocke Mar 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
one as a template. The following line is a marker to insert the test restore sources.
-->
<!-- TEST_RESTORE_SOURCES_INSERTION_LINE -->
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
Expand Down
39 changes: 39 additions & 0 deletions docs/workflow/testing/libraries/filtering-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,45 @@ A common usage in the libraries tests is the following:

This is put on test classes to indicate that none of the tests in that class (which as usual run serially with respect to each other) may run concurrently with tests in another class. This is used for tests that use a lot of disk space or memory, or dominate all the cores, such that they are likely to disrupt any tests that run concurrently.

## Empty `[MemberData]` in xunit v3

In xunit v3, a `[Theory]` whose `[MemberData]` source returns **zero rows** is a hard failure ("No data found"), not a silent no-op. When running through the test harness this surfaces as:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should've been true in v2 as well, and I'm surprised it became a no-op. We even added a feature to say "if this theory has no data, skip it rather than fail it": https://github.com/xunit/xunit/blob/63aad206c62c2db373a9420486aa8ebc1a3daad9/src/xunit.v3.core/TheoryAttribute.cs#L31

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't know why this happened to work, but it seemed to pre-v3.


```
[FATAL ERROR] System.InvalidOperationException
Cannot find test case metadata for ID <sha256-hash>
Copy link
Copy Markdown

@bradwilson bradwilson Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mismatched test case IDs might imply trying to pre-enumerate unstable data, which is a problem for both VSTest and MTP: https://xunit.net/docs/theory-data-stability-in-vs

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also seems to be associated with theories returning no data.

```

This commonly happens when a `[MemberData]` source filters its output based on platform support (e.g., `Where(x => SomeAlgorithm.IsSupported)`) and all items are filtered out on the current platform.

**To diagnose**, run the test assembly directly with `-list full` to map the failing IDs to test method names, then inspect the `[MemberData]` source for conditional logic that can produce an empty enumerable.

**To fix**, switch to an unconditional data source and move the platform check into the test body:

```cs
// BROKEN: MemberData can return zero rows
public static IEnumerable<object[]> SupportedAlgorithmsTestData =>
AllAlgorithms.Where(a => MyAlgorithm.IsSupported(a)).Select(a => new object[] { a });

[Theory]
[MemberData(nameof(SupportedAlgorithmsTestData))]
public void MyTest(MyAlgorithm algorithm) { /* ... */ }
```

```cs
// FIXED: MemberData always returns rows; skip at runtime
public static IEnumerable<object[]> AllAlgorithmsTestData =>
AllAlgorithms.Select(a => new object[] { a });

[Theory]
[MemberData(nameof(AllAlgorithmsTestData))]
public void MyTest(MyAlgorithm algorithm)
{
Assert.SkipUnless(MyAlgorithm.IsSupported(algorithm), "Not supported on this platform.");
/* ... */
}
```

## FactAttribute and `Skip`

Another way to disable the test entirely is to use the `Skip` named argument that is used on the `FactAttribute`.
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<MoqVersion>4.18.4</MoqVersion>
<MicrosoftDiagnosticsRuntimeVersion>3.1.512801</MicrosoftDiagnosticsRuntimeVersion>
<AwesomeAssertionsVersion>8.0.2</AwesomeAssertionsVersion>
<FsCheckVersion>2.14.3</FsCheckVersion>
<FsCheckVersion>3.3.2</FsCheckVersion>
<CommandLineParserVersion>2.9.1</CommandLineParserVersion>
<CompilerPlatformTestingVersion>1.1.3-beta1.24423.1</CompilerPlatformTestingVersion>
<CompilerPlatformTestingDiffPlexVersion>1.7.2</CompilerPlatformTestingDiffPlexVersion>
Expand Down
2 changes: 2 additions & 0 deletions eng/testing/RunnerTemplate.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ set EXECUTION_DIR=%~dp0
:: Assume failure
set HAS_TEST_RESULTS=0

set DOTNET_ROOT=%RUNTIME_PATH%

:: Support for SuperPMI collection
REM SuperPMI collection
if not defined spmi_enable_collection goto :skip_spmi_enable_collection
Expand Down
2 changes: 2 additions & 0 deletions eng/testing/RunnerTemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ if [[ -z "$RUNTIME_PATH" ]]; then
exit -1
fi

export DOTNET_ROOT="$RUNTIME_PATH"

exitcode_list[0]="Exited Successfully"
exitcode_list[130]="SIGINT Ctrl-C occurred. Likely tests timed out."
exitcode_list[131]="SIGQUIT Ctrl-\ occurred. Core dumped."
Expand Down
4 changes: 2 additions & 2 deletions eng/testing/tests.singlefile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(CommonTestPath)SingleFileTestRunner\SingleFileTestRunner.cs"
<!-- <Compile Include="$(CommonTestPath)SingleFileTestRunner\SingleFileTestRunner.cs"
Link="Common\SingleFileTestRunner\SingleFileTestRunner.cs"
Condition="'$(CLRTestKind)' == '' and '$(IsFunctionalTest)' != 'true'" />
Condition="'$(CLRTestKind)' == '' and '$(IsFunctionalTest)' != 'true'" /> -->
</ItemGroup>

<ItemGroup>
Expand Down
31 changes: 19 additions & 12 deletions eng/testing/xunit/xunit.console.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,33 @@
<SetScriptCommands Include="$(EnvVarCommand) XUNIT_HIDE_PASSING_OUTPUT_DIAGNOSTICS=1" />
</ItemGroup>

<!-- xunit v3: The test executable needs execute permission on Unix after ZIP extraction on Helix. -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
'$(RunScriptWindowsCmd)' != 'true' and
'$(TargetsMobile)' != 'true' and
'$(TestSingleFile)' != 'true'">
<SetScriptCommands Include="chmod +x $EXECUTION_DIR/$(AssemblyName)" />
</ItemGroup>

<PropertyGroup Condition="'$(BundleXunitRunner)' == 'true'">
<XunitConsolePath Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">xunit.console.dll</XunitConsolePath>
<XunitConsolePath Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">xunit.console.exe</XunitConsolePath>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetsMobile)' != 'true' and '$(TestSingleFile)' != 'true'">
<_depsFileArgument Condition="'$(GenerateDependencyFile)' == 'true'">--depsfile $(AssemblyName).deps.json</_depsFileArgument>
<RunScriptCommand Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">"$(RunScriptHost)" exec --runtimeconfig $(AssemblyName).runtimeconfig.json $(_depsFileArgument) $(XunitConsolePath)</RunScriptCommand>
<!-- xunit v3: .NETCoreApp test projects produce executables with an embedded in-process runner. -->
<RunScriptCommand Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(RunScriptWindowsCmd)' != 'true'">./$(AssemblyName)</RunScriptCommand>
<RunScriptCommand Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(RunScriptWindowsCmd)' == 'true'">$(AssemblyName).exe</RunScriptCommand>
<RunScriptCommand Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">$(XunitConsolePath)</RunScriptCommand>

<RunScriptCommand>$(RunScriptCommand) $(TargetFileName)</RunScriptCommand>
<!-- .NETFramework still uses the external xunit console runner and needs the test DLL as an argument. -->
<RunScriptCommand Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">$(RunScriptCommand) $(TargetFileName)</RunScriptCommand>
<RunScriptCommand>$(RunScriptCommand) -xml $(TestResultsName)</RunScriptCommand>
<RunScriptCommand>$(RunScriptCommand) -nologo</RunScriptCommand>
<RunScriptCommand Condition="'$(ArchiveTests)' == 'true'">$(RunScriptCommand) -nocolor</RunScriptCommand>
<RunScriptCommand>$(RunScriptCommand) -noLogo</RunScriptCommand>
<RunScriptCommand Condition="'$(ArchiveTests)' == 'true'">$(RunScriptCommand) -noColor</RunScriptCommand>
<RunScriptCommand Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(TestDisableAppDomain)' == 'true'">$(RunScriptCommand) -noappdomain</RunScriptCommand>
<RunScriptCommand Condition="'$(TestDisableParallelization)' == 'true'">$(RunScriptCommand) -maxthreads 1</RunScriptCommand>
<RunScriptCommand Condition="'$(XUnitShowProgress)' == 'true'">$(RunScriptCommand) -verbose</RunScriptCommand>
<RunScriptCommand Condition="'$(TestDisableParallelization)' == 'true'">$(RunScriptCommand) -maxThreads 1</RunScriptCommand>
<RunScriptCommand Condition="'$(XUnitShowProgress)' == 'true'">$(RunScriptCommand) -reporter verbose</RunScriptCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(UseXunitExcludesTxtFile)' != 'true'">
Expand All @@ -42,7 +52,7 @@

<!-- Add to run argument string -->
<RunScriptCommand>$(RunScriptCommand)$(_withCategories.Replace(';', ' -trait category='))</RunScriptCommand>
<RunScriptCommand>$(RunScriptCommand)$(_withoutCategories.Replace(';', ' -notrait category='))</RunScriptCommand>
<RunScriptCommand>$(RunScriptCommand)$(_withoutCategories.Replace(';', ' -trait- category='))</RunScriptCommand>

<!-- User passed in options. -->
<RunScriptCommand Condition="'$(XUnitOptions)' != ''">$(RunScriptCommand) $(XUnitOptions)</RunScriptCommand>
Expand All @@ -58,9 +68,6 @@
</PropertyGroup>

<ItemGroup Condition="'$(TestSingleFile)' != 'true'">
<PackageReference Include="Microsoft.DotNet.XUnitConsoleRunner"
Version="$(MicrosoftDotNetXUnitConsoleRunnerVersion)"
Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<PackageReference Include="xunit.runner.console"
Version="$(XUnitVersion)"
GeneratePathProperty="true"
Expand All @@ -83,7 +90,7 @@
</Target>

<!-- ResolveAssemblyReferences is the target that populates ReferenceCopyLocalPaths which is what is copied to output directory. -->
<Target Name="CopyRunnerToOutputDirectory" BeforeTargets="ResolveAssemblyReferences" Condition="'$(BundleXunitRunner)' == 'true'">
<Target Name="CopyRunnerToOutputDirectory" BeforeTargets="ResolveAssemblyReferences" Condition="'$(BundleXunitRunner)' == 'true' and '$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<ItemGroup>
<None Include="$([System.IO.Path]::GetDirectoryName('$(XunitConsole472Path)'))\*"
Exclude="$([System.IO.Path]::GetDirectoryName('$(XunitConsole472Path)'))\xunit.console.*exe.config;
Expand Down
9 changes: 4 additions & 5 deletions eng/testing/xunit/xunit.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
<!-- Microsoft.Net.Test.Sdk brings a lot of satellite assemblies in. -->
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<TestRunnerConfigPath>$(MSBuildThisFileDirectory)xunit.runner.json</TestRunnerConfigPath>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<!-- Excluding xunit.core/build as it enables deps file generation. -->
<PackageReference Include="xunit.core" Version="$(XUnitVersion)" IsImplicitlyDefined="true" PrivateAssets="all" Publish="true" ExcludeAssets="build" />
<PackageReference Include="xunit.analyzers" Version="$(XUnitAnalyzersVersion)" IsImplicitlyDefined="true" PrivateAssets="all" Publish="true" />
<PackageReference Include="xunit.v3.core" Version="$(XUnitV3Version)" IsImplicitlyDefined="true" PrivateAssets="all" Publish="true" ExcludeAssets="build" />

<PackageReference Include="xunit.assert" Version="$(XUnitVersion)" IsImplicitlyDefined="true" PrivateAssets="all" Publish="true" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
<PackageReference Include="Microsoft.DotNet.XUnitAssert" Version="$(MicrosoftDotNetXUnitAssertVersion)" IsImplicitlyDefined="true" PrivateAssets="all" Publish="true" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<PackageReference Include="xunit.v3.assert" Version="$(XUnitV3Version)" IsImplicitlyDefined="true" PrivateAssets="all" Publish="true" />

<PackageReference Include="Microsoft.DotNet.XUnitExtensions" Version="$(MicrosoftDotNetXUnitExtensionsVersion)" />
<PackageReference Include="Microsoft.DotNet.XUnitV3Extensions" Version="$(MicrosoftDotNetXUnitExtensionsVersion)" />
<PackageReference Include="Microsoft.DotNet.RemoteExecutor" Version="$(MicrosoftDotNetRemoteExecutorVersion)" Condition="'$(IncludeRemoteExecutor)' == 'true'" />

<!--
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/tools/ILVerification.Tests/TestDataLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
using Internal.TypeSystem.Ecma;
using System.Text.Json;
using Xunit;
using Xunit.Abstractions;

namespace ILVerification.Tests
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<TestRunnerAdditionalArguments>-notrait category=failing</TestRunnerAdditionalArguments>
<!-- xunit.runner.visualstudio is restored for .NET Framework instead of Core-->
<NoWarn>$(NoWarn);NU1701</NoWarn>
<!-- By default the subdirectories containing CoreTestAssembly and ILTestAssembly would be
<!-- By default the subdirectories containing CoreTestAssembly and ILTestAssembly would be
included in compilation of this project -->
<EnableDefaultItems>false</EnableDefaultItems>
<Platforms>AnyCPU;x64</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<!-- Avoids having to include InteropStateManager.cs to get files in Common/TypeSystem/Interop/IL building -->
<DefineConstants>READYTORUN;$(DefineConstants)</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@
using Internal.TypeSystem.Ecma;

using Xunit;
using Xunit.Abstractions;

namespace TypeSystemTests
{
public class SignatureTests
{
private readonly ITestOutputHelper _output;

Check failure on line 19 in src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SignatureTests.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked CLR_Tools_Tests)

src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SignatureTests.cs#L19

src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SignatureTests.cs(19,26): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'ITestOutputHelper' could not be found (are you missing a using directive or an assembly reference?)
private TestTypeSystemContext _context;
private ModuleDesc _testModule;

public SignatureTests(ITestOutputHelper output)

Check failure on line 23 in src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SignatureTests.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked CLR_Tools_Tests)

src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SignatureTests.cs#L23

src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SignatureTests.cs(23,31): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'ITestOutputHelper' could not be found (are you missing a using directive or an assembly reference?)
{
_output = output;
_context = new TestTypeSystemContext(TargetArchitecture.X64);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
using Internal.TypeSystem.Ecma;

using Xunit;
using Xunit.Abstractions;

namespace TypeSystemTests
{
public class Entrypoint
{
class Logger : ITestOutputHelper

Check failure on line 15 in src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TypeEquivalenceTests.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked CLR_Tools_Tests)

src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TypeEquivalenceTests.cs#L15

src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TypeEquivalenceTests.cs(15,24): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'ITestOutputHelper' could not be found (are you missing a using directive or an assembly reference?)
{
void ITestOutputHelper.WriteLine(string message) => Console.WriteLine(message);
void ITestOutputHelper.WriteLine(string format, params object[] args) => Console.WriteLine(format, args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
using Internal.TypeSystem;
using Internal.TypeSystem.Ecma;
using Xunit;
using Xunit.Abstractions;


namespace TypeSystemTests
{
public class VirtualFunctionOverrideTests
Expand All @@ -22,9 +19,9 @@
private ModuleDesc _testModule;
private DefType _stringType;
private DefType _voidType;
private ITestOutputHelper _logger;

Check failure on line 22 in src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/VirtualFunctionOverrideTests.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked CLR_Tools_Tests)

src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/VirtualFunctionOverrideTests.cs#L22

src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/VirtualFunctionOverrideTests.cs(22,17): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'ITestOutputHelper' could not be found (are you missing a using directive or an assembly reference?)

public VirtualFunctionOverrideTests(ITestOutputHelper logger)

Check failure on line 24 in src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/VirtualFunctionOverrideTests.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked CLR_Tools_Tests)

src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/VirtualFunctionOverrideTests.cs#L24

src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/VirtualFunctionOverrideTests.cs(24,45): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'ITestOutputHelper' could not be found (are you missing a using directive or an assembly reference?)
{
_logger = logger;
_context = new TestTypeSystemContext(TargetArchitecture.X64);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using System.Threading.Tasks;
using System.Xml.Linq;
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;

// @TODO medium-to-longer term, we should try to get rid of the special-unicorn-single-file runner in favor of making the real runner work for single file.
Expand Down
20 changes: 14 additions & 6 deletions src/libraries/Common/tests/StaticTestGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;

namespace StaticTestGenerator
Expand Down Expand Up @@ -1029,8 +1028,6 @@ private sealed class TestCase
@"using System;
using System.Threading.Tasks;
using Microsoft.DotNet.XUnitExtensions;
using Xunit.Abstractions;

public static class Test
{
private static bool s_verbose;
Expand Down Expand Up @@ -1078,7 +1075,7 @@ private static void Execute(string name, Action action)
action();
s_succeeded++;
}
catch (SkipTestException) { }
catch (SkipException) { }
catch (Exception e)
{
s_failed++;
Expand All @@ -1097,7 +1094,7 @@ private static void Execute(string name, Func<Task> action)
action().GetAwaiter().GetResult();
s_succeeded++;
}
catch (SkipTestException) { }
catch (SkipException) { }
catch (Exception e)
{
s_failed++;
Expand All @@ -1115,6 +1112,18 @@ private static T Cast<T>(object obj) =>

private sealed class DefaultTestOutputHelper : ITestOutputHelper
{
public string Output => throw new NotSupportedException();

public void Write(string message)
{
if (s_verbose) Console.Write(""TestOutputHelper: "" + message);
}

public void Write(string format, params object[] args)
{
if (s_verbose) Console.Write(""TestOutputHelper: "" + string.Format(format, args));
}

public void WriteLine(string message)
{
if (s_verbose) Console.WriteLine(""TestOutputHelper: "" + message);
Expand All @@ -1139,7 +1148,6 @@ private static string GetCsprojTemplate(string targetFramework) =>
<ItemGroup>
<Reference Include=""xunit.core""><HintPath>#HelperAssemblyLocation#xunit.core.dll</HintPath></Reference>
<Reference Include=""xunit.assert""><HintPath>#HelperAssemblyLocation#xunit.assert.dll</HintPath></Reference>
<Reference Include=""xunit.abstractions""><HintPath>#HelperAssemblyLocation#xunit.abstractions.dll</HintPath></Reference>
<Reference Include=""Microsoft.DotNet.XUnitExtensions""><HintPath>#HelperAssemblyLocation#Microsoft.DotNet.XUnitExtensions.dll</HintPath></Reference>
<Reference Include=""TestUtilities""><HintPath>#HelperAssemblyLocation#TestUtilities.dll</HintPath></Reference>
<Reference Include=""#TestAssembly#""><HintPath>#TestAssemblyLocation#</HintPath></Reference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
<Compile Include="$(CommonTestPath)System\IO\CallTrackingStream.cs" Link="Common\System\IO\CallTrackingStream.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" Version="$(MicrosoftDotNetXUnitExtensionsVersion)" />
<PackageReference Include="xunit.core" Version="$(XUnitVersion)" ExcludeAssets="build" />
<PackageReference Include="xunit.assert" Version="$(XUnitVersion)" />
<PackageReference Include="Microsoft.DotNet.XUnitV3Extensions" Version="$(MicrosoftDotNetXUnitExtensionsVersion)" />
<PackageReference Include="xunit.v3.extensibility.core" Version="$(XUnitV3Version)" ExcludeAssets="build" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(CommonTestPath)TestUtilities\TestUtilities.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,16 @@ protected void AssertThrows(
if (exception == null)
{
throw EqualException.ForMismatchedValues(
exceptionTypes,
string.Join(", ", exceptionTypes.Select(t => t.FullName)),
null,
"Expected an exception but got null.");
}
Type exceptionType = exception.GetType();
if (!exceptionTypes.Contains(exceptionType))
{
throw EqualException.ForMismatchedValues(
exceptionTypes,
exceptionType,
string.Join(", ", exceptionTypes.Select(t => t.FullName)),
exceptionType.FullName,
"Caught wrong exception.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Threading.Tasks;

using Xunit;
using Xunit.Abstractions;

namespace System.Net.Http.Functional.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Threading.Tasks;

using Xunit;
using Xunit.Abstractions;

namespace System.Net.Http.Functional.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Threading.Tasks;

using Xunit;
using Xunit.Abstractions;

namespace System.Net.Http.Functional.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading.Tasks;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;
using Xunit.Abstractions;


namespace System.Net.Http.Functional.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Threading.Tasks;
using System.Threading.Tests;
using Xunit;
using Xunit.Abstractions;

namespace System.Net.Http.Functional.Tests
{
Expand Down
Loading
Loading