]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Convert tests/dd/*, too.
authorJim Meyering <jim@meyering.net>
Fri, 7 Sep 2007 12:28:47 +0000 (14:28 +0200)
committerJim Meyering <jim@meyering.net>
Sat, 15 Sep 2007 06:40:38 +0000 (08:40 +0200)
tests/dd/Makefile.am
tests/dd/misc
tests/dd/not-rewound
tests/dd/skip-seek2
tests/dd/unblock-sync

index 91ba05d98d5891183257354ed8f6c9e89ac23e77..f474596dbfb91aff86c6de6698d569bfeeac891f 100644 (file)
@@ -11,3 +11,5 @@ TESTS_ENVIRONMENT = \
   PROG=dd
 
 TESTS = misc not-rewound skip-seek skip-seek2 unblock-sync
+
+include $(top_srcdir)/tests/check.mk
index dc77e8b60f390a2b0ec56f4037ee63a2d05ca441..aea9491094e389a10b90779000310b6ddb564b55 100755 (executable)
@@ -2,7 +2,7 @@
 # Ensure dd treats `--' properly.
 # Also test some flag values.
 
-# Copyright (C) 1999, 2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2004-2007 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-tmp_in=dd-in.$$
-tmp_in2=dd-in2.$$
-tmp_sym=dd-sym.$$
-tmp_out=dd-out.$$
-
 if test "$VERBOSE" = yes; then
   set -x
   dd --version
 fi
 
+. $srcdir/../test-lib.sh
+
+tmp_in=dd-in.$$
+tmp_in2=dd-in2.$$
+tmp_sym=dd-sym.$$
+tmp_out=dd-out.$$
+
 fail=0
 warn=0
 test_failure=0
@@ -39,14 +41,14 @@ if test $test_failure = 1; then
 fi
 
 dd if=$tmp_in of=$tmp_out 2> /dev/null || fail=1
-cmp $tmp_in $tmp_out || fail=1
+compare $tmp_in $tmp_out || fail=1
 
 rm $tmp_out
 dd -- if=$tmp_in of=$tmp_out 2> /dev/null || fail=1
-cmp $tmp_in $tmp_out || fail=1
+compare $tmp_in $tmp_out || fail=1
 
 if dd oflag=append if=$tmp_in of=$tmp_out 2> /dev/null; then
-  cmp $tmp_in $tmp_out || fail=1
+  compare $tmp_in $tmp_out || fail=1
 fi
 
 if dd iflag=nofollow if=$tmp_in count=0 2> /dev/null; then
@@ -84,7 +86,5 @@ fi
 outbytes=`echo x | dd bs=3 ibs=10 obs=10 conv=sync 2>/dev/null | wc -c`
 test "$outbytes" -eq 3 || fail=1
 
-rm -f $tmp_in $tmp_in2 $tmp_sym $tmp_out || fail=1
-
 test $fail -eq 0 && fail=$warn
 exit $fail
index d27deb0cc10ae6e90706f693487f9209b14a6805..9b16326130aade1699eff4f6014dfeb09c7633a5 100755 (executable)
@@ -2,7 +2,7 @@
 # Make sure dd does the right thing when the input file descriptor
 # is not rewound.
 
-# Copyright (C) 2000, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2004, 2006, 2007 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,19 +22,7 @@ if test "$VERBOSE" = yes; then
   dd --version
 fi
 
-pwd=`pwd`
-tmp=dd-rw.$$
-trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
-
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
-if test $framework_failure = 1; then
-  echo 'failure in testing framework'
-  exit 1
-fi
+. $srcdir/../test-lib.sh
 
 fail=0
 
index 2bf5f4fad54398d798519ccd01fe1be8b0133ba9..b1024af15411b9c0a406c0c6bc8ed9499f1dc03b 100755 (executable)
@@ -2,7 +2,7 @@
 # show how to skip an amount that is smaller than the nominal block size.
 # There's a more realistic example in the documentation.
 
-# Copyright (C) 2000, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2004, 2006, 2007 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,19 +22,7 @@ if test "$VERBOSE" = yes; then
   dd --version
 fi
 
-pwd=`pwd`
-tmp=skip-seek.$$
-trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
-
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
-if test $framework_failure = 1; then
-  echo 'failure in testing framework'
-  (exit 1); exit 1
-fi
+. $srcdir/../test-lib.sh
 
 fail=0
 
index 186c631a711e14ccc2882e892779de2099c63e56..7fc5eb56890a50d9d07133dee97b0f65942b266b 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Ensure that dd conv=unblock,sync works.
 
-# Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2005-2007 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,22 +21,9 @@ if test "$VERBOSE" = yes; then
   dd --version
 fi
 
-# . $srcdir/../envvar-check
+. $srcdir/../test-lib.sh
 
-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
-printf 000100020003xx > in || framework_failure=1
-
-if test $framework_failure = 1; then
-  echo "$0: failure in testing framework" 1>&2
-  (exit 1); exit 1
-fi
+printf 000100020003xx > in || framework_failure
 
 fail=0
 
@@ -48,7 +35,6 @@ cat <<\EOF > exp || fail=1
 xx
 EOF
 
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
 
 (exit $fail); exit $fail