From: Martin Matuska Date: Sun, 7 Apr 2019 07:50:20 +0000 (+0200) Subject: CI: allow to skip sparse and fuzz tests X-Git-Tag: v3.4.0~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=586ef094ef1cb8ef97169c5e94fb19b65cb0827e;p=thirdparty%2Flibarchive.git CI: allow to skip sparse and fuzz tests Sparse tests don't work in a Windows container --- diff --git a/.cirrus.yml b/.cirrus.yml index acf4c8a28..bfb20d6e3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -75,4 +75,5 @@ Windows_MinGW_task: - refreshenv - copy build_ci\libs\zlib-1.2.11\libzlib.dll build_ci\mingw\bin\ - cd build_ci\mingw + - set SKIP_TEST_SPARSE=1 - mingw32-make test diff --git a/build/ci/travis_ci.sh b/build/ci/travis_ci.sh index abbdd8d38..8ed0543df 100755 --- a/build/ci/travis_ci.sh +++ b/build/ci/travis_ci.sh @@ -15,13 +15,15 @@ case "$UNAME" in cmake -G "Visual Studio 15 2017" -D CMAKE_BUILD_TYPE="Release" "${SRCDIR}" cmake --build . --target ALL_BUILD # Until fixed, we don't run tests on Windows (lots of fails + timeout) + #export SKIP_TEST_FUZZ=1 #cmake --build . --target RUN_TESTS set +x elif [ "${BS}" = "mingw" ]; then set -x cmake -G "MSYS Makefiles" -D CMAKE_C_COMPILER="${CC}" -D CMAKE_MAKE_PROGRAM="mingw32-make" -D CMAKE_BUILD_TYPE="Release" "${SRCDIR}" mingw32-make - mingw32-make test + #export SKIP_TEST_FUZZ=1 + #mingw32-make test set +x else echo "Unknown or unspecified build type: ${BS}" diff --git a/libarchive/test/test_fuzz.c b/libarchive/test/test_fuzz.c index 2025834ca..d02fd993f 100644 --- a/libarchive/test/test_fuzz.c +++ b/libarchive/test/test_fuzz.c @@ -58,6 +58,14 @@ test_fuzz(const struct files *filesets) size_t blk_size; int64_t blk_offset; int n; + const char *skip_fuzz_tests; + + skip_fuzz_tests = getenv("SKIP_TEST_FUZZ"); + if (skip_fuzz_tests != NULL) { + skipping("Skipping fuzz tests due to SKIP_TEST_FUZZ " + "environment variable"); + return; + } for (n = 0; filesets[n].names != NULL; ++n) { const size_t buffsize = 30000000; diff --git a/libarchive/test/test_sparse_basic.c b/libarchive/test/test_sparse_basic.c index 0df0f1d32..c677893ad 100644 --- a/libarchive/test/test_sparse_basic.c +++ b/libarchive/test/test_sparse_basic.c @@ -491,6 +491,7 @@ DEFINE_TEST(test_sparse_basic) { char *cwd; struct archive *a; + const char *skip_sparse_tests; /* * The alignment of the hole of sparse files deeply depends * on filesystem. In my experience, sparse_file2 test with @@ -553,6 +554,13 @@ DEFINE_TEST(test_sparse_basic) */ test_sparse_whole_file_data(); + skip_sparse_tests = getenv("SKIP_TEST_SPARSE"); + if (skip_sparse_tests != NULL) { + skipping("Skipping sparse tests due to SKIP_TEST_SPARSE " + "environment variable"); + return; + } + /* Check if the filesystem where CWD on can * report the number of the holes of a sparse file. */ #ifdef PATH_MAX @@ -599,10 +607,19 @@ DEFINE_TEST(test_fully_sparse_files) { char *cwd; struct archive *a; + const char *skip_sparse_tests; const struct sparse sparse_file[] = { { HOLE, 409600 }, { END, 0 } }; + + skip_sparse_tests = getenv("SKIP_TEST_SPARSE"); + if (skip_sparse_tests != NULL) { + skipping("Skipping sparse tests due to SKIP_TEST_SPARSE " + "environment variable"); + return; + } + /* Check if the filesystem where CWD on can * report the number of the holes of a sparse file. */ #ifdef PATH_MAX