Ensure test runnable generated by rust-project works with the default rust test harness #1168
+29
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been working on setting up a project with buck2 lately and ran into an issue with editor integration (specifically vscode with rust analyser).
The generated runnable doesn't work with buck2 because it hardcodes "buck". It also doesn't respect the
--buck2-commandflag and passed flags to the rust test binary that the default rust test harness does not understand (e.g.--print-passing-details). Now, the command is generated from theBuckstruct so--buck2-command is respected. I've also tweaked the flags that get passed through to map to the default rust test harness, perhaps there should be a way of configuring these flags for custom test harnesses? The rational for each flag is:--exact: we only want to run the one test and have its full name. Since rust allows functions and modules to have the same name in the same namespace, it's possible that a test name is the prefix of another.--no-capture: I'm assuming--print-passing-detailsused to do something like this?