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

make Assertions.withExitCode work #17830

Merged
merged 5 commits into from
Oct 9, 2024
Merged

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
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
@vzarytovskii vzarytovskii merged commit 4fb264d into dotnet:main Oct 9, 2024
32 checks passed
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