aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-07 12:46:02 +0000
committerGitHub <[email protected]>2019-12-07 12:46:02 +0000
commit6bd9fb85255581cab7888965b464e462582bbb5f (patch)
tree980c78e286c207bf9d056ffecbab62468f83aa2d /crates/test_utils
parent7aac5f2b427247120025f63c4864a1b937ed20c7 (diff)
parent8ec5f2fcdcdd2e2a9297093189ad8c05e1dd7a8f (diff)
Merge pull request #2491 from matklad/skip-heavy-tests-by-default
Skip slow tests by default
Diffstat (limited to 'crates/test_utils')
-rw-r--r--crates/test_utils/src/lib.rs11
1 files changed, 11 insertions, 0 deletions
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 {
356 .replace("\r\n", "\n") 356 .replace("\r\n", "\n")
357} 357}
358 358
359pub fn skip_slow_tests() -> bool {
360 let should_skip = std::env::var("CI").is_err() && std::env::var("RUN_SLOW_TESTS").is_err();
361 if should_skip {
362 eprintln!("ignoring slow test")
363 } else {
364 let path = project_dir().join("./target/.slow_tests_cookie");
365 fs::write(&path, ".").unwrap();
366 }
367 should_skip
368}
369
359const REWRITE: bool = false; 370const REWRITE: bool = false;
360 371
361fn assert_equal_text(expected: &str, actual: &str, path: &Path) { 372fn assert_equal_text(expected: &str, actual: &str, path: &Path) {