Skip to content

Test suggestions in diagnostics with compiletest #45516

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

Closed
oli-obk opened this issue Oct 25, 2017 · 3 comments
Closed

Test suggestions in diagnostics with compiletest #45516

oli-obk opened this issue Oct 25, 2017 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Oct 25, 2017

Currently suggestions are tested either via compile-fail // SUGGESTION foobar comments or in ui tests by looking at the json or the command line output.

The validity of these suggestions requires a human to interpret them. I suggest (pun intended) that we generate a .suggestion and a .suggestion.stderr file together with the .stderr and the .stdout files. The file will only exist if there are any suggestions produced. The .suggestion file will contain the source with all suggestions applied. The .suggestion.stderr file will contain the result from compiling the .suggestion file.

Open questions:

  • What to do if a suggestion has multiple replacements that can apply?
  • The results might differ depending on the order of applying multiple suggestions
  • The ability to disable suggestion testing on specific files, because it'd just be noise

cc @llogiq @Manishearth @mcarton

@estebank estebank added A-diagnostics Area: Messages for errors, warnings, and lints A-testsuite Area: The testsuite used to check the correctness of rustc labels Oct 25, 2017
@oli-obk
Copy link
Contributor Author

oli-obk commented Nov 25, 2017

Now that the ui tests have an intermediate json phase, we can extract the relevant info and reuse parts of rustfix in compiletest. Cc @killercup

@nrc nrc added the T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. label Nov 27, 2017
@estebank estebank added the WG-diagnostics Working group: Diagnostics label Dec 7, 2017
@killercup
Copy link
Member

I've been working towards something like this in https://github.com/killercup/rustfix/pull/44. My hope is to use rustfix as a library in compiletest.

@XAMPPRocky XAMPPRocky added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Feb 12, 2018
@phansch
Copy link
Member

phansch commented Jan 4, 2019

I think this can be closed now that compiletest has rustfix integrated?

@oli-obk oli-obk closed this as completed Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics
Projects
None yet
Development

No branches or pull requests

6 participants