diff options
author | Jim Meyering <jim@meyering.net> | 2002-04-19 22:36:03 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-04-19 22:36:03 +0000 |
commit | 1a35394a57a4f7e83be41b28353b7146fe5ae64b (patch) | |
tree | 9fb715ad3d22f0cee7e282638b457c0028805d80 | |
parent | 2b5e6e4835e074f6c1dcbe189035fa87dc32a5cb (diff) | |
download | coreutils-1a35394a57a4f7e83be41b28353b7146fe5ae64b.tar.xz |
upgrade to use better framework
-rwxr-xr-x | tests/cp/cp-mv-backup | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/tests/cp/cp-mv-backup b/tests/cp/cp-mv-backup index 77f62fa6b..e892d29ee 100755 --- a/tests/cp/cp-mv-backup +++ b/tests/cp/cp-mv-backup @@ -13,17 +13,26 @@ fi umask 022 -pwd=`pwd` -dir=cpmvbak-$$ -actual=$dir/actual -expected=$dir/expected - # Be careful to close $actual before removing the containing directory. # Use `1>&2' rather than `1<&-' since the latter appears not to work # with /bin/sh from powerpc-ibm-aix4.2.0.0. -trap "cd $pwd; exec 1>&2; rm -rf $dir" 0 1 2 3 15 -mkdir $dir +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 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +if test $framework_failure = 1; then + echo '$0: failure in testing framework' 1>&2 + (exit 1); exit +fi + +actual=actual +expected=expected exec 1> $actual @@ -31,9 +40,9 @@ fail=0 for prog in cp mv; do for initial_files in 'x' 'x y' 'x y y~' 'x y y.~1~' 'x y y~ y.~1~'; do for opt in none off numbered t existing nil simple never; do - ( cd $dir; touch $initial_files ) - $prog --backup=$opt $dir/x $dir/y || fail=1 - ( cd $dir; echo $initial_files $opt: `ls [xy]*`; rm -f x y y~ y.~?~ ) + touch $initial_files + $prog --backup=$opt x y || fail=1 + echo $initial_files $opt: `ls [xy]*`; rm -f x y y~ y.~?~ done done done |