Skip to content
Merged
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: 0 additions & 2 deletions tests/FSharp.Test.Utilities/CompilerAssert.fs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ module AssemblyResolver =
match found() with
| None -> Unchecked.defaultof<Assembly>
| Some name -> Assembly.Load(name) )

do addResolver()
#endif

type ExecutionOutcome =
Expand Down
2 changes: 1 addition & 1 deletion tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
<None Include="ScriptingShims.fsx" />
<Compile Include="TestConsole.fs" />
<Compile Include="TestFramework.fs" />
<Compile Include="XunitHelpers.fs" />
<Compile Include="ILChecker.fs" />
<Compile Include="Utilities.fs" />
<Compile Include="CompilerAssert.fs" />
Expand All @@ -46,6 +45,7 @@
<Compile Include="FileInlineDataAttribute.fs" />
<Compile Include="ReflectionHelper.fs" />
<Compile Include="SurfaceArea.fs" />
<Compile Include="XunitHelpers.fs" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 7 additions & 5 deletions tests/FSharp.Test.Utilities/XunitHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ type FSharpXunitFramework(sink: IMessageSink) =
// This gets executed once per test assembly.
MessageSink.sinkWriter |> ignore
TestConsole.install()
#if !NETCOREAPP
AssemblyResolver.addResolver ()
#endif

interface IDisposable with
member _.Dispose() =
Expand Down Expand Up @@ -148,24 +151,23 @@ type FSharpXunitFramework(sink: IMessageSink) =
log "FSharpXunitFramework with XUNIT_EXTRAS installing TestConsole redirection"
TestConsole.install()

// TODO: Currently does not work with Desktop .NET Framework. Upcoming OpenTelemetry 1.11.0 may change it.
#if NETCOREAPP
#if !NETCOREAPP
AssemblyResolver.addResolver ()
#endif

let traceProvider =
Sdk.CreateTracerProviderBuilder()
.AddSource(ActivityNames.FscSourceName)
.SetResourceBuilder(
ResourceBuilder.CreateDefault().AddService(serviceName="F#", serviceVersion = "1.0.0"))
.AddOtlpExporter()
.Build()
#endif

interface IDisposable with
member _.Dispose() =
cleanUpTemporaryDirectoryOfThisTestRun ()
#if NETCOREAPP
traceProvider.ForceFlush() |> ignore
traceProvider.Dispose()
#endif
base.Dispose()

override this.CreateDiscoverer (assemblyInfo) =
Expand Down
Loading