]> Savannah Git Hosting - gnulib.git/commitdiff
revamp the other test-exclude?.sh scripts to use init.sh, too
authorJim Meyering <meyering@redhat.com>
Sat, 12 Nov 2011 16:12:59 +0000 (17:12 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 12 Nov 2011 16:14:21 +0000 (17:14 +0100)
* tests/test-exclude1.sh: Use init.sh.
* tests/test-exclude2.sh: Likewise.
* tests/test-exclude3.sh: Likewise.
* tests/test-exclude4.sh: Likewise.
* tests/test-exclude5.sh: Likewise.
* tests/test-exclude6.sh: Likewise.
* tests/test-exclude7.sh: Likewise.
* tests/test-exclude8.sh: Likewise.
* modules/exclude-tests (Files): List init.sh.

ChangeLog
modules/exclude-tests
tests/test-exclude1.sh
tests/test-exclude2.sh
tests/test-exclude3.sh
tests/test-exclude4.sh
tests/test-exclude5.sh
tests/test-exclude6.sh
tests/test-exclude7.sh
tests/test-exclude8.sh

index d265d75128310b55ef81e7f055c0e9f677eca8c6..2794c4d4b29343743b0c556523c2dff8214fba95 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2011-11-12  Jim Meyering  <meyering@redhat.com>
 
+       revamp the other test-exclude?.sh scripts to use init.sh, too
+       * tests/test-exclude1.sh: Use init.sh.
+       * tests/test-exclude2.sh: Likewise.
+       * tests/test-exclude3.sh: Likewise.
+       * tests/test-exclude4.sh: Likewise.
+       * tests/test-exclude5.sh: Likewise.
+       * tests/test-exclude6.sh: Likewise.
+       * tests/test-exclude7.sh: Likewise.
+       * tests/test-exclude8.sh: Likewise.
+       * modules/exclude-tests (Files): List init.sh.
+
        test-exclude2.sh, test-exclude5.sh: fail if test-exclude fails
        These shell scripts ignored failure of the binary test-exclude,
        so making the latter return 77 didn't cause them to be skipped.
index 3dd02251ad7f333b731fa0a902601ebb9b98efda..072a4e6cd7c7ed51cde711146b112b7335168002 100644 (file)
@@ -1,4 +1,5 @@
 Files:
+tests/init.sh
 tests/test-exclude.c
 tests/test-exclude1.sh
 tests/test-exclude2.sh
index 9c5f70958b12ffe07f77c4f8fe5ac1299e2c7ba3..d85c4c74be435b4efe2b224b9d89c8a995749eda 100755 (executable)
 # 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=excltmp.$$
-LIST=flist.$$
-ERR=0
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
 
 # Test literal matches
 
-cat > $LIST <<EOT
+cat > in <<EOT
 foo*
 bar
 Baz
 EOT
 
-cat > $TMP <<EOT
+cat > expected <<EOT
 foo: 0
 foo*: 1
 bar: 1
@@ -37,9 +36,15 @@ baz: 0
 bar/qux: 0
 EOT
 
-./test-exclude$EXEEXT $LIST -- foo 'foo*' bar foobar baz bar/qux |
- tr -d '\015' |
- diff -c $TMP - || ERR=1
+test-exclude in -- foo 'foo*' bar foobar baz bar/qux > out || exit $?
 
-rm -f $TMP $LIST
-exit $ERR
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
index b38bb7fdd2185de8293382a207559bc6458daf0e..33ee734e119cbb0d4de186c6b836153dff8df327 100755 (executable)
@@ -17,7 +17,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ .
-
 fail=0
 
 cat > in <<EOT
@@ -37,16 +36,14 @@ baz: 1
 bar/qux: 0
 EOT
 
-test-exclude -casefold in -- foo 'foo*' bar foobar baz bar/qux > out \
-  || exit $?
+test-exclude -casefold in -- foo 'foo*' bar foobar baz bar/qux > out || exit $?
 
 # Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
 # does not understand '\r'.
 case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
 
 # normalize output
-LC_ALL=C tr -d "$cr" < out > k
-mv k out
+LC_ALL=C tr -d "$cr" < out > k && mv k out
 
 compare expected out || fail=1
 
index 6b8512efb608d9611a94ca75758221c42f322c1e..a9a4d23187f305460a76f2dbc3759796da637104 100755 (executable)
 # 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=excltmp.$$
-LIST=flist.$$
-ERR=0
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
 
 # Test include
 
-cat > $LIST <<EOT
+cat > in <<EOT
 foo*
 bar
 Baz
 EOT
 
-cat > $TMP <<EOT
+cat > expected <<EOT
 foo: 1
 foo*: 0
 bar: 0
@@ -37,9 +36,15 @@ baz: 1
 bar/qux: 1
 EOT
 
-./test-exclude$EXEEXT -include $LIST -- foo 'foo*' bar foobar baz bar/qux |
- tr -d '\015' |
- diff -c $TMP - || ERR=1
+test-exclude -include in -- foo 'foo*' bar foobar baz bar/qux > out || exit $?
 
-rm -f $TMP $LIST
-exit $ERR
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
index 99c4c9fec1b023cde6533b30726f4753387831e6..b3ecdae75f33430324d0a9183d60aa0501310b70 100755 (executable)
 # 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=excltmp.$$
-LIST=flist.$$
-ERR=0
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
 
 # Test wildcard matching
 
-cat > $LIST <<EOT
+cat > in <<EOT
 foo*
 bar
 Baz
 EOT
 
-cat > $TMP <<EOT
+cat > expected <<EOT
 foobar: 1
 EOT
 
-./test-exclude$EXEEXT -wildcards $LIST -- foobar |
- tr -d '\015' |
- diff -c $TMP - || ERR=1
+test-exclude -wildcards in -- foobar > out || exit $?
 
-rm -f $TMP $LIST
-exit $ERR
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
index 32579637c2a59c404ced4146345e360f30b83617..d9558f74e957f5cf481195c1b07b404dc7e7989f 100755 (executable)
@@ -17,7 +17,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ .
-
 fail=0
 
 # Test FNM_LEADING_DIR
@@ -35,16 +34,14 @@ barz: 0
 foo/bar: 1
 EOT
 
-test-exclude -leading_dir in -- bar bar/qux barz foo/bar > out \
-  || exit $?
+test-exclude -leading_dir in -- bar bar/qux barz foo/bar > out || exit $?
 
 # Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
 # does not understand '\r'.
 case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
 
 # normalize output
-LC_ALL=C tr -d "$cr" < out > k
-mv k out
+LC_ALL=C tr -d "$cr" < out > k && mv k out
 
 compare expected out || fail=1
 
index eb4f5f1eb710624cf9f51388196f1461b2f20198..b2093d610ff808a9631ddd04dd5a3aae8966e9e5 100755 (executable)
 # 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=excltmp.$$
-LIST=flist.$$
-ERR=0
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
 
 # Test anchored
 
-cat > $LIST <<EOT
+cat > in <<EOT
 foo*
 bar
 Baz
 EOT
 
-cat > $TMP <<EOT
+cat > expected <<EOT
 bar: 1
 foo/bar: 0
 EOT
 
-./test-exclude$EXEEXT -anchored $LIST -- bar foo/bar |
- tr -d '\015' |
- diff -c $TMP - || ERR=1
+test-exclude -anchored in -- bar foo/bar > out || exit $?
 
-rm -f $TMP $LIST
-exit $ERR
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
index 03ed2a6683fe7f53517d897fc5a6e62a29590ea9..f75b814e3e728dfe85704c5f46f9703281bfd063 100755 (executable)
 # 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=excltmp.$$
-LIST=flist.$$
-ERR=0
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
 
 # Test exclude precedence
 
-cat > $LIST <<EOT
+cat > in <<EOT
 foo*
 bar
 Baz
 EOT
 
-cat > $TMP <<EOT
+cat > expected <<EOT
 bar: 1
 bar: 0
 EOT
 
-./test-exclude$EXEEXT $LIST -include $LIST -- bar |
- tr -d '\015' >$TMP.1
-./test-exclude$EXEEXT -include $LIST -no-include $LIST -- bar |
- tr -d '\015' >>$TMP.1
+test-exclude in -include in -- bar > out || exit $?
+test-exclude -include in -no-include in -- bar >> out || exit $?
 
-diff -c $TMP $TMP.1 || ERR=1
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
 
-rm -f $TMP $TMP.1 $LIST
-exit $ERR
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail
index 95920708db31d9866aa494ea3d908010abd0d843..b1b010e24a0d90574a75c5ffeb2a8144ea42d566 100755 (executable)
 # 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=excltmp.$$
-LIST=flist.$$
-ERR=0
+. "${srcdir=.}/init.sh"; path_prepend_ .
+fail=0
 
 # Test escaped metacharacters.
 
-cat > $LIST <<'EOT'
+cat > in <<'EOT'
 f\*e
 b[a\*]r
 EOT
 
-cat > $TMP <<'EOT'
+cat > expected <<'EOT'
 f*e: 1
 file: 0
 bar: 1
 EOT
 
-./test-exclude$EXEEXT -wildcards $LIST -- 'f*e' 'file' 'bar' |
- tr -d '\015' | diff -c $TMP - || ERR=1
+test-exclude -wildcards in -- 'f*e' 'file' 'bar' > out || exit $?
 
-rm -f $TMP $LIST
-exit $ERR
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
+
+# normalize output
+LC_ALL=C tr -d "$cr" < out > k && mv k out
+
+compare expected out || fail=1
+
+Exit $fail