Skip to content

Commit bd15475

Browse files
authored
Better fix for core/quotes tests that broke after xUnit (#17665)
1 parent 9df0c3c commit bd15475

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

tests/fsharp/core/quotes/cslib.dll

-3.5 KB
Binary file not shown.

tests/fsharp/tests.fs

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@ module CoreTests =
7272
exec cfg ("." ++ "test-langversion-46.exe") ""
7373

7474
testOkFile.CheckExists()
75-
76-
// This test stays in FsharpSuite for a later migration phases, it uses hardcoded #r to a C# compiled cslib.dll inside
77-
[<Fact>]
78-
let ``quotes-FSC-FSC_DEBUG`` () = singleTestBuildAndRun "core/quotes" FSC_DEBUG
79-
80-
[<Fact>]
81-
let ``quotes-FSC-BASIC`` () = singleTestBuildAndRun "core/quotes" FSC_OPTIMIZED
82-
83-
[<Fact>]
84-
let ``quotes-FSI-BASIC`` () = singleTestBuildAndRun "core/quotes" FSI
8575
#endif
8676

8777

@@ -818,12 +808,11 @@ module CoreTests =
818808

819809
#endif
820810

821-
#if !NETCOREAPP
811+
#if !NETCOREAPP
822812
[<Fact>]
823813
let quotes () =
824814
let cfg = testConfig "core/quotes"
825815

826-
827816
csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"]
828817

829818
fsc cfg "%s -o:test.exe -r cslib.dll -g" cfg.fsc_flags ["test.fsx"]
@@ -864,6 +853,30 @@ module CoreTests =
864853
testOkFile.CheckExists()
865854
end
866855

856+
// Previously a comment here said:
857+
// "This test stays in FsharpSuite for a later migration phases, it uses hardcoded #r to a C# compiled cslib.dll inside"
858+
// This is resolved by compiling cslib.dll separately in each test.
859+
[<Fact>]
860+
let ``quotes-FSC-FSC_DEBUG`` () =
861+
let cfg = testConfig "core/quotes"
862+
csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"]
863+
864+
singleTestBuildAndRun "core/quotes" FSC_DEBUG
865+
866+
[<Fact>]
867+
let ``quotes-FSC-BASIC`` () =
868+
let cfg = testConfig "core/quotes"
869+
csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"]
870+
871+
singleTestBuildAndRun "core/quotes" FSC_OPTIMIZED
872+
873+
[<Fact>]
874+
let ``quotes-FSI-BASIC`` () =
875+
let cfg = testConfig "core/quotes"
876+
csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"]
877+
878+
singleTestBuildAndRun "core/quotes" FSI
879+
867880
[<Fact; Trait("Category", "parsing")>]
868881
let parsing () =
869882
let cfg = testConfig "core/parsing"

0 commit comments

Comments
 (0)