-
Notifications
You must be signed in to change notification settings - Fork 844
Simplified compiler test framework #9721
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
Simplified compiler test framework #9721
Conversation
|
Not really a review here, just a suggestion: May I suggest we improve |
Yeah, that's the plan - I will add a verbose versions (looks pretty much like you suggested), as well as fewer small functions which are easier to compose (like withErrorCode 123 |> onPosition ... |> withMessage ... etc), so you have freedom to how to write and how vebose you want it :) Also - I would love to chat about the more complex testing scenarios (like one you've encountered in ExprTests). |
Sure, any time, you can ping me on Slack (just remember I'm on European time ;) ) and we can set up a call. |
Yeah, I'm in Prague myself :) |
|
Oh I love Prague! I come there at least once a year to visit friends and for a conf. I know it quite well, and of course the 🍺 🍻 🍺 |
tests/FSharp.Compiler.ComponentTests/Interop/SimpleInteropTests.fs
Outdated
Show resolved
Hide resolved
|
|
||
| // NOTE: This function will not clean up all the compiled projects after itself. | ||
| // The reason behind is so we can compose verification of test runs easier. | ||
| // TODO: We must not rely on the filesystem when compiling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will that be resolved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a separate issue for tackling that.
I'm thinking on the suite teardown level we can clean up all projects/sources we've created.
Co-authored-by: Phillip Carter <pcarter@fastmail.com>
KevinRansom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks, great. I have suggested a few things to consider in the next update. But they shouldn't hold up merging this PR.
Nice work
Kevin
| Warnings = [] | ||
| Errors = [] } | ||
|
|
||
| let private typecheckFSharpSource (fsSource: FSharpCompilationSource) : CompilationResult = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible we would like have tests with multiple source files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it's tracked in #9746
…ions + fixed options composition.
* [WIP] Simplified compiler API for testing * [WIP] Support of references, for F#, C# projects. Added more asserts. * Added more examples + ignoreWarnings support * Added typecheck + baseline test helpers. * Added running functionality * Moved a bunch of compiler tests to a new suite * Changed error message * [WIP] Added CSharp compilation + referencing * Added some simple interop tests * [WIP] Process MetadataReference recursively * [WIP] Added netcorapp31 support for tests * [WIP] Termporary revert to using netcoreapp30 in the tests (instead of netcoreapp31) * Added types to errors/warnings as oppose to just having tuples * Fixed tests to fit newer API * Revert libraries upgrade * Revert change netcoreapp31 -> netcoreapp30 * Update tests/FSharp.Test.Utilities/Compiler.fs Co-authored-by: Phillip Carter <pcarter@fastmail.com> * Addressed some PR comments * Fixed missing styling inconsistensies * Addressed feedback: recursive module instead of forward type declarations + fixed options composition. * Changed Option.isSome -> defaultArg Co-authored-by: Phillip Carter <pcarter@fastmail.com>
First round of implementation of #9720
There are still a bunch of stuff to implement, but first, we need to have a new base for it.