# Job 1: Linux native GCC
- os: linux
compiler: gcc
- env: V=1
+ env: V=1 ENABLE_CACHE_CLEANUP_TESTS=1
addons:
apt:
packages:
# Job 2: Linux native Clang
- os: linux
compiler: clang
- env: V=1
+ env: V=1 ENABLE_CACHE_CLEANUP_TESTS=1
addons:
apt:
packages:
# Job 3: Mac OS X native Clang
- os: osx
compiler: clang
- env: V=1 CONFIGURE="--with-libzstd-from-internet"
+ env: V=1 CONFIGURE="--with-libzstd-from-internet" ENABLE_CACHE_CLEANUP_TESTS=1
# Job 4: Linux 32-bit native
- os: linux
compiler: gcc
- env: V=1 CFLAGS="-m32 -g -O2" LDFLAGS="-m32" CONFIGURE="--host=i386-linux-gnu --with-libzstd-from-internet"
+ env: V=1 CFLAGS="-m32 -g -O2" LDFLAGS="-m32" CONFIGURE="--host=i386-linux-gnu --with-libzstd-from-internet" ENABLE_CACHE_CLEANUP_TESTS=1
addons:
apt:
packages:
# Job 5: Linux cross-compiled 32-bit MinGW
- os: linux
compiler: i686-w64-mingw32-gcc
- env: V=1 CONFIGURE="--host=i686-w64-mingw32 --with-libzstd-from-internet" TEST="unittest/run.exe"
+ env: V=1 CONFIGURE="--host=i686-w64-mingw32 --with-libzstd-from-internet" TEST="unittest/run.exe" ENABLE_CACHE_CLEANUP_TESTS=1
addons:
apt:
packages:
# Job 6: Linux cross-compiled 64-bit MinGW
- os: linux
compiler: x86_64-w64-mingw32-gcc
- env: V=1 CONFIGURE="--host=x86_64-w64-mingw32 --with-libzstd-from-internet" TEST="unittest/run.exe"
+ env: V=1 CONFIGURE="--host=x86_64-w64-mingw32 --with-libzstd-from-internet" TEST="unittest/run.exe" ENABLE_CACHE_CLEANUP_TESTS=1
addons:
apt:
packages:
# Job 7: Clang's undefined behavior sanitizer (UBSan)
- os: linux
compiler: clang
- env: V=1 CFLAGS="-fsanitize=undefined" LDFLAGS="-fsanitize=undefined" ASAN_OPTIONS="detect_leaks=0"
+ env: V=1 CFLAGS="-fsanitize=undefined" LDFLAGS="-fsanitize=undefined" ASAN_OPTIONS="detect_leaks=0" ENABLE_CACHE_CLEANUP_TESTS=1
addons:
apt:
packages:
# Job 8: Clang's address sanitizer
- os: linux
compiler: clang
- env: V=1 CFLAGS="-fsanitize=address -g" LDFLAGS="-fsanitize=address" ASAN_OPTIONS="detect_leaks=0"
+ env: V=1 CFLAGS="-fsanitize=address -g" LDFLAGS="-fsanitize=address" ASAN_OPTIONS="detect_leaks=0" ENABLE_CACHE_CLEANUP_TESTS=1
addons:
apt:
packages:
# Job 9: Clang static analyzer
- os: linux
compiler: clang
- env: V=1 PATH="/usr/bin:$PATH" TEST=analyze
+ env: V=1 PATH="/usr/bin:$PATH" TEST=analyze ENABLE_CACHE_CLEANUP_TESTS=1
addons:
apt:
packages:
# Job 10: Linux GCC with CUDA compiler
- os: linux
compiler: gcc
- env: V=1 CUDA=8.0.61-1
+ env: V=1 CUDA=8.0.61-1 ENABLE_CACHE_CLEANUP_TESTS=1
sudo: required
addons:
apt:
#ifdef _WIN32
return (st->st_size + 1023) & ~1023;
#else
- size_t size = st->st_blocks * 512;
- if ((size_t)st->st_size > size) {
- // Probably a broken stat() call...
- size = (st->st_size + 1023) & ~1023;
- }
- return size;
+ return st->st_blocks * 512;
#endif
}
done
# -------------------------------------------------------------------------
- TEST "Forced cache cleanup, size limit"
-
- # NOTE: This test is known to fail on filesystems that have unusual block
- # sizes, including ecryptfs. The workaround is to place the test directory
- # elsewhere:
- #
- # cd /tmp
- # CCACHE=$DIR/ccache $DIR/test.sh
-
- prepare_cleanup_test_dir $CCACHE_DIR/a
-
- $CCACHE -F 0 -M 256K >/dev/null
- $CCACHE -c >/dev/null
- expect_file_count 3 '*.result' $CCACHE_DIR
- expect_stat 'files in cache' 3
- expect_stat 'cleanups performed' 1
- for i in 0 1 2 3 4 5 6; do
- file=$CCACHE_DIR/a/result$i-4017.result
- expect_file_missing $file
- done
- for i in 7 8 9; do
- file=$CCACHE_DIR/a/result$i-4017.result
- expect_file_exists $file
- done
-
+ if [ -n "$ENABLE_CACHE_CLEANUP_TESTS" ]; then
+ TEST "Forced cache cleanup, size limit"
+
+ # NOTE: This test is known to fail on filesystems that have unusual block
+ # sizes, including ecryptfs. The workaround is to place the test directory
+ # elsewhere:
+ #
+ # cd /tmp
+ # CCACHE=$DIR/ccache $DIR/test.sh
+
+ prepare_cleanup_test_dir $CCACHE_DIR/a
+
+ $CCACHE -F 0 -M 256K >/dev/null
+ $CCACHE -c >/dev/null
+ expect_file_count 3 '*.result' $CCACHE_DIR
+ expect_stat 'files in cache' 3
+ expect_stat 'cleanups performed' 1
+ for i in 0 1 2 3 4 5 6; do
+ file=$CCACHE_DIR/a/result$i-4017.result
+ expect_file_missing $file
+ done
+ for i in 7 8 9; do
+ file=$CCACHE_DIR/a/result$i-4017.result
+ expect_file_exists $file
+ done
+ fi
# -------------------------------------------------------------------------
TEST "Automatic cache cleanup, limit_multiple 0.9"