Skip to content

Commit

Permalink
Merge pull request #121 from ltratt/lang_tester_0_8_0
Browse files Browse the repository at this point in the history
Prepare a 0.8.0 release.
  • Loading branch information
vext01 committed Jan 31, 2024
2 parents a759449 + d8c30da commit 27a7ffb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
19 changes: 19 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# lang_tester 0.8.0 (2024-01-31)

## Breaking change

* Remove `ignored` and add `ignore-if`. The latter runs an arbitrary shell
command which, if it returns zero, causes the test to be ignored. This allows
much more flexibility than the overly simplistic "always ignore this test" of
`ignored`. Tests with `ignored: <reason>` can be changed to `ignore-if: true`
followed (or preceded) by a comment `# <reason>` (assuming `comment_prefix`
is set: see below).

## Non-breaking change

* Allow comments in tests with a user-configurable prefix. By default no
comment prefix is set. You can set one with `comment_prefix("...")`. For
example `LangTester::new().comment_prefix("#")` causes lines in tests
starting with `#` to be entirely ignored by lang_tester.


# lang_tester 0.7.6 (2024-01-22)

* `test_file_filter` is deprecated in favour of `test_path_filter`. The latter
Expand Down
2 changes: 1 addition & 1 deletion 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.7.6"
version = "0.8.0"
authors = ["Laurence Tratt <laurie@tratt.net>"]
readme = "README.md"
license = "Apache-2.0/MIT"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ fn main() {
.test_dir("examples/rust_lang_tester/lang_tests")
// Only use files named `*.rs` as test files.
.test_file_filter(|p| p.extension().unwrap().to_str().unwrap() == "rs")
// Treat lines beginning with "#" as comments.
.comment_prefix("#")
// Extract the first sequence of commented line(s) as the tests.
.test_extract(|p| {
read_to_string(p)
Expand Down
4 changes: 2 additions & 2 deletions examples/rust_lang_tester/run_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ fn main() {
let tempdir = TempDir::new().unwrap();
LangTester::new()
.test_dir("examples/rust_lang_tester/lang_tests")
// Treat top-level lines beginning with "#" as comments.
.comment_prefix("#")
// Only use files named `*.rs` as test files.
.test_path_filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs"))
// Treat lines beginning with "#" as comments.
.comment_prefix("#")
// Extract the first sequence of commented line(s) as the tests.
.test_extract(|p| {
read_to_string(p)
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
//! .test_dir("examples/rust_lang_tester/lang_tests")
//! // Only use files named `*.rs` as test files.
//! .test_path_filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs"))
//! // Treat lines beginning with "#" as comments.
//! .comment_prefix("#")
//! // Extract the first sequence of commented line(s) as the tests.
//! .test_extract(|p| {
//! read_to_string(p)
Expand Down

0 comments on commit 27a7ffb

Please sign in to comment.