]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
CI: allow to skip sparse and fuzz tests
authorMartin Matuska <martin@matuska.org>
Sun, 7 Apr 2019 07:50:20 +0000 (09:50 +0200)
committerMartin Matuska <martin@matuska.org>
Sun, 7 Apr 2019 08:30:57 +0000 (10:30 +0200)
Sparse tests don't work in a Windows container

.cirrus.yml
build/ci/travis_ci.sh
libarchive/test/test_fuzz.c
libarchive/test/test_sparse_basic.c

index acf4c8a28f1dbae30d68357469bd3f5d62b0f1a6..bfb20d6e3c82203e6b92ae8e5ea32e026b0be7be 100644 (file)
@@ -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
index abbdd8d3849fd39bd3acc37b41a28336366b51aa..8ed0543dfdf96c853894690d0b4bcb0df3743484 100755 (executable)
@@ -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}"
index 2025834ca424147da7dae2818a2feda69a5d34a9..d02fd993f97281159f7a521279b42f4957eac507 100644 (file)
@@ -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;
index 0df0f1d321ac1bca047ff82ac335989a825f457c..c677893adf76961b76e3a44c567d65818bd8b120 100644 (file)
@@ -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