diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-12-06 13:26:44 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-12-06 13:26:44 +0100 |
| commit | 1099330988da78c82c6e155fab88d81fb2f1d4c0 (patch) | |
| tree | 5a13332defa0ad482ed8669ad52f59a595aa25d6 /tests | |
| parent | f5b104d0da1c414fb59878d7378add316ee14798 (diff) | |
Finish consistent map and add two further convenience maps 🗺
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/layouting.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/layouting.rs b/tests/layouting.rs index 7f6014e8..001ff45a 100644 --- a/tests/layouting.rs +++ b/tests/layouting.rs @@ -29,6 +29,8 @@ fn main() { fs::create_dir_all(format!("{}/rendered", CACHE_DIR)).unwrap(); fs::create_dir_all(format!("{}/pdf", CACHE_DIR)).unwrap(); + let mut failed = 0; + for entry in fs::read_dir("tests/layouts/").unwrap() { let path = entry.unwrap().path(); @@ -49,9 +51,17 @@ fn main() { let mut src = String::new(); file.read_to_string(&mut src).unwrap(); - test(name, &src); + if std::panic::catch_unwind(|| test(name, &src)).is_err() { + failed += 1; + println!(); + } } } + + if failed > 0 { + println!("{} tests failed.", failed); + std::process::exit(-1); + } } /// Create a _PDF_ with a name from the source code. |
