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

Support rustc's -Z panic-abort-tests in Cargo #7460

Merged
merged 3 commits into from
Oct 21, 2019

Commits on Oct 21, 2019

  1. Support rustc's -Z panic-abort-tests in Cargo

    Recently added in rust-lang/rust#64158 the `-Z panic-abort-tests` flag
    to the compiler itself will activate a mode in the `test` crate which
    enables running tests even if they're compiled with `panic=abort`.  It
    effectively runs a test-per-process.
    
    This commit brings the same support to Cargo, adding a `-Z
    panic-abort-tests` flag to Cargo which allows building tests in
    `panic=abort` mode. While I wanted to be sure to add support for this in
    Cargo before we stabilize the flag in `rustc`, I don't actually know how
    we're going to stabilize this here. Today Cargo will automatically
    switch test targets to `panic=unwind`, and so if we actually were to
    stabilize this flag then this configuration would break:
    
        [profile.dev]
        panic = 'abort'
    
    In that case tests would be compiled with `panic=unwind` (due to how
    profiles work today) which would clash with crates also being compiled
    with `panic=abort`. I'm hopeful though that we can perhaps either figure
    out a solution for this and maybe even integrate it with the ongoing
    profiles work.
    alexcrichton committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    f37f3ae View commit details
    Browse the repository at this point in the history
  2. Inherit panic settings in test/bench profiles

    We've always ignored the `panic` settings configured in test/bench
    profiles, so this just continues to ignore them but in a slightly
    different way.
    alexcrichton committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    9cfdf4d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    269624f View commit details
    Browse the repository at this point in the history