]> arthur.barton.de Git - bup.git/blobdiff - t/test-compression.sh
vfs: limit root_items branches to refs/heads
[bup.git] / t / test-compression.sh
index 9e3c02d1fc15c76efea8f48e9a7eeefa039db632..b887f0691afb6865bc7cfcf0c5852fc213360ef5 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
-. ./wvtest-bup.sh
-. t/lib.sh
+. ./wvtest-bup.sh || exit $?
+. t/lib.sh || exit $?
 
 set -o pipefail
 
@@ -11,6 +11,7 @@ export BUP_DIR="$tmpdir/bup"
 export GIT_DIR="$tmpdir/bup"
 
 bup() { "$top/bup" "$@"; }
+fs-size() { tar cf - "$@" | wc -c; }
 
 WVSTART "compression"
 WVPASS cd "$tmpdir"
@@ -25,7 +26,7 @@ WVPASS bup save -n compression -0 --strip "$top/Documentation"
 expected="$(WVPASS ls -A "$top/Documentation" | WVPASS sort)" || exit $?
 actual="$(WVPASS bup ls -A compression/latest/ | WVPASS sort)" || exit $?
 WVPASSEQ "$actual" "$expected"
-compression_0_size=$(WVPASS du -k -s "$BUP_DIR" | WVPASS cut -f1) || exit $?
+compression_0_size=$(WVPASS fs-size "$BUP_DIR") || exit $?
 
 D=compression9.tmp
 WVPASS force-delete "$BUP_DIR"
@@ -36,7 +37,7 @@ WVPASS bup save -n compression -9 --strip "$top/Documentation"
 expected="$(ls -A "$top/Documentation" | sort)" || exit $?
 actual="$(bup ls -A compression/latest/ | sort)" || exit $?
 WVPASSEQ "$actual" "$expected"
-compression_9_size=$(WVPASS du -k -s "$BUP_DIR" | WVPASS cut -f1) || exit $?
+compression_9_size=$(WVPASS fs-size "$BUP_DIR") || exit $?
 
 WVPASS [ "$compression_9_size" -lt "$compression_0_size" ]