From 456e52189c95315028d668f9e508798d490765e2 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Wed, 20 Dec 2017 16:13:31 +0000 Subject: tests: add GITTEST_SLOW env var check Writing very large files may be slow, particularly on inefficient filesystems and when running instrumented code to detect invalid memory accesses (eg within valgrind or similar tools). Introduce `GITTEST_SLOW` so that tests that are slow can be skipped by the CI system. --- tests/odb/largefiles.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/odb/largefiles.c b/tests/odb/largefiles.c index dc987c473..22f136df5 100644 --- a/tests/odb/largefiles.c +++ b/tests/odb/largefiles.c @@ -45,10 +45,9 @@ void test_odb_largefiles__write_from_memory(void) cl_skip(); #endif - if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE")) - cl_skip(); - - if (!cl_is_env_set("GITTEST_INVASIVE_MEMORY")) + if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE") || + !cl_is_env_set("GITTEST_INVASIVE_MEMORY") || + !cl_is_env_set("GITTEST_SLOW")) cl_skip(); for (i = 0; i < (3041*126103); i++) @@ -64,7 +63,8 @@ void test_odb_largefiles__streamwrite(void) { git_oid expected, oid; - if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE")) + if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE") || + !cl_is_env_set("GITTEST_SLOW")) cl_skip(); git_oid_fromstr(&expected, "3fb56989cca483b21ba7cb0a6edb229d10e1c26c"); @@ -82,10 +82,9 @@ void test_odb_largefiles__read_into_memory(void) cl_skip(); #endif - if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE")) - cl_skip(); - - if (!cl_is_env_set("GITTEST_INVASIVE_MEMORY")) + if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE") || + !cl_is_env_set("GITTEST_INVASIVE_MEMORY") || + !cl_is_env_set("GITTEST_SLOW")) cl_skip(); writefile(&oid); @@ -103,10 +102,9 @@ void test_odb_largefiles__read_into_memory_rejected_on_32bit(void) cl_skip(); #endif - if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE")) - cl_skip(); - - if (!cl_is_env_set("GITTEST_INVASIVE_MEMORY")) + if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE") || + !cl_is_env_set("GITTEST_INVASIVE_MEMORY") || + !cl_is_env_set("GITTEST_SLOW")) cl_skip(); writefile(&oid); -- cgit v1.2.1