trybuild icon indicating copy to clipboard operation
trybuild copied to clipboard

Warnings on pass tests get reported twice

Open dtolnay opened this issue 3 years ago • 0 comments

// src/lib.rs

pub struct Thing;
// tests/compiletest.rs

#[test]
fn ui() {
    let t = trybuild::TestCases::new();
    t.pass("tests/ui/test.rs");
}
// tests/ui/test.rs

use repro::Thing;

fn main() {}
$ cargo test

running 1 test

test tests/ui/test.rs ... ok

WARNINGS:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
warning: unused import: `repro::Thing`
 --> tests/ui/test.rs:1:5
  |
1 | use repro::Thing;
  |     ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: 1 warning emitted
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

STDERR:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
warning: unused import: `repro::Thing`
 --> /git/repro/tests/ui/test.rs:1:5
  |
1 | use repro::Thing;
  |     ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈


test ui ... ok

dtolnay avatar Jun 04 '22 06:06 dtolnay