summaryrefslogtreecommitdiff
path: root/tests/test-vc-list-files-git.sh
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-04-23 11:38:35 +0200
committerJim Meyering <meyering@redhat.com>2010-04-23 11:38:35 +0200
commit1b260c90384d91ca9b211670b705ed671aff26c7 (patch)
treec653a4bd03793a2b0374a08636215938b9911594 /tests/test-vc-list-files-git.sh
parentd65d5e69bddcf143aae7ceaf3f525e1b74ed465d (diff)
downloadgnulib-1b260c90384d91ca9b211670b705ed671aff26c7.tar.gz
vc-list-files tests: convert to use init.sh
* tests/test-vc-list-files-cvs.sh: Invoke "$srcdir/init.sh" and path_prepend_. Use Exit, not exit. Use skip_ rather than open coding it. Remove trap set-up and compare definitions. * tests/test-vc-list-files-git.sh: Likewise. * modules/vc-list-files-tests (Files): Add tests/init.sh.
Diffstat (limited to 'tests/test-vc-list-files-git.sh')
-rwxr-xr-xtests/test-vc-list-files-git.sh16
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/test-vc-list-files-git.sh b/tests/test-vc-list-files-git.sh
index 56a9a5b940..47576258bc 100755
--- a/tests/test-vc-list-files-git.sh
+++ b/tests/test-vc-list-files-git.sh
@@ -16,18 +16,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
-if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
- compare() { diff -u "$@"; }
-elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
- compare() { cmp -s "$@"; }
-else
- compare() { cmp "$@"; }
-fi
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ .
tmpdir=vc-git-$$
-trap 'st=$?; cd '"`pwd`"' && rm -rf $tmpdir; exit $st' 0
-trap '(exit $?); exit $?' 1 2 13 15
-
GIT_DIR= GIT_WORK_TREE=; unset GIT_DIR GIT_WORK_TREE
fail=1
@@ -35,7 +27,7 @@ mkdir $tmpdir && cd $tmpdir &&
# without git, skip the test
# The double use of 'exit' is needed for the reference to $? inside the trap.
{ ( git init -q ) > /dev/null 2>&1 \
- || { echo "Skipping test: git not found in PATH"; (exit 77); exit 77; }; } &&
+ || skip_ "git not found in PATH"; } &&
mkdir d &&
touch d/a b c &&
git config user.email "you@example.com" &&
@@ -47,4 +39,4 @@ mkdir $tmpdir && cd $tmpdir &&
compare expected actual &&
fail=0
-(exit $fail); exit $fail
+Exit $fail