From: Zoran Zaric Date: Tue, 10 May 2011 00:59:53 +0000 (+0200) Subject: Add test case for compression level X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3b898256c6417e3fe13fdaaec674a24fe5a170cb;p=packages%2Fb%2Fbup.git Add test case for compression level A save run with 0 and 9 are made and the size of the resuling repos is compared. Signed-off-by: Zoran Zaric --- diff --git a/t/test.sh b/t/test.sh index 6f1b50e..b553167 100755 --- a/t/test.sh +++ b/t/test.sh @@ -436,3 +436,27 @@ WVPASS true WVPASS bup import-rsnapshot $D/ WVPASSEQ "$(bup ls buptest/latest/)" "a/ c/" + + +WVSTART "compression" +D=compression0.tmp +export BUP_DIR="$TOP/$D/.bup" +rm -rf $D +mkdir $D +WVPASS bup init +WVPASS bup index $TOP/Documentation +WVPASS bup save -n compression -0 --strip $TOP/Documentation +WVPASSEQ "$(bup ls compression/latest/ | sort)" "$(ls $TOP/Documentation | sort)" +COMPRESSION_0_SIZE=$(du -s $D | cut -f1) + +D=compression9.tmp +export BUP_DIR="$TOP/$D/.bup" +rm -rf $D +mkdir $D +WVPASS bup init +WVPASS bup index $TOP/Documentation +WVPASS bup save -n compression -9 --strip $TOP/Documentation +WVPASSEQ "$(bup ls compression/latest/ | sort)" "$(ls $TOP/Documentation | sort)" +COMPRESSION_9_SIZE=$(du -s $D | cut -f1) + +WVPASS [ "$COMPRESSION_9_SIZE" -lt "$COMPRESSION_0_SIZE" ]