summaryrefslogtreecommitdiff
path: root/tests/cp/cp-parents
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-09-06 17:34:49 +0200
committerJim Meyering <jim@meyering.net>2007-09-15 08:40:38 +0200
commitdf0beae1eb1318869d51a064aec8fdd401877cbf (patch)
tree94f2224056162eadbb3d6b640e32f56d3f405cbf /tests/cp/cp-parents
parentc840cd4334c086f5ce4d9144d9fac75643824a38 (diff)
downloadcoreutils-df0beae1eb1318869d51a064aec8fdd401877cbf.tar.xz
Adjust chgrp, chmod, chown, cp tests to use test-lib.sh.
* tests/check.mk: Also define abs_top_builddir.
Diffstat (limited to 'tests/cp/cp-parents')
-rwxr-xr-xtests/cp/cp-parents37
1 files changed, 8 insertions, 29 deletions
diff --git a/tests/cp/cp-parents b/tests/cp/cp-parents
index 76c63be52..4500e5f48 100755
--- a/tests/cp/cp-parents
+++ b/tests/cp/cp-parents
@@ -2,7 +2,7 @@
# cp -R --parents dir-specified-with-trailing-slash/ other-dir
# would get a failed assertion.
-# Copyright (C) 2000, 2002, 2004, 2005, 2006, 2007 Free Software
+# Copyright (C) 2000, 2002, 2004, 2005, 2006-2007 Free Software
# Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
@@ -23,37 +23,16 @@ if test "$VERBOSE" = yes; then
mv --version
fi
-umask 022
-
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && exec 1>&2; rm -rf $t0 && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
-
-framework_failure=0
-
-# Record absolute path of srcdir and cd back to current dir.
-cd $srcdir || framework_failure=1
-abs_srcdir=`pwd`
-cd "$pwd" || framework_failure=1
-
-. $srcdir/../envvar-check
. $srcdir/../umask-check
+. $srcdir/../test-lib.sh
-mkdir -p $tmp || framework_failure=1
-cd $tmp || framework_failure=1
+# Run the setgid check from the just-created directory.
+. "$abs_top_srcdir/tests/setgid-check"
-. "$abs_srcdir/../setgid-check"
-
-mkdir foo bar || framework_failure=1
-mkdir -p a/b/c d e g || framework_failure=1
-ln -s d/a sym || framework_failure=1
-touch f || framework_failure=1
-
-if test $framework_failure = 1; then
- echo 'failure in testing framework'
- exit 1
-fi
+mkdir foo bar || framework_failure
+mkdir -p a/b/c d e g || framework_failure
+ln -s d/a sym || framework_failure
+touch f || framework_failure
fail=0