fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Consolidate emitted IL `for`-loop tests

Open brianrourkeboll opened this issue 1 year ago • 1 comments

Description

As noted in #17040:

In a followup PR, I may consolidate the copied "realsig±" test source files using a technique similar to that used in #16795.

The test sources and baselines for these were duplicated in #15484 to test the realsig feature, but that meant that the test sources needed to be kept in sync by hand. This change reconsolidates the test sources by using the approach from #16795 instead: it reuses the same test source files and just adds duplicate tests to check the emitted IL with realsig- and realsig+.

A few realsig- baseline files are updated as well, since it looks like some tests in /EmittedIL/ForLoop/RealInternalSignatureOff/ForLoop.fs did not have |> withLangVersionPreview, while their equivalents in /EmittedIL/ForLoop/RealInternalSignatureOn/ForLoop.fs did (proof that requiring manual synchronization is bad :).

For reviewers

The most important files:

  • Removed:
    • tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForLoop.fs
    • tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForLoop.fs
  • Added:
    • tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs
      • This consolidates the other two files by duplicating each test function and adding .RealInternalSignatureOff/.RealInternalSignatureOn suffixes to the generated baselines.
  • Updated:
    • tests/FSharp.Test.Utilities/ILChecker.fs
      • This is now unifying the assembly version for netstandard in the IL baselines, which lets us reuse more tests for both net472 and net8.0.

Checklist

  • This shouldn't need release notes.

Notes

These tests have always had some .opt-suffixed tests and some not, but verifyCompilation actually always calls withOptimize (that's why I didn't add opt/nonopt duplicates of the tests I added in #16650 to begin with). That means that some of the existing duplicate tests could be deduplicated, but I haven't done that in this PR.

brianrourkeboll avatar May 09 '24 14:05 brianrourkeboll

:white_check_mark: No release notes required

github-actions[bot] avatar May 09 '24 14:05 github-actions[bot]