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

A more verbose matching failure for mir tests #38289

Merged
merged 1 commit into from
Dec 21, 2016

Conversation

bluss
Copy link
Member

@bluss bluss commented Dec 10, 2016

This makes it easier to work with mir test failures during development.

  • Show which expected line was not found
  • Show full expected output
  • Show full actual output

This makes it easier to work with mir test failures during development.

- Show which expected line was not found
- Show full expected output
- Show full actual output
@rust-highfive
Copy link
Collaborator

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@bluss
Copy link
Member Author

bluss commented Dec 10, 2016

Example output below. It's long, but it's useful when developing.

failures: 

---- [mir-opt] mir-opt/deaggregator_test.rs stdout ----
        thread '[mir-opt] mir-opt/deaggregator_test.rs' panicked at 'ran out of mir dump output to match against.
Did not find expected line: "    _0 = Baz { x: _3, y: const F32(0), z: const false };"
Expected: 
bb0: {
    _2 = _1;
    _3 = _2;
    _0 = Baz { x: _3, y: const F32(0), z: const false };
    return;
}
Actual:   
fn bar(_1: usize) -> Baz {
    let mut _0: Baz;
    scope 1 {
        let _2: usize;
    }
    let mut _3: usize;
    bb0: {
        StorageLive(_2);
        _2 = _1;
        StorageLive(_3);
        _3 = _2;
        (_0.0: usize) = _3;
        (_0.1: f32) = const F32(0);
        (_0.2: bool) = const false;
        StorageDead(_3);
        StorageDead(_2);
        return;
    }
}', src/tools/compiletest/src/runtest.rs:2302
note: Run with `RUST_BACKTRACE=1` for a backtrace.

@michaelwoerister
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Dec 19, 2016

📌 Commit 90c5b71 has been approved by michaelwoerister

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 20, 2016
…aelwoerister

A more verbose matching failure for mir tests

This makes it easier to work with mir test failures during development.

- Show which expected line was not found
- Show full expected output
- Show full actual output
bors added a commit that referenced this pull request Dec 20, 2016
@bors bors merged commit 90c5b71 into rust-lang:master Dec 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants