From 3407ae75fc1492c331d1d7f2ffa0a9676c16a6a9 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Tue, 31 Dec 2013 12:58:49 -0600 Subject: [PATCH] Move clear-index tests from test.sh to test-index-clear.sh. Signed-off-by: Rob Browning --- Makefile | 1 + t/test-index-clear.sh | 36 ++++++++++++++++++++++++++++++++++++ t/test.sh | 21 --------------------- 3 files changed, 37 insertions(+), 21 deletions(-) create mode 100755 t/test-index-clear.sh diff --git a/Makefile b/Makefile index a3ae49e..825ef56 100644 --- a/Makefile +++ b/Makefile @@ -90,6 +90,7 @@ runtests-cmdline: all test -e t/tmp || mkdir t/tmp TMPDIR="$(test_tmp)" t/test-cat-file.sh TMPDIR="$(test_tmp)" t/test-compression.sh + TMPDIR="$(test_tmp)" t/test-index-clear.sh TMPDIR="$(test_tmp)" t/test-index-check-device.sh TMPDIR="$(test_tmp)" t/test-meta.sh TMPDIR="$(test_tmp)" t/test-restore-map-owner.sh diff --git a/t/test-index-clear.sh b/t/test-index-clear.sh new file mode 100755 index 0000000..46bc201 --- /dev/null +++ b/t/test-index-clear.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +. ./wvtest-bup.sh + +set -o pipefail + +top="$(WVPASS pwd)" || exit $? +tmpdir="$(WVPASS wvmktempdir)" || exit $? + +export BUP_DIR="$tmpdir/bup" +export GIT_DIR="$tmpdir/bup" + +bup() { "$top/bup" "$@"; } + + +WVPASS bup init +WVPASS cd "$tmpdir" + + +WVSTART "index --clear" +WVPASS mkdir src +WVPASS touch src/foo src/bar +WVPASS bup index -u src +WVPASSEQ "$(bup index -p)" "src/foo +src/bar +src/ +./" +WVPASS rm src/foo +WVPASS bup index --clear +WVPASS bup index -u src +expected="$(WVPASS bup index -p)" || exit $? +WVPASSEQ "$expected" "src/bar +src/ +./" + + +WVPASS rm -rf "$tmpdir" diff --git a/t/test.sh b/t/test.sh index 32b57d4..0bae1e3 100755 --- a/t/test.sh +++ b/t/test.sh @@ -416,24 +416,3 @@ WVSTART "save disjoint top-level directories" expected="$(echo -e "$pwd_top/\n$tmp_top/" | WVPASS sort)" || exit $? WVPASSEQ "$actual" "$expected" ) || exit $? - -WVSTART "clear-index" -D=clear-index.tmp -export BUP_DIR="$TOP/$D/.bup" -WVPASS force-delete $TOP/$D -WVPASS mkdir $TOP/$D -WVPASS bup init -WVPASS touch $TOP/$D/foo -WVPASS touch $TOP/$D/bar -WVPASS bup index -u $D -WVPASSEQ "$(bup index -p)" "$D/foo -$D/bar -$D/ -./" -WVPASS rm $TOP/$D/foo -WVPASS bup index --clear -WVPASS bup index -u $TOP/$D -expected="$(WVPASS bup index -p)" || exit $? -WVPASSEQ "$expected" "$D/bar -$D/ -./" -- 2.39.2