Skip to content

Commit

Permalink
Merge pull request #124 from ltratt/lang_tester_0_8_1
Browse files Browse the repository at this point in the history
Prepare a 0.8.1 release.
  • Loading branch information
vext01 authored Mar 20, 2024
2 parents 239a449 + b0c0911 commit 4dd211b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"]
readme = "README.md"
license = "Apache-2.0/MIT"
Expand All @@ -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"
Expand Down
33 changes: 17 additions & 16 deletions src/tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
stdin_remaining: usize,
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 4dd211b

Please sign in to comment.