-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[broken test] Trying to test on backtrace output
Showing
5 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
error: embedded manifest `$DIR/ui_test_backtrace.rs` requires `-Zscript` |