]> arthur.barton.de Git - bup.git/commitdiff
Add test case for compression level
authorZoran Zaric <zz@zoranzaric.de>
Tue, 10 May 2011 00:59:53 +0000 (02:59 +0200)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 15 May 2011 19:39:01 +0000 (15:39 -0400)
A save run with 0 and 9 are made and the size of the resuling repos is
compared.

Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
t/test.sh

index 6f1b50e3f39e1d19c3ce849bbfd743e42e682b87..b553167977280b7b918eedd5d5d59bc6a0b6b9ab 100755 (executable)
--- 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" ]