summaryrefslogtreecommitdiff
path: root/test/suites/cleanup.bash
diff options
context:
space:
mode:
Diffstat (limited to 'test/suites/cleanup.bash')
-rw-r--r--test/suites/cleanup.bash179
1 files changed, 0 insertions, 179 deletions
diff --git a/test/suites/cleanup.bash b/test/suites/cleanup.bash
index 37710c13..cc3ca42e 100644
--- a/test/suites/cleanup.bash
+++ b/test/suites/cleanup.bash
@@ -3,23 +3,12 @@ prepare_cleanup_test_dir() {
rm -rf $dir
mkdir -p $dir
- if $AGGREGATED; then
for i in $(seq 0 9); do
printf '%4017s' '' | tr ' ' 'A' >$dir/result$i-4017.result
backdate $((3 * i + 1)) $dir/result$i-4017.result
done
# NUMFILES: 10, TOTALSIZE: 13 KiB, MAXFILES: 0, MAXSIZE: 0
echo "0 0 0 0 0 0 0 0 0 0 0 10 13 0 0" >$dir/stats
- else
- for i in $(seq 0 9); do
- printf '%4017s' '' | tr ' ' 'A' >$dir/result$i-4017.o
- backdate $((3 * i + 1)) $dir/result$i-4017.o
- backdate $((3 * i + 2)) $dir/result$i-4017.d
- backdate $((3 * i + 3)) $dir/result$i-4017.stderr
- done
- # NUMFILES: 30, TOTALSIZE: 40 KiB, MAXFILES: 0, MAXSIZE: 0
- echo "0 0 0 0 0 0 0 0 0 0 0 30 40 0 0" >$dir/stats
- fi
}
SUITE_cleanup() {
@@ -29,15 +18,8 @@ SUITE_cleanup() {
prepare_cleanup_test_dir $CCACHE_DIR/a
$CCACHE -C >/dev/null
- if $AGGREGATED; then
expect_file_count 0 '*.result' $CCACHE_DIR
expect_stat 'files in cache' 0
- else
- expect_file_count 0 '*.o' $CCACHE_DIR
- expect_file_count 0 '*.d' $CCACHE_DIR
- expect_file_count 0 '*.stderr' $CCACHE_DIR
- expect_stat 'files in cache' 0
- fi
expect_stat 'cleanups performed' 1
# -------------------------------------------------------------------------
@@ -47,15 +29,8 @@ SUITE_cleanup() {
$CCACHE -F 0 -M 0 >/dev/null
$CCACHE -c >/dev/null
- if $AGGREGATED; then
expect_file_count 10 '*.result' $CCACHE_DIR
expect_stat 'files in cache' 10
- else
- expect_file_count 10 '*.o' $CCACHE_DIR
- expect_file_count 10 '*.d' $CCACHE_DIR
- expect_file_count 10 '*.stderr' $CCACHE_DIR
- expect_stat 'files in cache' 30
- fi
expect_stat 'cleanups performed' 0
# -------------------------------------------------------------------------
@@ -65,46 +40,21 @@ SUITE_cleanup() {
# No cleanup needed.
#
- if $AGGREGATED; then
# 10 * 16 = 160
$CCACHE -F 160 -M 0 >/dev/null
- else
- # 30 * 16 = 480
- $CCACHE -F 480 -M 0 >/dev/null
- fi
$CCACHE -c >/dev/null
- if $AGGREGATED; then
expect_file_count 10 '*.result' $CCACHE_DIR
expect_stat 'files in cache' 10
- else
- expect_file_count 10 '*.o' $CCACHE_DIR
- expect_file_count 10 '*.d' $CCACHE_DIR
- expect_file_count 10 '*.stderr' $CCACHE_DIR
- expect_stat 'files in cache' 30
- fi
expect_stat 'cleanups performed' 0
# Reduce file limit
#
- if $AGGREGATED; then
# 7 * 16 = 112
$CCACHE -F 112 -M 0 >/dev/null
- else
- # 22 * 16 = 352
- $CCACHE -F 352 -M 0 >/dev/null
- fi
$CCACHE -c >/dev/null
- if $AGGREGATED; then
expect_file_count 7 '*.result' $CCACHE_DIR
expect_stat 'files in cache' 7
- else
- expect_file_count 7 '*.o' $CCACHE_DIR
- expect_file_count 7 '*.d' $CCACHE_DIR
- expect_file_count 8 '*.stderr' $CCACHE_DIR
- expect_stat 'files in cache' 22
- fi
expect_stat 'cleanups performed' 1
- if $AGGREGATED; then
for i in 0 1 2; do
file=$CCACHE_DIR/a/result$i-4017.result
expect_file_missing $CCACHE_DIR/a/result$i-4017.result
@@ -113,17 +63,6 @@ SUITE_cleanup() {
file=$CCACHE_DIR/a/result$i-4017.result
expect_file_exists $file
done
- else
-
- for i in 0 1 2; do
- file=$CCACHE_DIR/a/result$i-4017.o
- expect_file_missing $CCACHE_DIR/a/result$i-4017.o
- done
- for i in 3 4 5 6 7 8 9; do
- file=$CCACHE_DIR/a/result$i-4017.o
- expect_file_exists $file
- done
- fi
# -------------------------------------------------------------------------
TEST "Forced cache cleanup, size limit"
@@ -139,17 +78,9 @@ SUITE_cleanup() {
$CCACHE -F 0 -M 256K >/dev/null
$CCACHE -c >/dev/null
- if $AGGREGATED; then
expect_file_count 3 '*.result' $CCACHE_DIR
expect_stat 'files in cache' 3
- else
- expect_file_count 3 '*.o' $CCACHE_DIR
- expect_file_count 4 '*.d' $CCACHE_DIR
- expect_file_count 4 '*.stderr' $CCACHE_DIR
- expect_stat 'files in cache' 11
- fi
expect_stat 'cleanups performed' 1
- if $AGGREGATED; then
for i in 0 1 2 3 4 5 6; do
file=$CCACHE_DIR/a/result$i-4017.result
expect_file_missing $file
@@ -158,16 +89,6 @@ SUITE_cleanup() {
file=$CCACHE_DIR/a/result$i-4017.result
expect_file_exists $file
done
- else
- for i in 0 1 2 3 4 5 6; do
- file=$CCACHE_DIR/a/result$i-4017.o
- expect_file_missing $file
- done
- for i in 7 8 9; do
- file=$CCACHE_DIR/a/result$i-4017.o
- expect_file_exists $file
- done
- fi
# -------------------------------------------------------------------------
TEST "Automatic cache cleanup, limit_multiple 0.9"
@@ -176,34 +97,16 @@ SUITE_cleanup() {
prepare_cleanup_test_dir $CCACHE_DIR/$x
done
- if $AGGREGATED; then
$CCACHE -F 160 -M 0 >/dev/null
- else
- $CCACHE -F 480 -M 0 >/dev/null
- fi
- if $AGGREGATED; then
expect_file_count 160 '*.result' $CCACHE_DIR
expect_stat 'files in cache' 160
- else
- expect_file_count 160 '*.o' $CCACHE_DIR
- expect_file_count 160 '*.d' $CCACHE_DIR
- expect_file_count 160 '*.stderr' $CCACHE_DIR
- expect_stat 'files in cache' 480
- fi
expect_stat 'cleanups performed' 0
touch empty.c
CCACHE_LIMIT_MULTIPLE=0.9 $CCACHE_COMPILE -c empty.c -o empty.o
- if $AGGREGATED; then
expect_file_count 159 '*.result' $CCACHE_DIR
expect_stat 'files in cache' 159
- else
- expect_file_count 159 '*.o' $CCACHE_DIR
- expect_file_count 159 '*.d' $CCACHE_DIR
- expect_file_count 159 '*.stderr' $CCACHE_DIR
- expect_stat 'files in cache' 477
- fi
expect_stat 'cleanups performed' 1
# -------------------------------------------------------------------------
@@ -213,123 +116,45 @@ SUITE_cleanup() {
prepare_cleanup_test_dir $CCACHE_DIR/$x
done
- if $AGGREGATED; then
$CCACHE -F 160 -M 0 >/dev/null
- else
- $CCACHE -F 480 -M 0 >/dev/null
- fi
- if $AGGREGATED; then
expect_file_count 160 '*.result' $CCACHE_DIR
expect_stat 'files in cache' 160
- else
- expect_file_count 160 '*.o' $CCACHE_DIR
- expect_file_count 160 '*.d' $CCACHE_DIR
- expect_file_count 160 '*.stderr' $CCACHE_DIR
- expect_stat 'files in cache' 480
- fi
expect_stat 'cleanups performed' 0
touch empty.c
CCACHE_LIMIT_MULTIPLE=0.7 $CCACHE_COMPILE -c empty.c -o empty.o
- if $AGGREGATED; then
expect_file_count 157 '*.result' $CCACHE_DIR
expect_stat 'files in cache' 157
- else
- expect_file_count 157 '*.o' $CCACHE_DIR
- expect_file_count 157 '*.d' $CCACHE_DIR
- expect_file_count 157 '*.stderr' $CCACHE_DIR
- expect_stat 'files in cache' 471
- fi
expect_stat 'cleanups performed' 1
# -------------------------------------------------------------------------
- if ! $AGGREGATED; then
- TEST ".o file is removed before .stderr"
-
- prepare_cleanup_test_dir $CCACHE_DIR/a
- $CCACHE -F 464 -M 0 >/dev/null
- backdate 0 $CCACHE_DIR/a/result9-4017.stderr
- $CCACHE -c >/dev/null
- expect_file_missing $CCACHE_DIR/a/result9-4017.stderr
- expect_file_missing $CCACHE_DIR/a/result9-4017.o
-
- # Counters expectedly doesn't match reality if x.stderr is found before
- # x.o and the cleanup stops before x.o is found.
- expect_stat 'files in cache' 29
- expect_file_count 28 '*.*' $CCACHE_DIR/a
- fi
-
- # -------------------------------------------------------------------------
- if ! $AGGREGATED; then
- TEST ".stderr file is not removed before .o"
-
- prepare_cleanup_test_dir $CCACHE_DIR/a
- $CCACHE -F 464 -M 0 >/dev/null
- backdate 0 $CCACHE_DIR/a/result9-4017.o
- $CCACHE -c >/dev/null
- expect_file_exists $CCACHE_DIR/a/result9-4017.stderr
- expect_file_missing $CCACHE_DIR/a/result9-4017.o
-
- expect_stat 'files in cache' 29
- expect_file_count 29 '*.*' $CCACHE_DIR/a
- fi
-
- # -------------------------------------------------------------------------
TEST "No cleanup of new unknown file"
prepare_cleanup_test_dir $CCACHE_DIR/a
touch $CCACHE_DIR/a/abcd.unknown
$CCACHE -F 0 -M 0 -c >/dev/null # update counters
- if $AGGREGATED; then
expect_stat 'files in cache' 11
- else
- expect_stat 'files in cache' 31
- fi
- if $AGGREGATED; then
$CCACHE -F 160 -M 0 >/dev/null
- else
- $CCACHE -F 480 -M 0 >/dev/null
- fi
$CCACHE -c >/dev/null
expect_file_exists $CCACHE_DIR/a/abcd.unknown
- if $AGGREGATED; then
expect_stat 'files in cache' 10
- else
- expect_stat 'files in cache' 30
- fi
# -------------------------------------------------------------------------
TEST "Cleanup of old unknown file"
prepare_cleanup_test_dir $CCACHE_DIR/a
- if $AGGREGATED; then
$CCACHE -F 160 -M 0 >/dev/null
- else
- $CCACHE -F 480 -M 0 >/dev/null
- fi
touch $CCACHE_DIR/a/abcd.unknown
backdate $CCACHE_DIR/a/abcd.unknown
$CCACHE -F 0 -M 0 -c >/dev/null # update counters
- if $AGGREGATED; then
expect_stat 'files in cache' 11
- else
- expect_stat 'files in cache' 31
- fi
- if $AGGREGATED; then
$CCACHE -F 160 -M 0 -c >/dev/null
- else
- $CCACHE -F 480 -M 0 -c >/dev/null
- fi
expect_file_missing $CCACHE_DIR/a/abcd.unknown
- if $AGGREGATED; then
expect_stat 'files in cache' 10
- else
- expect_stat 'files in cache' 30
- fi
# -------------------------------------------------------------------------
TEST "Cleanup of tmp file"
@@ -352,9 +177,5 @@ SUITE_cleanup() {
$CCACHE -F 0 -M 0 >/dev/null
$CCACHE -c >/dev/null
expect_file_count 1 '.nfs*' $CCACHE_DIR
- if $AGGREGATED; then
expect_stat 'files in cache' 10
- else
- expect_stat 'files in cache' 30
- fi
}