summaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-09-25 10:26:41 +0200
committerGitHub <noreply@github.com>2024-09-25 08:26:41 +0000
commite25389a85e2c4bb7bab5f5d68ab148395704960d (patch)
tree1323af9efce63f9a8f412312ebe87e45bb87a60a /tests/src
parentfd449f3e08df716d94d79f3f46ff3960e9933d0c (diff)
New flow layout, with multi-column floats (#5017)
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/collect.rs13
-rw-r--r--tests/src/tests.rs3
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/src/collect.rs b/tests/src/collect.rs
index 4dae0b70..cc3ff736 100644
--- a/tests/src/collect.rs
+++ b/tests/src/collect.rs
@@ -5,6 +5,7 @@ use std::path::{Path, PathBuf};
use std::str::FromStr;
use ecow::{eco_format, EcoString};
+use once_cell::sync::Lazy;
use typst::syntax::package::PackageVersion;
use typst::syntax::{is_id_continue, is_ident, is_newline, FileId, Source, VirtualPath};
use unscanny::Scanner;
@@ -389,6 +390,18 @@ impl<'a> Parser<'a> {
/// Whether a test is within the selected set to run.
fn selected(name: &str, abs: PathBuf) -> bool {
+ static SKIPPED: Lazy<HashSet<&'static str>> = Lazy::new(|| {
+ String::leak(std::fs::read_to_string(crate::SKIP_PATH).unwrap())
+ .lines()
+ .map(|line| line.trim())
+ .filter(|line| !line.is_empty() && !line.starts_with("//"))
+ .collect()
+ });
+
+ if SKIPPED.contains(name) {
+ return false;
+ }
+
let paths = &crate::ARGS.path;
if !paths.is_empty() && !paths.iter().any(|path| abs.starts_with(path)) {
return false;
diff --git a/tests/src/tests.rs b/tests/src/tests.rs
index a2d85fec..58bd7cf7 100644
--- a/tests/src/tests.rs
+++ b/tests/src/tests.rs
@@ -30,6 +30,9 @@ const STORE_PATH: &str = "tests/store";
/// The directory where the reference images are stored.
const REF_PATH: &str = "tests/ref";
+/// The file where the skipped tests are stored.
+const SKIP_PATH: &str = "tests/skip.txt";
+
/// The maximum size of reference images that aren't marked as `// LARGE`.
const REF_LIMIT: usize = 20 * 1024;