-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
#[rustversion::attr(not(nightly), ignore)] | ||
#[cfg_attr(not(backtrace), ignore)] | ||
#[cfg_attr(miri, ignore)] | ||
#[test] | ||
fn ui() { | ||
let t = trybuild::TestCases::new(); | ||
t.compile_fail("tests/ui/*.rs"); | ||
let eyre_root_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); | ||
let mut config = ui_test::Config::cargo(eyre_root_dir); | ||
let rust_backtrace_val = "1"; | ||
config | ||
.program | ||
.envs | ||
.push(("RUST_BACKTRACE".into(), Some(rust_backtrace_val.into()))); | ||
config.mode = ui_test::Mode::Run { exit_code: 0 }; | ||
config.filter_files = vec!["ui_test".to_owned()]; | ||
ui_test::run_tests(config); | ||
Check warning on line 14 in eyre/tests/compiletest.rs GitHub Actions / Test Suite (beta, --no-default-features)
Check warning on line 14 in eyre/tests/compiletest.rs GitHub Actions / Test Suite (beta, --features auto-install)
Check warning on line 14 in eyre/tests/compiletest.rs GitHub Actions / Test Suite (beta, --features pyo3)
Check warning on line 14 in eyre/tests/compiletest.rs GitHub Actions / Test Suite (nightly, --no-default-features)
Check warning on line 14 in eyre/tests/compiletest.rs GitHub Actions / Test Suite (nightly, --features track-caller)
Check warning on line 14 in eyre/tests/compiletest.rs GitHub Actions / Test Suite (beta, --features track-caller)
Check warning on line 14 in eyre/tests/compiletest.rs GitHub Actions / Test Suite (beta, --all-features)
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use eyre::Report; | ||
|
||
fn fail(fail: bool) -> Result<(), Report> { | ||
let e: Report = eyre!("Internal error message"); | ||
if fail { | ||
Err(e).wrap_err("External error message") | ||
} else { | ||
Ok(()) | ||
} | ||
} | ||
|
||
fn main() { | ||
fail(true); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
error: embedded manifest `$DIR/ui_test_backtrace.rs` requires `-Zscript` |