From 8ec5f2fcdcdd2e2a9297093189ad8c05e1dd7a8f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 7 Dec 2019 12:46:36 +0100 Subject: Skip slow tests by default --- crates/test_utils/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'crates/test_utils') diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index 1244ea8cf..657ddf2a6 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs @@ -356,6 +356,17 @@ pub fn read_text(path: &Path) -> String { .replace("\r\n", "\n") } +pub fn skip_slow_tests() -> bool { + let should_skip = std::env::var("CI").is_err() && std::env::var("RUN_SLOW_TESTS").is_err(); + if should_skip { + eprintln!("ignoring slow test") + } else { + let path = project_dir().join("./target/.slow_tests_cookie"); + fs::write(&path, ".").unwrap(); + } + should_skip +} + const REWRITE: bool = false; fn assert_equal_text(expected: &str, actual: &str, path: &Path) { -- cgit v1.2.3