summaryrefslogtreecommitdiff
path: root/tests/layout.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-12-09 13:29:04 +0100
committerLaurenz <laurmaedje@gmail.com>2019-12-09 13:29:04 +0100
commit7e980224354880cfda1797136a1ff886d6642662 (patch)
treec0137dcca82526faa71fd1d980a90c68dac798c8 /tests/layout.rs
parent64f938b449b7ff5e53b6a06ed943bf9dedc1014b (diff)
Bad stack layouter 🚑
Diffstat (limited to 'tests/layout.rs')
-rw-r--r--tests/layout.rs19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/layout.rs b/tests/layout.rs
index 33c12a2b..cca0dee0 100644
--- a/tests/layout.rs
+++ b/tests/layout.rs
@@ -23,10 +23,7 @@ fn main() -> Result<()> {
create_dir_all("tests/cache/pdf")?;
let tests: Vec<_> = read_dir("tests/layouts/")?.collect();
-
- let len = tests.len();
- println!();
- println!("Running {} test{}", len, if len > 1 { "s" } else { "" });
+ let mut filtered = Vec::new();
for entry in tests {
let path = entry?.path();
@@ -36,14 +33,23 @@ fn main() -> Result<()> {
let name = path
.file_stem().ok_or("expected file stem")?
- .to_string_lossy();
+ .to_string_lossy()
+ .to_string();
if opts.matches(&name) {
let src = read_to_string(&path)?;
- panic::catch_unwind(|| test(&name, &src)).ok();
+ filtered.push((name, src));
}
}
+ let len = filtered.len();
+ println!();
+ println!("Running {} test{}", len, if len > 1 { "s" } else { "" });
+
+ for (name, src) in filtered {
+ panic::catch_unwind(|| test(&name, &src)).ok();
+ }
+
println!();
Ok(())
@@ -79,6 +85,7 @@ fn test(name: &str, src: &str) -> Result<()> {
});
}
}
+ drop(loader);
// Write the serialized layout file.
let path = format!("tests/cache/serial/{}", name);