diff --git a/CHANGES.md b/CHANGES.md index aa4a717..aa07ba0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,10 @@ +# lang_tester 0.8.1 (2024-03-20) + +* Use newer version of fm that provides more comprehensive output by default. + +* Document and enforce that `ignore-if` cmds are run in `CARGO_MANIFEST_DIR`. + + # lang_tester 0.8.0 (2024-01-31) ## Breaking change diff --git a/Cargo.toml b/Cargo.toml index 495b9f2..0d20959 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "lang_tester" description = "Concise language testing framework for compilers and VMs" repository = "https://github.com/softdevteam/lang_tester/" -version = "0.8.0" +version = "0.8.1" authors = ["Laurence Tratt "] readme = "README.md" license = "Apache-2.0/MIT" @@ -23,7 +23,7 @@ path = "lang_tests/rerun/main.rs" harness = false [dependencies] -fm = "0.2" +fm = "0.3" getopts = "0.2" libc = "0.2" num_cpus = "1.15" diff --git a/src/tester.rs b/src/tester.rs index 066305a..232975d 100644 --- a/src/tester.rs +++ b/src/tester.rs @@ -568,7 +568,7 @@ pub(crate) struct Tests<'a> { /// If one or more parts of a `TestCmd` fail, the parts that fail are set to `Some(...)` in an /// instance of this struct. -#[derive(Debug, PartialEq)] +#[derive(Debug)] struct TestFailure { status: Option, stdin_remaining: usize, @@ -932,27 +932,28 @@ fn run_tests( .write_all(format!("\ntest lang_tests::{} ... ", test_fname).as_bytes()) .ok(); } - if failure - != (TestFailure { + match failure { + TestFailure { status: None, stdin_remaining: 0, stderr: None, stderr_match: None, stdout: None, stdout_match: None, - }) - { - let mut failures = failures.lock().unwrap(); - failures.push((test_fname, failure)); - handle - .set_color(ColorSpec::new().set_fg(Some(Color::Red))) - .ok(); - handle.write_all(b"FAILED").ok(); - } else { - handle - .set_color(ColorSpec::new().set_fg(Some(Color::Green))) - .ok(); - handle.write_all(b"ok").ok(); + } => { + handle + .set_color(ColorSpec::new().set_fg(Some(Color::Green))) + .ok(); + handle.write_all(b"ok").ok(); + } + _ => { + let mut failures = failures.lock().unwrap(); + failures.push((test_fname, failure)); + handle + .set_color(ColorSpec::new().set_fg(Some(Color::Red))) + .ok(); + handle.write_all(b"FAILED").ok(); + } } handle.reset().ok(); }