]> arthur.barton.de Git - bup.git/blob - test-sh
bup save: handle symlinks correctly.
[bup.git] / test-sh
1 #!/bin/bash
2 set -e
3 echo "Testing \"$@\" in Makefile:"
4
5 TOP="$(pwd)"
6 export BUP_DIR="$TOP/buptest.tmp"
7 alias bup="$TOP/bup"
8
9 set -x
10 rm -rf "$BUP_DIR"
11 bup init
12 bup split --bench -b <testfile1 >tags1.tmp
13 bup split -vvvv -b testfile2 >tags2.tmp
14 bup split -t testfile2 >tags2t.tmp
15 bup split -c testfile2 >tags2c.tmp
16 diff -u tags1.tmp tags2.tmp || true
17 wc -c testfile1 testfile2
18 wc -l tags1.tmp tags2.tmp
19 bup join $(cat tags1.tmp) >out1.tmp
20 bup join <tags2.tmp >out2.tmp
21 bup join <tags2t.tmp >out2t.tmp
22 bup join <tags2c.tmp >out2c.tmp
23 diff -u testfile1 out1.tmp
24 diff -u testfile2 out2.tmp
25 diff -u testfile2 out2t.tmp
26 diff -u testfile2 out2c.tmp
27
28 (
29     set -e
30     cd "$BUP_DIR" || exit 1
31     git repack -Ad
32     git prune
33     (cd "$TOP/t/sampledata" && bup save -vvn master .) || exit 1
34     n=$(git fsck --full --strict 2>&1 | tee /dev/stderr | wc -l)
35     if [ "$n" != 0 ]; then
36         echo "git fsck error."
37         exit 5
38     fi
39 ) || exit 1