]> arthur.barton.de Git - bup.git/commitdiff
Use t/sampledata, not make install, for tests
authorRob Browning <rlb@defaultvalue.org>
Sat, 21 Mar 2015 22:17:12 +0000 (17:17 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 28 Mar 2015 15:37:22 +0000 (10:37 -0500)
This should be more efficient, and is intended fix the problems people
have experienced with the recursive "make install" invocations that some
tests were using to produce input data.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
t/configure-sampledata
t/test-fsck.sh
t/test-import-duplicity.sh
t/test-meta.sh

index c95d936fc38251794de4489982fc945fb1ebfb1f..256d0bf438cd6304b7575caaf6b5d2be148f14de 100755 (executable)
@@ -5,7 +5,7 @@ set -o pipefail
 # NOTE: any relevant changes to var/ must be accompanied by an
 # increment to the revision.
 
 # NOTE: any relevant changes to var/ must be accompanied by an
 # increment to the revision.
 
-revision=0
+revision=1
 readonly revision
 
 top="$(pwd)" || exit $?
 readonly revision
 
 top="$(pwd)" || exit $?
@@ -41,6 +41,10 @@ case "$1" in
             ln -sf a b || exit $?
             ln -sf b c || exit $?
             ln -sf "$(pwd)/abs-symlink-target" abs-symlink || exit $?
             ln -sf a b || exit $?
             ln -sf b c || exit $?
             ln -sf "$(pwd)/abs-symlink-target" abs-symlink || exit $?
+            mkdir -p cmd doc lib/bup || exit $?
+            cp -a "$top"/cmd/*.py cmd/ || exit $?
+            cp -a "$top"/Documentation/*.md doc/ || exit $?
+            cp -a "$top"/lib/bup/*.py lib/bup || exit $?
             # The "v" ensures that if "configure-sampledata
             # --revision" and/or the setup above fails somehow,
             # callers like make will be looking for a file that won't
             # The "v" ensures that if "configure-sampledata
             # --revision" and/or the setup above fails somehow,
             # callers like make will be looking for a file that won't
index 27f103afc9ad9572571c0b2028fd94b05697cee0..22d909cfa9caed994209e699e62f8a0dc651c660 100755 (executable)
@@ -8,8 +8,7 @@ tmpdir="$(WVPASS wvmktempdir)" || exit $?
 
 bup() { "$top/bup" "$@"; }
 
 
 bup() { "$top/bup" "$@"; }
 
-WVPASS make install DESTDIR="$tmpdir/src"
-WVPASS cp -a "$top/t/sampledata" "$tmpdir/src/"
+WVPASS cp -a "$top/t/sampledata" "$tmpdir/src"
 
 export BUP_DIR="$tmpdir/bup"
 export GIT_DIR="$tmpdir/bup"
 
 export BUP_DIR="$tmpdir/bup"
 export GIT_DIR="$tmpdir/bup"
@@ -20,10 +19,11 @@ WVPASS cd "$tmpdir"
 WVSTART "fsck"
 
 WVPASS bup index src
 WVSTART "fsck"
 
 WVPASS bup index src
-WVPASS bup save -n fsck-test src/sampledata
-WVPASS bup save -n fsck-test src/usr/bin
-WVPASS bup save -n fsck-test src/usr/lib
-WVPASS bup save -n fsck-test src/usr/share
+WVPASS bup save -n fsck-test src/b2
+WVPASS bup save -n fsck-test src/var/cmd
+WVPASS bup save -n fsck-test src/var/doc
+WVPASS bup save -n fsck-test src/var/lib
+WVPASS bup save -n fsck-test src/y
 WVPASS bup fsck
 WVPASS bup fsck --quick
 if bup fsck --par2-ok; then
 WVPASS bup fsck
 WVPASS bup fsck --quick
 if bup fsck --par2-ok; then
index 8931c084ca64733ce7299452a4857d4fbc3e767e..61fb2fff4d0a48b3d357a6823560e475f7b11b23 100755 (executable)
@@ -16,7 +16,7 @@ bup() { "$top/bup" "$@"; }
 dup() { duplicity --archive-dir "$tmpdir/dup-cache" "$@"; }
 
 WVSTART "import-duplicity"
 dup() { duplicity --archive-dir "$tmpdir/dup-cache" "$@"; }
 
 WVSTART "import-duplicity"
-WVPASS make install DESTDIR="$tmpdir/src"
+WVPASS cp -a "$top/t/sampledata" "$tmpdir/src"
 
 export BUP_DIR="$tmpdir/bup"
 export GIT_DIR="$tmpdir/bup"
 
 export BUP_DIR="$tmpdir/bup"
 export GIT_DIR="$tmpdir/bup"
@@ -34,9 +34,14 @@ WVPASSEQ "$(bup ls import-duplicity/ | wc -l)" "3"
 WVPASSEQ "$(bup ls import-duplicity/latest/ | sort)" "$(ls src | sort)"
 WVPASS bup restore -C restore/ import-duplicity/latest/
 WVFAIL "$top/t/compare-trees" src/ restore/ > tmp-compare-trees
 WVPASSEQ "$(bup ls import-duplicity/latest/ | sort)" "$(ls src | sort)"
 WVPASS bup restore -C restore/ import-duplicity/latest/
 WVFAIL "$top/t/compare-trees" src/ restore/ > tmp-compare-trees
-WVPASSEQ $(cat tmp-compare-trees | wc -l) 1
+WVPASSEQ $(cat tmp-compare-trees | wc -l) 4
 # Note: OS X rsync itemize output is currently only 9 chars, not 11.
 # Note: OS X rsync itemize output is currently only 9 chars, not 11.
-expected_diff_rx='^\.d\.\.t.\.\.\.\.?\.? \./$'
+# Expect something like this (without the leading spaces):
+#   .d..t...... ./
+#   .L..t...... abs-symlink -> /home/foo/bup/t/sampledata/var/abs-symlink-target
+#   .L..t...... b -> a
+#   .L..t...... c -> b
+expected_diff_rx='^\.d\.\.t.\.\.\.\.?\.? \./$|^\.L\.\.t.\.\.\.\.?\.? '
 if ! grep -qE "$expected_diff_rx" tmp-compare-trees; then
     echo -n 'tmp-compare-trees: ' 1>&2
     cat tmp-compare-trees 1>&2
 if ! grep -qE "$expected_diff_rx" tmp-compare-trees; then
     echo -n 'tmp-compare-trees: ' 1>&2
     cat tmp-compare-trees 1>&2
index 573ad8c4083ea1a1fcee4668e2803ead9346868d..f9fa896283dc42cb58350308e2f33c85705ec662 100755 (executable)
@@ -100,7 +100,7 @@ test-src-save-restore()
 
 setup-test-tree()
 {
 
 setup-test-tree()
 {
-    WVPASS make PREFIX="$tmpdir"/src install
+    WVPASS cp -a "$TOP/t/sampledata" "$tmpdir/src"
 
     # Add some hard links for the general tests.
     (
 
     # Add some hard links for the general tests.
     (
@@ -158,18 +158,18 @@ WVSTART 'metadata save/restore (general)'
     # Test a deeper subdir/ to make sure top-level non-dir metadata is
     # restored correctly.  We need at least one dir and one non-dir at
     # the "top-level".
     # Test a deeper subdir/ to make sure top-level non-dir metadata is
     # restored correctly.  We need at least one dir and one non-dir at
     # the "top-level".
-    WVPASS test -d src/bin
-    WVPASS test -f src/bin/bup
+    WVPASS test -d src/var/cmd
+    WVPASS test -f src/var/cmd/save-cmd.py
     WVPASS rm -rf "$BUP_DIR"
     WVPASS bup init
     WVPASS touch -t 201111111111 src-restore # Make sure the top won't match.
     WVPASS bup index src
     WVPASS bup save -t -n src src
     WVPASS force-delete src-restore
     WVPASS rm -rf "$BUP_DIR"
     WVPASS bup init
     WVPASS touch -t 201111111111 src-restore # Make sure the top won't match.
     WVPASS bup index src
     WVPASS bup save -t -n src src
     WVPASS force-delete src-restore
-    WVPASS bup restore -C src-restore "/src/latest$(pwd)/src/lib/"
+    WVPASS bup restore -C src-restore "/src/latest$(pwd)/src/var/."
     WVPASS touch -t 201211111111 src-restore # Make sure the top won't match.
     # Check that the only difference is the top dir.
     WVPASS touch -t 201211111111 src-restore # Make sure the top won't match.
     # Check that the only difference is the top dir.
-    WVFAIL $TOP/t/compare-trees -c src/lib/ src-restore/ > tmp-compare-trees
+    WVFAIL $TOP/t/compare-trees -c src/var/ src-restore/ > tmp-compare-trees
     WVPASSEQ $(cat tmp-compare-trees | wc -l) 1
     # Note: OS X rsync itemize output is currently only 9 chars, not 11.
     expected_diff_rx='^\.d\.\.t.\.\.\.\.?\.? \./$'
     WVPASSEQ $(cat tmp-compare-trees | wc -l) 1
     # Note: OS X rsync itemize output is currently only 9 chars, not 11.
     expected_diff_rx='^\.d\.\.t.\.\.\.\.?\.? \./$'