Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better fix for core/quotes tests that broke after xUnit #17665

Merged
merged 4 commits into from
Sep 9, 2024
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
Binary file removed tests/fsharp/core/quotes/cslib.dll
Binary file not shown.
37 changes: 25 additions & 12 deletions tests/fsharp/tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,6 @@ module CoreTests =
exec cfg ("." ++ "test-langversion-46.exe") ""

testOkFile.CheckExists()

// This test stays in FsharpSuite for a later migration phases, it uses hardcoded #r to a C# compiled cslib.dll inside
[<Fact>]
let ``quotes-FSC-FSC_DEBUG`` () = singleTestBuildAndRun "core/quotes" FSC_DEBUG

[<Fact>]
let ``quotes-FSC-BASIC`` () = singleTestBuildAndRun "core/quotes" FSC_OPTIMIZED

[<Fact>]
let ``quotes-FSI-BASIC`` () = singleTestBuildAndRun "core/quotes" FSI
#endif


Expand Down Expand Up @@ -818,12 +808,11 @@ module CoreTests =

#endif

#if !NETCOREAPP
#if !NETCOREAPP
[<Fact>]
let quotes () =
let cfg = testConfig "core/quotes"


csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"]

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

// Previously a comment here said:
// "This test stays in FsharpSuite for a later migration phases, it uses hardcoded #r to a C# compiled cslib.dll inside"
// This is resolved by compiling cslib.dll separately in each test.
[<Fact>]
let ``quotes-FSC-FSC_DEBUG`` () =
let cfg = testConfig "core/quotes"
csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"]

singleTestBuildAndRun "core/quotes" FSC_DEBUG

[<Fact>]
let ``quotes-FSC-BASIC`` () =
let cfg = testConfig "core/quotes"
csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"]

singleTestBuildAndRun "core/quotes" FSC_OPTIMIZED

[<Fact>]
let ``quotes-FSI-BASIC`` () =
let cfg = testConfig "core/quotes"
csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"]

singleTestBuildAndRun "core/quotes" FSI

[<Fact; Trait("Category", "parsing")>]
let parsing () =
let cfg = testConfig "core/parsing"
Expand Down
Loading