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

x test should support --show-output #134210

Open
jyn514 opened this issue Dec 12, 2024 · 0 comments
Open

x test should support --show-output #134210

jyn514 opened this issue Dec 12, 2024 · 0 comments
Labels
A-test-infra Area: test infrastructure (may span bootstrap/compiletest/more) C-enhancement Category: An issue proposing an enhancement or a PR with one. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jyn514
Copy link
Member

jyn514 commented Dec 12, 2024

we should teach bootstrap to respect --show-output, which in normal libtest prints the output at the end:

; c t --lib -- --show-output
warning: `[project]` is deprecated in favor of `[package]`
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.01s
     Running unittests src/lib.rs (/home/jyn/.local/lib/cargo/target/debug/deps/example-d78220620848f9e6)

running 2 tests
test bar ... ok
test foo ... ok

successes:

---- bar stdout ----
jieyouxu

---- foo stdout ----
hi


successes:
    bar
    foo

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

right now compiletest only supports --nocapture, which doesn't buffer output at all and as a result ends up interleaved with libtest's own progress reporting.

note this is non-trivial because bootstrap reimplements its own formatter for the json output:

fn render_suite_outcome(&self, outcome: Outcome<'_>, suite: &SuiteOutcome) {

Originally posted by @jyn514 in #134111 (comment)

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 12, 2024
@jieyouxu jieyouxu added E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-test-infra Area: test infrastructure (may span bootstrap/compiletest/more) C-enhancement Category: An issue proposing an enhancement or a PR with one. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

3 participants