summaryrefslogtreecommitdiff
path: root/tests/misc/od
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-08-18 08:50:00 +0200
committerJim Meyering <jim@meyering.net>2007-08-18 08:53:31 +0200
commitb78c6b68f77d55b6aeb57853a2f5e2bf312584c1 (patch)
treead6065ca95bf0aeb5a9a4601c3220b0c42b97a17 /tests/misc/od
parentd2e5e366a1d813e5ce2d03e250eb1ebe44473b63 (diff)
downloadcoreutils-b78c6b68f77d55b6aeb57853a2f5e2bf312584c1.tar.xz
Run each Coreutils.pm-based test in its own subdirectory.
* tests/CuTmpdir.pm: New file. * tests/Makefile.am (EXTRA_DIST): Add CuTmpdir.pm. * tests/misc/od, tests/misc/base64, tests/misc/basename: * tests/misc/cut, tests/misc/date, tests/misc/dirname: * tests/misc/expand, tests/misc/fold, tests/misc/head-elide-tail: * tests/misc/paste-no-nl, tests/misc/pr, tests/misc/sha224sum: * tests/misc/sha256sum, tests/misc/sha384sum, tests/misc/sha512sum: * tests/misc/sort-merge, tests/misc/stat-printf, tests/misc/test-diag: * tests/misc/wc-files0-from, tests/misc/xstrtol: * tests/dd/skip-seek, tests/dircolors/simple, tests/du/files0-from: * tests/expr/basic, tests/factor/basic, tests/fmt/basic: * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1: * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec: * tests/sum/basic-1, tests/tsort/basic-1, tests/unexpand/basic-1: * tests/mv/i-1, tests/rm/empty-name, tests/rm/unreadable: Use it. * tests/misc/test-diag: Use "$ENV{abs_top_builddir}/src/test", not "../../src/test", so it works when run from a subdirectory. * tests/ls-2/tests: Create temp files and dirs from within the perl script, so that they're removed, when run from a subdirectory.
Diffstat (limited to 'tests/misc/od')
-rwxr-xr-xtests/misc/od18
1 files changed, 3 insertions, 15 deletions
diff --git a/tests/misc/od b/tests/misc/od
index e5d0c59fd..2395fa118 100755
--- a/tests/misc/od
+++ b/tests/misc/od
@@ -20,20 +20,6 @@
: ${PERL=perl}
: ${srcdir=.}
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && 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 1
-fi
-
PROG=`echo $0|sed 's,.*/,,'`; export PROG
$PERL -e 1 > /dev/null 2>&1 || {
@@ -42,7 +28,9 @@ $PERL -e 1 > /dev/null 2>&1 || {
exit 77
}
-exec $PERL -w -I$pwd/.. -MCoreutils -- - <<\EOF
+me=`echo $0|sed 's,.*/,,'`
+me=`echo $0|sed 's,.*/,,'`
+exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
require 5.003;
use strict;