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

compiletest: more granular --nocapture for run-make tests #134520

Open
jieyouxu opened this issue Dec 19, 2024 · 4 comments
Open

compiletest: more granular --nocapture for run-make tests #134520

jieyouxu opened this issue Dec 19, 2024 · 4 comments
Labels
A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-test-infra Area: test infrastructure (may span bootstrap/compiletest/more) C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jieyouxu
Copy link
Member

Would it be possible to add a way to revert back to the old behavior? For cg_clif this makes testing the rustc test suite very verbose. I have to use --nocapture to see any test failures in the first place as panic=abort means that without it compiletest aborts before it gets a chance to print the test failures, but I would like to not have my terminal getting spammed with the output of all passing tests.

Originally posted by @bjorn3 in #134111 (comment)

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 19, 2024
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. A-compiletest Area: The compiletest test runner A-test-infra Area: test infrastructure (may span bootstrap/compiletest/more) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Dec 19, 2024
@jieyouxu jieyouxu added the A-run-make Area: port run-make Makefiles to rmake.rs label Dec 19, 2024
@jyn514
Copy link
Member

jyn514 commented Dec 19, 2024

I have to use --nocapture to see any test failures in the first place as panic=abort means that without it compiletest aborts before it gets a chance to print the test failures

can we fix this more directly in compiletest? for instance spawn every test in a process instead of a thread, so aborting doesn't break things? then you wouldn't need to mess with --nocapture at all.

@bjorn3
Copy link
Member

bjorn3 commented Dec 20, 2024

That would be a great solution! In fact libtest already has builtin support for this through -Zpanic-abort-tests, however libtest only supports this for TestFn::StaticTestFn (as #[test] uses), but not for TestFn::DynTestFn (which compiletest needs to use as it dynamically discovers the set of tests), so compiletest probably needs custom logic to reimplement this.

@jieyouxu
Copy link
Member Author

Unfortunately I don't think that's going to be very easy in the short-term...

@jieyouxu
Copy link
Member Author

@bjorn3 so I don't think the "spawn every test in a process instead of the thread" is super easy atm because compiletest is married to libtest too hard atm. However, do you think that untying the --nocapture for run-make tests in favor of something more like --verbose-test-output (so that --nocapture, which is actually a libtest flag, continues to work more like the old behavior), would address your use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-test-infra Area: test infrastructure (may span bootstrap/compiletest/more) C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Development

No branches or pull requests

4 participants