2 . ./wvtest-bup.sh || exit $?
3 . dev/lib.sh || exit $?
7 top="$(WVPASS pwd)" || exit $?
8 tmpdir="$(WVPASS wvmktempdir)" || exit $?
10 export BUP_DIR="$tmpdir/bup"
11 export GIT_DIR="$tmpdir/bup"
13 bup() { "$top/bup" "$@"; }
14 fs-size() { tar cf - "$@" | wc -c; }
20 WVPASS force-delete "$BUP_DIR"
23 WVPASS bup index "$top/Documentation"
24 WVPASS bup save -n compression -0 --strip "$top/Documentation"
25 # Some platforms set -A by default when root, so just use it everywhere.
26 expected="$(WVPASS ls -A "$top/Documentation" | WVPASS sort)" || exit $?
27 actual="$(WVPASS bup ls -A compression/latest/ | WVPASS sort)" || exit $?
28 WVPASSEQ "$actual" "$expected"
29 compression_0_size=$(WVPASS fs-size "$BUP_DIR") || exit $?
32 WVPASS force-delete "$BUP_DIR"
35 WVPASS bup index "$top/Documentation"
36 WVPASS bup save -n compression -9 --strip "$top/Documentation"
37 expected="$(ls -A "$top/Documentation" | sort)" || exit $?
38 actual="$(bup ls -A compression/latest/ | sort)" || exit $?
39 WVPASSEQ "$actual" "$expected"
40 compression_9_size=$(WVPASS fs-size "$BUP_DIR") || exit $?
42 WVPASS [ "$compression_9_size" -lt "$compression_0_size" ]
45 WVPASS rm -rf "$tmpdir"