]> Dogcows Code - chaz/tar/commitdiff
Rewritten
authorSergey Poznyakoff <gray@gnu.org.ua>
Sun, 29 Feb 2004 00:06:36 +0000 (00:06 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Sun, 29 Feb 2004 00:06:36 +0000 (00:06 +0000)
tests/after
tests/before
tests/preset.in

index 1eedc336b40b81afd77d101dc67d3073674b0a73..427b542293973dbd79f8d5d0f5fe955601824aee 100755 (executable)
@@ -4,6 +4,33 @@
 cd ..
 exec 1> /dev/null
 exec 2> /dev/null
-echo $echo_n "$out$echo_c" | cmp -s - tmp-$$/stdout || exit 1
-echo $echo_n "$err$echo_c" | cmp -s - tmp-$$/stderr || exit 1
+
+compare() {
+    eval tempfile=tmp-$$/std${1}
+    eval echo \""\${$1}"\" | sed '$d' > ${tempfile}0
+    
+    sedscript=tmp-$$/${1}.sed
+    if eval test \".\${${1}_ignore}\" = .; then
+       :
+    else
+       eval echo \"\${${1}_ignore}\" | sed 's,^.*$,/&/d,;' > $sedscript
+       sed -f $sedscript ${tempfile} > ${tempfile}.1
+       mv ${tempfile}.1 ${tempfile}
+    fi
+    
+    if eval test -z "\${${1}_regex}" ; then
+       cmp -s ${tempfile}0 ${tempfile} || exit 1
+    else
+       awk '{print NR " " $0}' ${tempfile}0 > ${tempfile}.1
+       awk '{print NR " " $0}' ${tempfile} | join ${tempfile}.1 - |
+       while read NUM RE LINE
+       do
+         echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
+       done 
+    fi
+}
+
+compare out
+compare err
+
 rm -rf tmp-$$
index 5733c4111d6cc9206afc6d25ee625e9ceae0dec7..8fdd612a5bd836c29f38c4b31c19df6267c42a5c 100755 (executable)
@@ -1,38 +1,34 @@
 #! /bin/sh
 # Do common operations before a particular test.
 
+case $# in
+    0)   TAR_ARCHIVE_FORMATS=${TAR_ARCHIVE_FORMATS:-v7 oldgnu ustar posix gnu}
+         for format in $TAR_ARCHIVE_FORMATS
+         do
+            $0 $format
+            R=$?
+            test $R -eq 0 || exit $R
+        done
+        exit 0;;
+    1)   if test "x$1" = xauto; then
+            TAR_OPTIONS=
+        else    
+            TAR_OPTIONS="--format=$1"
+        fi;;   
+    *)   echo "Too many arguments" >&2 
+         exit 2;;
+esac    
+
 mkdir tmp-$$
 cd tmp-$$
 
-case $srcdir in
-  /*|~*) ;;
-  *) srcdir=../$srcdir ;;
-esac
-
 out=
 err=
 
-echo $0 > checking
+export TAR_OPTIONS
+#echo "$0 $1"
+echo "$0 $1" > checking
 exec 1> stdout
 exec 2> stderr
 
-PATH=..:../../src:$PATH
-    
-prereq() {
-    if test $# -ne 0; then
-        case $TAR_OPTIONS in
-            --format=*)   FMTOPT=$TAR_OPTIONS;;
-            *)            FMTOPT=`tar --show-defaults`;;
-        esac
-
-        FORMAT=
-        for option
-        do
-            case $FMTOPT in
-                --format=$option*) FORMAT=$option
-                                          break;;
-            esac
-        done
-        test -z "$FORMAT" && exit 77
-    fi
-}
\ No newline at end of file
+           
index 15ee9da35b997146de4da1de96183bb88190090f..bb078497f676d1476099515fa2edc6556abe91e6 100755 (executable)
@@ -3,15 +3,20 @@
 
 PACKAGE=@PACKAGE@
 VERSION=@VERSION@
-top_srcdir=@top_srcdir@
-srcdir=@srcdir@
-
-echo_n='@ECHO_N@'
-echo_c='@ECHO_C@'
+top_srcdir=@abs_top_srcdir@
+srcdir=@abs_srcdir@
+PATH=@abs_builddir@:@abs_top_builddir@/src:$top_srcdir:$srcdir:$PATH
 
 export LANGUAGE
 LANGUAGE=
-export LANG
-LANG=
-export LC_MESSAGES
-LC_MESSAGES=
+export LC_ALL
+LC_ALL="C"
+
+skiptest() {
+    exit 77
+}
+
+star_prereq() {
+    test -z "$STAR_TESTSCRIPTS" && skiptest
+    test -r "$STAR_TESTSCRIPTS/$1" || skiptest
+}
This page took 0.026815 seconds and 4 git commands to generate.