@@ -29,7 +29,8 @@ type FSharpXunitFramework(sink: IMessageSink) =
2929 // Because xUnit v2 lacks assembly fixture, the next best place to ensure things get called
3030 // right at the start of the test run is here in the constructor.
3131 // This gets executed once per test assembly.
32- MessageSink.sinkWriter |> ignore
32+ logConfig initialConfig
33+ log " FSharpXunitFramework installing TestConsole redirection"
3334 TestConsole.install()
3435#if ! NETCOREAPP
3536 AssemblyResolver.addResolver ()
@@ -144,16 +145,6 @@ type CustomTheoryTestCase =
144145/// ` XunitTestFramework ` providing parallel console support and conditionally enabling optional xUnit customizations.
145146type FSharpXunitFramework ( sink : IMessageSink ) =
146147 inherit XunitTestFramework( sink)
147- do
148- // Because xUnit v2 lacks assembly fixture, the next best place to ensure things get called
149- // right at the start of the test run is here in the constructor.
150- // This gets executed once per test assembly.
151- log " FSharpXunitFramework with XUNIT_EXTRAS installing TestConsole redirection"
152- TestConsole.install()
153-
154- #if ! NETCOREAPP
155- AssemblyResolver.addResolver ()
156- #endif
157148
158149 let traceProvider =
159150 Sdk.CreateTracerProviderBuilder()
@@ -176,6 +167,18 @@ type FSharpXunitFramework(sink: IMessageSink) =
176167 { new XunitTestFrameworkExecutor( assemblyName, this.SourceInformationProvider, this.DiagnosticMessageSink) with
177168 override _.RunTestCases ( testCases , executionMessageSink , executionOptions ) =
178169 use _ = Activity.start $" {assemblyName.Name} {Runtime.InteropServices.RuntimeInformation.FrameworkDescription}" []
170+
171+ // Because xUnit v2 lacks assembly fixture, the next best place to ensure things get called
172+ // right at the start of the test run is here or in the FSharpXunitFramework constructor.
173+ // This gets executed once per test assembly.
174+ printfn $" Running tests in {assemblyName.Name} with XUNIT_EXTRAS"
175+ logConfig initialConfig
176+ log " Installing TestConsole redirection"
177+ TestConsole.install()
178+
179+ #if ! NETCOREAPP
180+ AssemblyResolver.addResolver ()
181+ #endif
179182 base .RunTestCases( testCases, executionMessageSink, executionOptions)
180183 }
181184
0 commit comments