Skip to content
Draft

xunit.v3 #18976

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<IgnoreMibc Condition="'$(IgnoreMibc)' == ''">$(DotNetBuildSourceOnly)</IgnoreMibc>
<!-- When building the .NET product, there's no need to publish Windows PDBs. Any conversion to Windows PDBs will be done during staging, if necessary. -->
<PublishWindowsPdb Condition="'$(DotNetBuild)' == 'true'">false</PublishWindowsPdb>

<TestRunnerName>XUnitV3</TestRunnerName>
</PropertyGroup>

<!--
Expand Down
8 changes: 5 additions & 3 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(NETCoreSdkPortableRuntimeIdentifier)/fsyacc.dll</FsYaccPath>
</PropertyGroup>

<ItemGroup Condition="'$(UnitTestType)' == 'xunit'">
<PackageReference Include="xunit" Version="$(XUnitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVersion)" />
<ItemGroup Condition="'$(IsTestProject)' == 'true' OR '$(IsTestingPlatformApplication)' == 'true'">
<PackageReference Include="XunitXml.TestLogger" Version="$(XunitXmlTestLoggerVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(IsTestingPlatformApplication)' == 'true'">
<PackageReference Include="Microsoft.Testing.Extensions.HangDump" Version="$(MicrosoftTestingPlatformVersion)" />
</ItemGroup>

<!--
When .NET gets built from source, make the SDK aware there are bootstrap packages
for Microsoft.NETCore.App.Runtime.<rid> and Microsoft.NETCore.App.Crossgen2.<rid>.
Expand Down
6 changes: 1 addition & 5 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project>
<Import Project="Version.Details.props" Condition="Exists('Version.Details.props')" />
<PropertyGroup>
<!-- opt-out properties -->
<UsingToolXUnit>false</UsingToolXUnit>
<!-- opt-in properties -->
<UsingToolNuGetRepack>true</UsingToolNuGetRepack>
<UsingToolSymbolUploader>true</UsingToolSymbolUploader>
Expand Down Expand Up @@ -188,9 +186,7 @@
<RoslynToolsSignToolVersion>1.0.0-beta2-dev3</RoslynToolsSignToolVersion>
<StreamJsonRpcVersion>2.22.11</StreamJsonRpcVersion>
<NerdbankStreamsVersion>2.12.87</NerdbankStreamsVersion>
<XUnitVersion>2.9.0</XUnitVersion>
<XUnitRunnerVersion>2.8.2</XUnitRunnerVersion>
<XunitXmlTestLoggerVersion>3.1.17</XunitXmlTestLoggerVersion>
<XunitXmlTestLoggerVersion>7.0.1</XunitXmlTestLoggerVersion>
<HumanizerCoreVersion>2.2.0</HumanizerCoreVersion>
<!-- -->
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
<PropertyGroup>
<TargetFrameworks>net472;$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix' or '$(BUILDING_USING_DOTNET)' == 'true'">$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UnitTestType>xunit</UnitTestType>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
<PropertyGroup>
<TargetFrameworks>net472;$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix' or '$(BUILDING_USING_DOTNET)' == 'true'">$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UnitTestType>xunit</UnitTestType>
<IsTestProject>true</IsTestProject>
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
<Optimize>false</Optimize>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Tailcalls>false</Tailcalls>
<OtherFlags>$(OtherFlags) --warnon:1182</OtherFlags>
<NoWarn>$(NoWarn);FS0988</NoWarn>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
<PropertyGroup>
<TargetFrameworks>net472;$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix' or '$(BUILDING_USING_DOTNET)' == 'true'">$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UnitTestType>xunit</UnitTestType>
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
<NoWarn>$(NoWarn);44</NoWarn> <!-- Obsolete -->
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TolerateUnusedBindings>true</TolerateUnusedBindings>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UnitTestType>xunit</UnitTestType>
<OutputType>Exe</OutputType>
</PropertyGroup>

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
Expand Down
3 changes: 1 addition & 2 deletions tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<TargetFrameworks>$(FSharpNetCoreProductTargetFramework);net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix' or '$(BUILDING_USING_DOTNET)' == 'true'">$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>

<AssemblyName>FSharp.Core.UnitTests</AssemblyName>
<PackageId>Microsoft.FSharp.Core.UnitTests</PackageId>
Expand All @@ -14,7 +14,6 @@
<LangVersion>preview</LangVersion>
<TolerateUnusedBindings>true</TolerateUnusedBindings>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UnitTestType>xunit</UnitTestType>
<IsTestProject>true</IsTestProject>
<IsPackable>true</IsPackable>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
1 change: 0 additions & 1 deletion tests/FSharp.Test.Utilities/Compiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ open FSharp.Test.ScriptHelpers
open Microsoft.CodeAnalysis
open Microsoft.CodeAnalysis.CSharp
open Xunit
open Xunit.Abstractions
open System
open System.Collections.Immutable
open System.IO
Expand Down
1 change: 1 addition & 0 deletions tests/FSharp.Test.Utilities/DirectoryAttribute.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
open FSharp.Test.Compiler
open FSharp.Test.Utilities
open TestFramework
open Xunit.v3

/// Attribute to use with Xunit's TheoryAttribute.
/// Takes a directory, relative to current test suite's root.
Expand All @@ -30,4 +31,4 @@
member _.BaselineSuffix with get() = baselineSuffix and set v = baselineSuffix <- v
member _.Includes with get() = includes and set v = includes <- v

override _.GetData _ = createCompilationUnitForFiles baselineSuffix directoryPath includes

Check failure on line 34 in tests/FSharp.Test.Utilities/DirectoryAttribute.fs

View check run for this annotation

Azure Pipelines / fsharp-ci (Build Linux)

tests/FSharp.Test.Utilities/DirectoryAttribute.fs#L34

tests/FSharp.Test.Utilities/DirectoryAttribute.fs(34,16): error FS0856: (NETCORE_ENGINEERING_TELEMETRY=Build) This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:� DataAttribute.GetData(testMethod: MethodInfo, disposalTracker: DisposalTracker) : Threading.Tasks.ValueTask<Collections.Generic.IReadOnlyCollection<Xunit.ITheoryDataRow>>

Check failure on line 34 in tests/FSharp.Test.Utilities/DirectoryAttribute.fs

View check run for this annotation

Azure Pipelines / fsharp-ci (Build MacOS)

tests/FSharp.Test.Utilities/DirectoryAttribute.fs#L34

tests/FSharp.Test.Utilities/DirectoryAttribute.fs(34,16): error FS0856: (NETCORE_ENGINEERING_TELEMETRY=Build) This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:� DataAttribute.GetData(testMethod: MethodInfo, disposalTracker: DisposalTracker) : Threading.Tasks.ValueTask<Collections.Generic.IReadOnlyCollection<Xunit.ITheoryDataRow>>

Check failure on line 34 in tests/FSharp.Test.Utilities/DirectoryAttribute.fs

View check run for this annotation

Azure Pipelines / fsharp-ci

tests/FSharp.Test.Utilities/DirectoryAttribute.fs#L34

tests/FSharp.Test.Utilities/DirectoryAttribute.fs(34,16): error FS0856: (NETCORE_ENGINEERING_TELEMETRY=Build) This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:� DataAttribute.GetData(testMethod: MethodInfo, disposalTracker: DisposalTracker) : Threading.Tasks.ValueTask<Collections.Generic.IReadOnlyCollection<Xunit.ITheoryDataRow>>
3 changes: 1 addition & 2 deletions tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
<RuntimeIdentifiers>win-x86;win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81</AssetTargetFallback>
<ReferenceVsAssemblies>true</ReferenceVsAssemblies>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UnitTestType>xunit</UnitTestType>
<IsTestProject>true</IsTestProject>
<OtherFlags>$(OtherFlags) --realsig-</OtherFlags>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
Expand Down
3 changes: 1 addition & 2 deletions tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
open System.Runtime.CompilerServices
open System.Runtime.InteropServices

open Xunit
open Xunit.Abstractions
open Xunit.v3
open Xunit.Sdk

open FSharp.Compiler.IO
Expand Down Expand Up @@ -61,7 +60,7 @@

member _.Realsig with set v = realsig <- Some v

override _.GetData _ =

Check failure on line 63 in tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs

View check run for this annotation

Azure Pipelines / fsharp-ci (Build Linux)

tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs#L63

tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs(63,16): error FS0856: (NETCORE_ENGINEERING_TELEMETRY=Build) This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:� DataAttribute.GetData(testMethod: MethodInfo, disposalTracker: DisposalTracker) : Threading.Tasks.ValueTask<Collections.Generic.IReadOnlyCollection<Xunit.ITheoryDataRow>>

Check failure on line 63 in tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs

View check run for this annotation

Azure Pipelines / fsharp-ci (Build MacOS)

tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs#L63

tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs(63,16): error FS0856: (NETCORE_ENGINEERING_TELEMETRY=Build) This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:� DataAttribute.GetData(testMethod: MethodInfo, disposalTracker: DisposalTracker) : Threading.Tasks.ValueTask<Collections.Generic.IReadOnlyCollection<Xunit.ITheoryDataRow>>

Check failure on line 63 in tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs

View check run for this annotation

Azure Pipelines / fsharp-ci

tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs#L63

tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs(63,16): error FS0856: (NETCORE_ENGINEERING_TELEMETRY=Build) This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:� DataAttribute.GetData(testMethod: MethodInfo, disposalTracker: DisposalTracker) : Threading.Tasks.ValueTask<Collections.Generic.IReadOnlyCollection<Xunit.ITheoryDataRow>>

let getOptions realsig optimize =

Expand Down
2 changes: 1 addition & 1 deletion tests/FSharp.Test.Utilities/XunitHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

open System
open Xunit.Sdk
open Xunit.Abstractions

open TestFramework

Expand All @@ -16,6 +15,7 @@
open OpenTelemetry.Resources
open OpenTelemetry.Trace
open OpenTelemetry.Metrics
open Xunit.v3

/// Disables custom internal parallelization added with XUNIT_EXTRAS.
/// Execute test cases in a class or a module one by one instead of all at once. Allow other collections to run simultaneously.
Expand All @@ -28,7 +28,7 @@
type StressAttribute([<ParamArray>] data: obj array) =
inherit DataAttribute()
member val Count = 1 with get, set
override this.GetData _ = Seq.init this.Count (fun i -> [| yield! data; yield box i |])

Check failure on line 31 in tests/FSharp.Test.Utilities/XunitHelpers.fs

View check run for this annotation

Azure Pipelines / fsharp-ci (Build Linux)

tests/FSharp.Test.Utilities/XunitHelpers.fs#L31

tests/FSharp.Test.Utilities/XunitHelpers.fs(31,19): error FS0856: (NETCORE_ENGINEERING_TELEMETRY=Build) This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:� DataAttribute.GetData(testMethod: Reflection.MethodInfo, disposalTracker: DisposalTracker) : Threading.Tasks.ValueTask<Collections.Generic.IReadOnlyCollection<Xunit.ITheoryDataRow>>

Check failure on line 31 in tests/FSharp.Test.Utilities/XunitHelpers.fs

View check run for this annotation

Azure Pipelines / fsharp-ci (Build MacOS)

tests/FSharp.Test.Utilities/XunitHelpers.fs#L31

tests/FSharp.Test.Utilities/XunitHelpers.fs(31,19): error FS0856: (NETCORE_ENGINEERING_TELEMETRY=Build) This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:� DataAttribute.GetData(testMethod: Reflection.MethodInfo, disposalTracker: DisposalTracker) : Threading.Tasks.ValueTask<Collections.Generic.IReadOnlyCollection<Xunit.ITheoryDataRow>>

#if XUNIT_EXTRAS

Expand All @@ -41,7 +41,7 @@
inherit XunitTestRunner(test, messageBus, testClass, constructorArguments, testMethod, testMethodArguments, skipReason, beforeAfterAttributes, aggregator, cancellationTokenSource)

member _.BaseInvokeTestMethodAsync aggregator = base.InvokeTestMethodAsync aggregator
override this.InvokeTestAsync (aggregator: ExceptionAggregator) =

Check failure on line 44 in tests/FSharp.Test.Utilities/XunitHelpers.fs

View check run for this annotation

Azure Pipelines / fsharp-ci (Build Linux)

tests/FSharp.Test.Utilities/XunitHelpers.fs#L44

tests/FSharp.Test.Utilities/XunitHelpers.fs(44,19): error FS0855: (NETCORE_ENGINEERING_TELEMETRY=Build) No abstract or interface member was found that corresponds to this override

Check failure on line 44 in tests/FSharp.Test.Utilities/XunitHelpers.fs

View check run for this annotation

Azure Pipelines / fsharp-ci (Build MacOS)

tests/FSharp.Test.Utilities/XunitHelpers.fs#L44

tests/FSharp.Test.Utilities/XunitHelpers.fs(44,19): error FS0855: (NETCORE_ENGINEERING_TELEMETRY=Build) No abstract or interface member was found that corresponds to this override
task {
use capture = new TestConsole.ExecutionCapture()
use _ = Activity.startNoTags test.DisplayName
Expand Down
3 changes: 1 addition & 2 deletions tests/fsharp/FSharpSuite.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81</AssetTargetFallback>
<ReferenceVsAssemblies>true</ReferenceVsAssemblies>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OtherFlags>$(OtherFlags) --langversion:preview</OtherFlags>
<UnitTestType>xunit</UnitTestType>
<NoWarn>3186</NoWarn>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.0.0.0</Version>
<UnitTestType>none</UnitTestType>
<NoWarn>$(NoWarn);0067;1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<GenerateProgramFile>false</GenerateProgramFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>VSTHRD200;CS1591</NoWarn>
<TestRunnerName>XUnit</TestRunnerName>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<NoWarn>$(NoWarn);FS3511</NoWarn> <!-- This state machine is not statically compilable. -->
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<PlatformTarget>x86</PlatformTarget>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);44;58;75;3005</NoWarn>
<TolerateUnusedBindings>true</TolerateUnusedBindings>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
Expand Down
Loading