Skip to content

Conversation

@Martin521
Copy link
Contributor

Description

This PR makes FSharp.Compiler.Test.Compiler.Assertions.withExitCode work as expected.
withExitCode now asserts that the test object returns the expected integer exit code.
This can be quite conveniant like in the added test (which is taken from another PR where I came upon this need).
The changes that were required down the call chain should now consistently deliver from the test object

  • stdout output (string)
  • stderr output (string)
  • exit code, if any (int option)
  • exception, if any (exn option)

When the above is incorperated into a CompilationResult, the appropriate Success or Failure case is chosen, based on the same criteria as before (presence of errors, or of an exception, or something else, depending on the context).
If the test object does not return an int exit code, or if there is no reliable exit code (like in executeBuiltAppNewProcessAndReturnResult), ExitCode=None is returned in the CompilationResult.

Checklist

  • Test cases added
  • No release notes required

@Martin521 Martin521 requested a review from a team as a code owner October 2, 2024 16:32
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2024

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

@Martin521
Copy link
Contributor Author

Can somebody add the NO_RELEASE_NOTES label?

@vzarytovskii
Copy link
Member

Can somebody add the NO_RELEASE_NOTES label?

Added. I'll make a bot command if I'll not forget

@vzarytovskii vzarytovskii added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Oct 2, 2024
@Martin521 Martin521 marked this pull request as draft October 3, 2024 07:06
@Martin521 Martin521 marked this pull request as ready for review October 3, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants