Skip to content

x test should support --show-output #134210

Open
@jyn514

Description

@jyn514

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-test-infraArea: test infrastructure (may span bootstrap/compiletest/more)C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions