Skip to content

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

Open

Description

@jieyouxu

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)

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Dec 19, 2024
  2. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    C-bugCategory: This is a bug.
    A-compiletestArea: The compiletest test runner
    A-test-infraArea: test infrastructure (may span bootstrap/compiletest/more)
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Dec 19, 2024
  3. jyn514 commented on Dec 19, 2024

    @jyn514
    Member

    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.

  4. bjorn3 commented on Dec 20, 2024

    @bjorn3
    Member

    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.

  5. jieyouxu commented on Dec 20, 2024

    @jieyouxu
    MemberAuthor

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

  6. jieyouxu commented on Dec 22, 2024

    @jieyouxu
    MemberAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compiletestArea: The compiletest test runnerA-run-makeArea: port run-make Makefiles to rmake.rsA-test-infraArea: test infrastructure (may span bootstrap/compiletest/more)C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions