]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
test suite updates: highlight failed test scripts; optionally save failed test output...
authorChet Ramey <chet.ramey@case.edu>
Thu, 16 Oct 2025 15:44:26 +0000 (11:44 -0400)
committerChet Ramey <chet.ramey@case.edu>
Thu, 16 Oct 2025 15:44:26 +0000 (11:44 -0400)
132 files changed:
CWRU/CWRU.chlog
tests/RUN-ONE-TEST
tests/arith.right
tests/arith5.sub
tests/arith9.sub
tests/builtins.right
tests/builtins.tests
tests/case.right
tests/case.tests
tests/comsub-eof.right
tests/comsub-eof.tests
tests/comsub-posix.right
tests/comsub-posix.tests
tests/comsub.right
tests/comsub.tests
tests/comsub2.right
tests/comsub2.tests
tests/cond.right
tests/cond.tests
tests/dollar-at-star
tests/dollar.right
tests/errors.right
tests/errors.tests
tests/exec.right
tests/execscript
tests/exp.right
tests/exp.tests
tests/exportfunc.right
tests/exportfunc.tests
tests/extglob.right
tests/extglob.tests
tests/func.right
tests/func.tests
tests/getopts.right
tests/getopts.tests
tests/glob.right
tests/glob.tests
tests/globstar.right
tests/globstar.tests
tests/heredoc.right
tests/heredoc.tests
tests/herestr.right
tests/herestr.tests
tests/histexp.right
tests/histexp.tests
tests/history.right
tests/history.tests
tests/ifs.right
tests/ifs.tests
tests/intl.right
tests/intl.tests
tests/invocation.right
tests/invocation.tests
tests/iquote.right
tests/iquote.tests
tests/jobs.right
tests/jobs.tests
tests/lastpipe.right
tests/lastpipe.tests
tests/mapfile.right
tests/mapfile.tests
tests/nameref.right
tests/nameref.tests
tests/nameref11.sub
tests/new-exp.right
tests/new-exp.tests
tests/nquote.right
tests/nquote.tests
tests/parser.right
tests/parser.tests
tests/posixexp.right
tests/posixexp.tests
tests/printf.right
tests/printf.tests
tests/procsub.right
tests/procsub.tests
tests/quote.right
tests/quote.tests
tests/quotearray.right
tests/quotearray.tests
tests/read.right
tests/read.tests
tests/redir.right
tests/redir.tests
tests/rhs-exp.right
tests/rhs-exp.tests
tests/rsh.right
tests/rsh.tests
tests/run-all
tests/run-array
tests/run-array2
tests/run-assoc
tests/run-builtins
tests/run-cond
tests/run-dbg-support
tests/run-dbg-support2
tests/run-execscript
tests/run-func
tests/run-glob-test
tests/run-heredoc
tests/run-histexpand
tests/run-history
tests/run-jobs
tests/run-nameref
tests/run-new-exp
tests/run-nquote1
tests/run-nquote2
tests/run-nquote3
tests/run-nquote4
tests/run-procsub
tests/run-read
tests/run-redir
tests/run-trap
tests/run-varenv
tests/run-vredir
tests/set-e.right
tests/set-e.tests
tests/set-x.right
tests/set-x.tests
tests/test-aux-functions
tests/test.right
tests/test.tests
tests/tilde2.right
tests/tilde2.tests
tests/trap.right
tests/trap.tests
tests/type.right
tests/type.tests
tests/varenv.right
tests/varenv.tests
tests/vredir.right
tests/vredir.tests

index c52426545b89ee868cc33d8b377ca699bb4fed61..1fc170d0f17941d60a27b3c8c3f80d65a9dec39b 100644 (file)
@@ -11984,3 +11984,25 @@ execute_cmd.c
          around calls to run_debug_trap the same way we do it for
          run_return_trap
          Report from Александр Ушаков <anushakov@edu.hse.ru>
+
+                                  10/14
+                                  -----
+tests/run-all
+       - keep track of how many tests run and how many exit with status 0,
+         and report tests that exit with a non-zero status
+         Report and patch from Alexander Bantyev <alexander.bantyev@tweag.io>
+       - keep output of failed tests if the BASH_TSTOUT_SAVEDIR environment
+         variable is set to a valid directory
+         Report and patch from Alexander Bantyev <alexander.bantyev@tweag.io>
+
+                                  10/15
+                                  -----
+tests/run-*
+       - indent the second and subsequent lines of warning messages so they
+         stand out a little more
+
+tests/*.tests
+       - use test_runsub to run sub-tests instead of calling ${THIS_SH}
+         directly, so we can print a message with the name of the sub-test
+         script into the output. This will help with identifying the script
+         that fails
index 2139f171530bee31a25753d11ec8ec8d0b102154..4f4f001f00fd5dd3ec4059113b8ee2c5faf97ad4 100755 (executable)
@@ -10,4 +10,6 @@ export TMPDIR
 export BASH_TSTOUT=/tmp/xx
 rm -f ${BASH_TSTOUT}
 
+export TAB='   '
+
 ${THIS_SH} "$@"
index 0a7bcd727896c142b662dc4622830dc95d5fbf63..ba0f74855fae2e3e5e65a0c80811373d9a3eacfb 100644 (file)
@@ -265,13 +265,13 @@ efg
 0
 0
        arith9.sub
-./arith9.sub: line 4: a: unbound variable
-./arith9.sub: line 5: a: unbound variable
+./arith9.sub: line 17: a: unbound variable
+./arith9.sub: line 18: a: unbound variable
 0
 after 3 0
 0
 after 4 0
-./arith9.sub: line 14: b: expression recursion level exceeded (error token is "b")
+./arith9.sub: line 27: b: expression recursion level exceeded (error token is "b")
 + var=42
 + echo 42
 42
@@ -288,7 +288,7 @@ after 4 0
 + echo 1
 1
 + set +x
-./arith9.sub: line 37: 4+: arithmetic syntax error: operand expected (error token is "+")
+./arith9.sub: line 50: 4+: arithmetic syntax error: operand expected (error token is "+")
 x = 4+ y =
        arith10.sub
 == arraysub ==
index 7d5c7799618c17072e6e3ff27e36783d47a26ebb..fdb80a7a14972851ac2087992be12e66122b51ff 100644 (file)
@@ -30,15 +30,15 @@ echo $(( $intmax_min2 % -1 ))
 echo $(( $intmax_max % -1 ))
 
 lvalue=$intmax_min1
-(( lvalue%= -1 ))
+(( lvalue %= -1 ))
 echo $lvalue
 
 lvalue=$intmax_min2
-(( lvalue%= -1 ))
+(( lvalue %= -1 ))
 echo $lvalue
 
 lvalue=$intmax_max
-(( lvalue%= -1 ))
+(( lvalue %= -1 ))
 echo $lvalue
 
 # and these
index 811139ed44f37443857519bd1f1cfc193a3ee9d9..a3e8eb7a620bc6504fe3aadd0f8050950241078f 100644 (file)
@@ -1,3 +1,16 @@
+#   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
+#   the Free Software Foundation, either version 3 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
 # test expression evaluation with unset variables
 set -u
 
index d708c188f7dc065ea6ae3c3d3e8dcc39b30d0b51..db0f686400e889def68c30037a1b703a32891a78 100644 (file)
@@ -85,8 +85,8 @@ enable unset
 enable -n test worked
 enable -n test
 enable test worked
-./builtins.tests: line 126: enable: notbuiltin: not a shell builtin
-./builtins.tests: line 127: enable: test: not dynamically loaded
+./builtins.tests: line 128: enable: notbuiltin: not a shell builtin
+./builtins.tests: line 129: enable: test: not dynamically loaded
 specialname
 -specialname
 FOO=BAR
@@ -94,25 +94,34 @@ FOO=BAR
 hash: hash table empty
 0
 no-newline
+       source1.sub
 AVAR
 foo
+       source2.sub
 in source.sub2, calling return
 5
+       source3.sub
 a b c
+       source3.sub
 a b c
 x y z
 a b c
+       source4.sub
 a b c
 m n o p
+       source4.sub
 a b c
 m n o p
+       builtins1.sub
 /tmp/bash-dir-a
 /tmp/bash-dir-a
 /tmp/bash-dir-a
 /
+       source5.sub
 ./source5.sub: line 23: /tmp/source-notthere: No such file or directory
 after bad source 1
 ./source5.sub: line 30: /tmp/source-notthere: No such file or directory
+       source6.sub
 one - OK
 0
 0
@@ -122,6 +131,7 @@ three - OK
 0
 four - OK
 0
+       source7.sub
 abc
 def
 ghi
@@ -139,6 +149,7 @@ abc
 def
 ghi
 ok
+       source8.sub
 ./source8.sub: line 40: improbable-filename: No such file or directory
 ./source8.sub: line 41: improbable-filename: No such file or directory
 an improbable filename
@@ -152,6 +163,7 @@ bash: line 1: .: cwd-filename: file not found
 bash: line 1: .: cwd-filename: file not found
 file in the current directory
 file in the current directory
+       source1.sub
 AVAR
 foo
 foo
@@ -162,12 +174,13 @@ AVAR
 foo
 declare -x foo=""
 declare -x FOO="\$\$"
-./builtins.tests: line 242: declare: FOO: not found
+./builtins.tests: line 251: declare: FOO: not found
 declare -x FOO="\$\$"
 ok
 ok
-./builtins.tests: line 274: kill: 4096: invalid signal specification
+./builtins.tests: line 283: kill: 4096: invalid signal specification
 1
+       builtins2.sub
 a\n\n\nb
 a
 
@@ -175,9 +188,11 @@ a
 b
 -p
 a      b       c
+       builtins3.sub
 before: f = 4
 inside
 after: f = 8 bar = 4
+       builtins4.sub
 declare -a c
 declare -A d
 declare -a c=([0]="4")
@@ -188,6 +203,7 @@ declare -a c=([0]="1" [1]="2" [2]="3")
 declare -a c=([0]="1" [1]="2" [2]="3")
 unset
 unset
+       builtins5.sub
 assoc 1 unset
 array 1 unset
 assoc 2 unset
@@ -220,6 +236,7 @@ scalar: 0
 scalar: 1
 scalar: 0
 scalar: 0
+       builtins6.sub
 all set:
 one
 two
@@ -261,6 +278,7 @@ f2 ()
 funcs unset:
 one-two
 two-two
+       builtins7.sub
 bash: line 1: notthere: No such file or directory
 one
 bash: line 1: notthere: No such file or directory
@@ -297,6 +315,7 @@ type
 + command -p -- command -v type
 type
 + set +x
+       builtins8.sub
 u=rw,g=rx,o=rx
 u=r,g=rx,o=rx
 u=rwx,g=rwx,o=
@@ -315,6 +334,7 @@ u=rwx,g=rx,o=rx
 u=rwx,g=rx,o=rx
 u=rwx,g=rx,o=rx
 u=rwx,g=rx,o=x
+       builtins9.sub
 hash: hash table empty
 ./builtins9.sub: line 19: hash: notthere: not found
 1
@@ -333,6 +353,7 @@ builtin hash -p /nosuchdir/nosuchfile cat
 found
 ./builtins9.sub: line 52: hash: /: Is a directory
 builtin hash -p /nosuchfile cat
+       builtins10.sub
 ./builtins10.sub: line 17: help: -x: invalid option
 help: usage: help [-dms] [pattern ...]
 These shell commands are defined internally.  Type `help' to see this list.
@@ -475,6 +496,7 @@ A star (*) next to a name means that the command is disabled.
  hash [-lr] [-p pathname] [-dt] [name >  { COMMANDS ; }
  help [-dms] [pattern ...]
 ./builtins10.sub: line 39: help: no help topics match `bash'.  Try `help help' or `man -k bash' or `info bash'.
+       builtins11.sub
 unlimited
 unlimited
 ./builtins11.sub: line 27: ulimit: +1999: invalid number
@@ -483,6 +505,7 @@ unlimited
 ./builtins11.sub: line 37: ulimit: -g: invalid option
 ulimit: usage: ulimit [-SHabcdefiklmnpqrstuvxPRT] [limit]
 ./builtins11.sub: line 39: ulimit: max user processes: cannot modify limit: Operation not permitted
+       builtins12.sub
 /tmp /bin
 /tmp /bin
 /bin /tmp
@@ -502,5 +525,5 @@ popd: usage: popd [-n] [+N | -N]
 ./builtins12.sub: line 36: popd: +8: directory stack index out of range
 /tmp /
 /
-./builtins.tests: line 325: exit: status: numeric argument required
+./builtins.tests: line 334: exit: status: numeric argument required
 after non-numeric arg to exit: 2
index 1d6d9a4bf6c59c96ef5f26050e4091f86d31ce2d..fccb4dd755e1c0088412f48dc0005e2bcfba94f0 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+
 # tests for miscellaneous builtins not tested elsewhere
 set +p
 set +o posix
@@ -164,18 +166,22 @@ unset -v SFILE
 
 AVAR=AVAR
 
+printf '\tsource1.sub\n'
 . ./source1.sub
 AVAR=foo . ./source1.sub
 
+printf '\tsource2.sub\n'
 . ./source2.sub
 echo $?
 
+printf '\tsource3.sub\n'
 set -- a b c
 . ./source3.sub
 
 # make sure source with arguments does not change the shell's positional
 # parameters, but that the sourced file sees the arguments as its
 # positional parameters
+printf '\tsource3.sub\n'
 echo "$@"
 . ./source3.sub x y z
 echo "$@"
@@ -184,6 +190,7 @@ echo "$@"
 # should be reflected in the calling shell's positional parameters.  this
 # also tests one of the shopt options that controls source using $PATH to
 # find the script
+printf '\tsource4.sub\n'
 echo "$@"
 shopt -u sourcepath
 . source4.sub
@@ -191,29 +198,31 @@ echo "$@"
 
 # this is complicated when the sourced scripts gets its own positional
 # parameters from arguments to `.'
+printf '\tsource4.sub\n'
 set -- a b c
 echo "$@"
 . source4.sub x y z
 echo "$@"
 
 # test out cd and $CDPATH
-${THIS_SH} ./builtins1.sub
+test_runsub ./builtins1.sub
 
 # test behavior of `.' when given a non-existent file argument
-${THIS_SH} ./source5.sub
+test_runsub ./source5.sub
 
 # test bugs in sourcing non-regular files, fixed post-bash-3.2
-${THIS_SH} ./source6.sub
+test_runsub ./source6.sub
 
 # test bugs with source called from multiline aliases and other contexts
-${THIS_SH} ./source7.sub
+test_runsub ./source7.sub
 
 # test source/. -p path
-${THIS_SH} ./source8.sub
+test_runsub ./source8.sub
 
 # in posix mode, assignment statements preceding special builtins are
 # reflected in the shell environment.  `.' and `eval' need special-case
 # code.
+printf '\tsource1.sub\n'
 set -o posix
 echo $AVAR
 AVAR=foo . ./source1.sub
@@ -284,37 +293,37 @@ y=$(kill -l SIGINT)
 unset -v x y
 
 # test behavior of shopt xpg_echo
-${THIS_SH} ./builtins2.sub
+test_runsub ./builtins2.sub
 
 # test behavior of declare -g
-${THIS_SH} ./builtins3.sub
+test_runsub ./builtins3.sub
 
 # test behavior of using declare to create variables without assigning values
-${THIS_SH} ./builtins4.sub
+test_runsub ./builtins4.sub
 
 # test behavior of set and unset array variables
-${THIS_SH} ./builtins5.sub
+test_runsub ./builtins5.sub
 
 # test behavior of unset builtin with -f and -v options
-${THIS_SH} ./builtins6.sub
+test_runsub ./builtins6.sub
 
 # test behavior of command builtin after changing it to a pseudo-keyword
-${THIS_SH} ./builtins7.sub
+test_runsub ./builtins7.sub
 
 # POSIX complete symbolic umask tests
-${THIS_SH} ./builtins8.sub
+test_runsub ./builtins8.sub
 
 # hash tests
-${THIS_SH} ./builtins9.sub
+test_runsub ./builtins9.sub
 
 # help tests
-${THIS_SH} ./builtins10.sub
+test_runsub ./builtins10.sub
 
 # ulimit tests
-${THIS_SH} ./builtins11.sub
+test_runsub ./builtins11.sub
 
 # pushd/popd/dirs
-${THIS_SH} ./builtins12.sub
+test_runsub ./builtins12.sub
 
 shift 0        # succeeds silently
 
index 3ff3eaf51b30bb8345d95ebcc890547a183df06f..230bc6a095870e7c5584ba630948c73129040b3d 100644 (file)
@@ -5,7 +5,7 @@ retest
 and match
 no more clauses
 1.0
-./case.tests: line 42: xx: readonly variable
+./case.tests: line 44: xx: readonly variable
 1.1
 matches 1
 no
@@ -18,6 +18,7 @@ esac
 unset word ok 1
 unset word ok 2
 unset word ok 3
+       case1.sub
 ok 1
 ok 2
 ok 3
@@ -29,6 +30,7 @@ ok 8
 ok 9
 mysterious 1
 mysterious 2
+       case2.sub
 argv[1] = <\a\b\c\^A\d\e\f>
 argv[1] = <\a\b\c\^A\d\e\f>
 argv[1] = <abc^Adef>
@@ -40,6 +42,7 @@ ok 5
 ok 6
 ok 7
 ok 8
+       case3.sub
 --- testing: soh
 ok1ok2ok3ok4ok5
 ok1ok2ok3ok4ok5
@@ -64,3 +67,4 @@ ok1ok2ok3ok4ok5
 ok1ok2ok3ok4ok5
 ok1ok2ok3ok4ok5
 ok1ok2ok3ok4ok5
+       case4.sub
index 2bb0922de9abc64ee4f54b03e7ec37e083d0571c..4b73bfbac0f6628423a7c00fcc573c5ccb350fde 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 case foo in
 bar)   echo skip ;;
 foo)   echo fallthrough ;&
@@ -76,7 +78,7 @@ unset|$unset) echo unset word ok 3 ;;
 esac
 
 # tests of quote removal and pattern matching
-${THIS_SH} ./case1.sub
-${THIS_SH} ./case2.sub
-${THIS_SH} ./case3.sub
-${THIS_SH} ./case4.sub
+test_runsub ./case1.sub
+test_runsub ./case2.sub
+test_runsub ./case3.sub
+test_runsub ./case4.sub
index c6a4c9ef4a9966fdb355b3933a41c184f2b50c41..9069eeecdaaaa59fc8bfb4797d4509814d929b08 100644 (file)
@@ -1,19 +1,26 @@
+       comsub-eof0.sub
 ./comsub-eof0.sub: line 4: warning: here-document at line 2 delimited by end-of-file (wanted `EOF')
 hi
 ./comsub-eof0.sub: line 11: warning: here-document at line 9 delimited by end-of-file (wanted `EOF')
 hi
+       comsub-eof1.sub
 hi
+       comsub-eof2.sub
 ./comsub-eof2.sub: line 2: warning: here-document at line 1 delimited by end-of-file (wanted `EOF')
 hi
+       comsub-eof3.sub
 ./comsub-eof3.sub: line 4: warning: here-document at line 1 delimited by end-of-file (wanted `EOF')
 ./comsub-eof3.sub: line 5: unexpected EOF while looking for matching `)'
+       comsub-eof4.sub
 ./comsub-eof4.sub: line 3: warning: here-document at line 1 delimited by end-of-file (wanted `EOF')
 contents
+       comsub-eof5.sub
 ./comsub-eof5.sub: line 4: warning: here-document at line 2 delimited by end-of-file (wanted `)')
 hi
 ./comsub-eof5.sub: line 9: warning: here-document at line 7 delimited by end-of-file (wanted `EOF')
 hi
 ./comsub-eof5.sub: line 15: warning: here-document at line 13 delimited by end-of-file (wanted `)')
 hi
+       comsub-eof6.sub
 ./comsub-eof6.sub: command substitution: line 3: unexpected EOF while looking for matching `)'
 
index 398746aa49bbafcec7ecefdc637b3fa7f79b1e93..b0ad93c3672e7f2a846ecabe6ee70fb5d83a6937 100644 (file)
@@ -1,13 +1,15 @@
-${THIS_SH} ./comsub-eof0.sub
+. ./test-aux-functions
 
-${THIS_SH} ./comsub-eof1.sub
+test_runsub ./comsub-eof0.sub
 
-${THIS_SH} ./comsub-eof2.sub
+test_runsub ./comsub-eof1.sub
 
-${THIS_SH} ./comsub-eof3.sub
+test_runsub ./comsub-eof2.sub
 
-${THIS_SH} ./comsub-eof4.sub
+test_runsub ./comsub-eof3.sub
 
-${THIS_SH} ./comsub-eof5.sub
+test_runsub ./comsub-eof4.sub
 
-${THIS_SH} ./comsub-eof6.sub
+test_runsub ./comsub-eof5.sub
+
+test_runsub ./comsub-eof6.sub
index ce606f8f5a52882ac3ce9ea77524bdb366e0d099..c3b7f718ee98ce98474f05c0def91ed827a545b8 100644 (file)
@@ -59,8 +59,10 @@ here-doc with \()
 here-doc terminated with a parenthesis
 ' # or a single back- or doublequote
 line terminated with a backslash
+       comsub-posix1.sub
 ./comsub-posix1.sub: line 1: syntax error near unexpected token `)'
 ./comsub-posix1.sub: line 1: `echo $( if x; then echo foo )'
+       comsub-posix2.sub
 swap32_posix is a function
 swap32_posix () 
 { 
@@ -76,6 +78,8 @@ swap32_posix ()
                 ));
     done
 }
+       comsub-posix3.sub
+       comsub-posix5.sub
 bash: -c: line 1: syntax error near unexpected token `done' while looking for matching `)'
 bash: -c: line 1: `: $(case x in x) ;; x) done esac)'
 bash: -c: line 1: syntax error near unexpected token `done' while looking for matching `)'
@@ -86,6 +90,7 @@ bash: -c: line 1: syntax error near unexpected token `in' while looking for matc
 bash: -c: line 1: `: $(case x in esac|in) foo;; esac)'
 bash: -c: line 1: syntax error near unexpected token `done' while looking for matching `)'
 bash: -c: line 1: `: $(case x in x) ;; x) done)'
+       comsub-posix6.sub
 case: -c: line 3: syntax error near unexpected token `esac' while looking for matching `)'
 case: -c: line 3: `$( esac ; bar=foo ; echo "$bar")) echo bad 2;;'
 ok 2
index ab7cd295d7caee58809ab96a6973509ddfc88016..7eaa0fb7cd3419e2525ff7e488658e6939d6393a 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 : ${HOME:=/}
 
 # works right
@@ -233,13 +235,13 @@ echo $(
        echo line terminated with a backslash # \
 )
 
-${THIS_SH} ./comsub-posix1.sub
-${THIS_SH} ./comsub-posix2.sub
-${THIS_SH} ./comsub-posix3.sub
+test_runsub ./comsub-posix1.sub
+test_runsub ./comsub-posix2.sub
+test_runsub ./comsub-posix3.sub
 
-#${THIS_SH} ./comsub-posix4.sub
-${THIS_SH} ./comsub-posix5.sub
-${THIS_SH} ./comsub-posix6.sub
+#test_runsub ./comsub-posix4.sub
+test_runsub ./comsub-posix5.sub
+test_runsub ./comsub-posix6.sub
 
 # produced a parse error through bash-4.0-beta2
 : $(echo foo)"
index 5c856400ddd561034c17ff549cb75649c018507c..fba79392db2fef961c4bccc7c6d56324d1d23106 100644 (file)
@@ -1,4 +1,4 @@
-./comsub.tests: line 19: hijkl: command not found
+./comsub.tests: line 21: hijkl: command not found
 argv[1] = <ab>
 argv[2] = <cd>
 argv[1] = <abmn>
@@ -25,6 +25,7 @@ blank ----
 blank ----
 blank ----
 func: v = comsub
+       comsub1.sub
 #esac
 a
 ok 1
@@ -35,10 +36,12 @@ ok 5
 ok 6
 xyz
 ok 7
+       comsub2.sub
 \/tmp\/foo\/bar
 /tmp/foo/bar
 /tmp/foo/bar
 /tmp/foo/bar
+       comsub3.sub
 1
 2
 3
@@ -55,12 +58,14 @@ b
 c
 1
 2
+       comsub4.sub
 d \
 g
 d \
 g
 d \
 g
+       comsub5.sub
 ok 1
 ok 2
 ok 3
@@ -71,6 +76,7 @@ ok 7
 ok 9
 ok 8
 ok 8 
+       comsub6.sub
 Mon Aug 29 20:03:02 EDT 2022
 post foo
 Mon Aug 29 20:03:02 EDT 2022
@@ -82,6 +88,7 @@ Mon Aug 29 20:03:02 EDT 2022
 hey after x
 ./comsub6.sub: line 40: syntax error near unexpected token `)'
 ./comsub6.sub: line 40: `math1)'
+       comsub7.sub
 123
 123
 0
index b4ae69b2fd13c38c3d78595e935b76aa9e957d0d..2bbdd89efc17b6fb8562a7f0eaa0a21cf941796f 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 # command substution parsing tests
 
 TABSIZE=`grep -v '^[ #]' $CAPS </dev/null | grep -v "^$" | grep -v "^capalias"| grep -v "^infoalias" | wc -l`
@@ -100,10 +102,10 @@ func()
 }
 func
 
-${THIS_SH} ./comsub1.sub
-${THIS_SH} ./comsub2.sub
-${THIS_SH} ./comsub3.sub
-${THIS_SH} ./comsub4.sub
-${THIS_SH} ./comsub5.sub
-${THIS_SH} ./comsub6.sub
-${THIS_SH} ./comsub7.sub
+test_runsub ./comsub1.sub
+test_runsub ./comsub2.sub
+test_runsub ./comsub3.sub
+test_runsub ./comsub4.sub
+test_runsub ./comsub5.sub
+test_runsub ./comsub6.sub
+test_runsub ./comsub7.sub
index 8735978862531eb92134cab230283d692350f3ae..2352303aa1dba1b3f633276a2a67117f97810890 100644 (file)
@@ -19,14 +19,14 @@ argv[1] = <>
 argv[1] = <>
 aa,bb
 JOBaa bb cc ddCONTROL
-./comsub2.tests: line 68: p: command not found
+./comsub2.tests: line 69: p: command not found
 NOTFOUND
-./comsub2.tests: line 75: p: command not found
-./comsub2.tests: line 75: p: command not found
+./comsub2.tests: line 76: p: command not found
+./comsub2.tests: line 76: p: command not found
 expand_aliases         off
 expand_aliases         off
 outside:
-./comsub2.tests: line 79: alias: p: not found
+./comsub2.tests: line 80: alias: p: not found
 alias e='echo inside redefine'
 expand_aliases         off
 1
@@ -34,7 +34,7 @@ expand_aliases        on
 2
 expand_aliases         on
 outside:
-./comsub2.tests: line 89: alias: p: not found
+./comsub2.tests: line 90: alias: p: not found
 expand_aliases         on
 1
 xx
@@ -62,6 +62,7 @@ one two
 42
 42
 42
+       comsub21.sub
 123
 123
 0
@@ -75,6 +76,7 @@ Mon Aug 29 20:03:02 EDT 2022
 123
 before 123
 in for 123
+       comsub22.sub
 outside before: value
 inside before: value
 inside after: funsub
@@ -82,6 +84,7 @@ inside: after false xxx
 outside after: funsub
 =====posix mode=====
 outside before: value
+       comsub23.sub
 .
 declare -a a=([0]="1" [1]="2" [2]="3" [3]="4")
 declare -- int="2"
@@ -104,6 +107,7 @@ uname
 after arith for
 1) a[${ break;}]
 #? after select
+       comsub24.sub
 a b c == 1 2 3
  == 1 2 3
 before return
@@ -115,6 +119,7 @@ declare -- IFS=" "
 *???
 *???
 yyy zzzz
+       comsub25.sub
 argv[1] = <AA^ABB>
 argv[1] = <AA^OBB>
 argv[1] = <AA^?BB>
@@ -178,6 +183,7 @@ argv[1] = <AA>
 argv[2] = <BB>
 argv[1] = <AA BB>
 argv[1] = <AA BB>
+       comsub26.sub
 inside1-inside2-outside
 BEFOREAA
 BB
index 73d378fff7ea8f76fcbba9827ef92ceefcfcac88..26d822fd85a4f3e685b950dacc7926c1d3099080 100644 (file)
@@ -11,7 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
-
+. ./test-aux-functions
+#
 # initial set of tests for ${Ccommand; } nofork command substitution
 
 # basic functionality
@@ -145,9 +146,9 @@ echo $(( ${ echo 14 + 18; }+ 10))
 echo ${ echo $(( 24+18 )); }
 
 # alias expansion and nested funsubs in other constructs
-${THIS_SH} ./comsub21.sub
-${THIS_SH} ./comsub22.sub
-${THIS_SH} ./comsub23.sub
-${THIS_SH} ./comsub24.sub
-${THIS_SH} ./comsub25.sub
-${THIS_SH} ./comsub26.sub
+test_runsub ./comsub21.sub
+test_runsub ./comsub22.sub
+test_runsub ./comsub23.sub
+test_runsub ./comsub24.sub
+test_runsub ./comsub25.sub
+test_runsub ./comsub26.sub
index 48aba422408b426de8d5a6bbb484ad11d68723e7..bf47b23ac930b43ffa97abb8f1615faee7756761 100644 (file)
@@ -12,7 +12,7 @@ returns: 0
 returns: 0
 returns: 1
 returns: 0
-./cond.tests: line 65: [[: X: integer expected
+./cond.tests: line 66: [[: X: integer expected
 returns: 2
 returns: 0
 returns: 1
@@ -29,7 +29,7 @@ returns: 0
 returns: 1
 returns: 1
 returns: 0
-./cond.tests: line 126: [[: 4+: arithmetic syntax error: operand expected (error token is "+")
+./cond.tests: line 127: [[: 4+: arithmetic syntax error: operand expected (error token is "+")
 returns: 1
 returns: 0
 returns: 0
@@ -60,6 +60,7 @@ ok c3
 ok c4
 ok c5
 ok c6
+       cond-regexp1.sub
 match 1
 match 2
 match 3
@@ -84,6 +85,7 @@ match control-a 2
 match control-a 3
 match control-a 4
 match control-a 5
+       cond-regexp2.sub
 ok 1
 ok 2
 ok 3
@@ -97,6 +99,7 @@ ok 9
 ok 10
 ok 11
 ok 12
+       cond-regexp3.sub
 argv[1] = <\^?>
 0
 1
@@ -148,6 +151,7 @@ ok 5
 ok 6
 ok 7
 ok 8
+       cond-error1.sub
 bash: -c: line 1: unexpected token `EOF', expected `)'
 bash: -c: line 2: syntax error: unexpected end of file from `[[' command on line 1
 bash: -c: line 1: unexpected EOF while looking for `]]'
@@ -181,6 +185,7 @@ bash: -c: line 1: syntax error near `<'
 bash: -c: line 1: `[[ -n < ]]'
 ERR: 22: -[[ -n $unset ]]- failed
 ERR: 28: -func- failed
+       cond-xtrace1.sub
 + [[ -t X ]]
 ./cond-xtrace1.sub: line 6: [[: X: integer expected
 + [[ '' > 7 ]]
index 110f702fee77ff39c87cc6a261efab72ec55cdd1..19a9ac53c075e4be4d4b91b3b3ca2e8ded45f5ad 100644 (file)
@@ -11,6 +11,7 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
 #
 # the test/[ code is tested elsewhere, and the [[...]] just uses the same
 # code.  this tests the special features of [[...]]
@@ -240,9 +241,9 @@ var=$'ab\001c'
 [[ $var == a* ]] && echo ok c5
 [[ $var == $'ab\001'* ]] && echo ok c6
 
-${THIS_SH} ./cond-regexp1.sub
-${THIS_SH} ./cond-regexp2.sub
-${THIS_SH} ./cond-regexp3.sub
+test_runsub ./cond-regexp1.sub
+test_runsub ./cond-regexp2.sub
+test_runsub ./cond-regexp3.sub
 
-${THIS_SH} ./cond-error1.sub
-${THIS_SH} ./cond-xtrace1.sub
+test_runsub ./cond-error1.sub
+test_runsub ./cond-xtrace1.sub
index e7b24eed44f51b67dde255827139f2097ec7cc17..ff575895637f4b7195f2e5022b6524f21d2a02ef 100755 (executable)
@@ -11,7 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
-
+. ./test-aux-functions
+#
 # first, let's start with the basics
 
 recho "$@"
@@ -240,96 +241,96 @@ esac
 
 # tests for the effect of quoting $* and $@ in an assignment context (plus
 # arrays) -- bugs through bash 4.2
-${THIS_SH} ./dollar-at-star1.sub
+test_runsub ./dollar-at-star1.sub
 
 # more tests for expanding $@ and $* in a context where there is no word
 # splitting
-${THIS_SH} ./dollar-at-star2.sub
-${THIS_SH} ./dollar-at-star3.sub
-${THIS_SH} ./dollar-at-star4.sub
-${THIS_SH} ./dollar-at-star5.sub
-${THIS_SH} ./dollar-at-star6.sub
-${THIS_SH} ./dollar-at-star7.sub
+test_runsub ./dollar-at-star2.sub
+test_runsub ./dollar-at-star3.sub
+test_runsub ./dollar-at-star4.sub
+test_runsub ./dollar-at-star5.sub
+test_runsub ./dollar-at-star6.sub
+test_runsub ./dollar-at-star7.sub
 
 # tests for expansions of $@ and ${a[@]} (vs. $* and ${a[*]}) on the RHS of
 # assignment statements with non-default IFS: $@ expands to args or array
 # members separated by spaces
-${THIS_SH} ./dollar-at-star8.sub
+test_runsub ./dollar-at-star8.sub
 
 # more tests of the expansions of $@ and $* (and their array equivalents)
 # with different values for IFS
-${THIS_SH} ./dollar-at-star9.sub
+test_runsub ./dollar-at-star9.sub
 
 # tests for expansions of "$*" and "$@" and their array equivalents when $1 == ''
 # and we're using the POSIX word expansions
-${THIS_SH} ./dollar-at-star10.sub
-${THIS_SH} ./dollar-at-star11.sub
+test_runsub ./dollar-at-star10.sub
+test_runsub ./dollar-at-star11.sub
 
 # tests for special expansion of "$*" and "${array[*]}" when used with other
 # expansions -- bugs through bash-2.05b
-${THIS_SH} ./dollar-star1.sub
+test_runsub ./dollar-star1.sub
 
 # tests for expansion of "$@" on rhs of things like ${param:+word}.  Bugs
 # though bash-2.05b
-${THIS_SH} ./dollar-at1.sub
+test_runsub ./dollar-at1.sub
 
 # tests for expansion of other variables in double-quoted strings containing
 # $@.  Bugs through bash-2.05b
-${THIS_SH} ./dollar-at2.sub
+test_runsub ./dollar-at2.sub
 
 # tests for various expansions of $* in different contexts -- word split,
 # no splitting, etc. when $IFS is NUL
-${THIS_SH} ./dollar-star2.sub
+test_runsub ./dollar-star2.sub
 
 # tests for expansions of "${array[*]}" and "${array[@]}" when $IFS is not the
 # default and the array contains null elements
-${THIS_SH} ./dollar-star3.sub
+test_runsub ./dollar-star3.sub
 
 # test for set -u and expansions of $@ when there are no positional parameters
-${THIS_SH} ./dollar-at3.sub
+test_runsub ./dollar-at3.sub
 # test for set -u and expansions of $* when there are no positional parameters
-${THIS_SH} ./dollar-star4.sub
+test_runsub ./dollar-star4.sub
 
 # tests for expansions of $* when IFS is null
-${THIS_SH} ./dollar-star5.sub
+test_runsub ./dollar-star5.sub
 
 # tests for inappropriate word splitting through bash-4.2
-${THIS_SH} ./dollar-at4.sub
+test_runsub ./dollar-at4.sub
 
 # tests for problems with "$@" preceded and followed by other quoted expansions
 # through bash-4.2
-${THIS_SH} ./dollar-at5.sub
+test_runsub ./dollar-at5.sub
 
 # tests for problems with "${@:1}" and other expansions with null entries
 # in positional parameters
-${THIS_SH} ./dollar-at6.sub
+test_runsub ./dollar-at6.sub
 
 # tests for expansions of $* when $1 == ""; problem through bash-4.2
-${THIS_SH} ./dollar-star6.sub
+test_runsub ./dollar-star6.sub
 
 # tests for expansions of $* (unquoted) when IFS changes (e.g., ${IFS:=-})
 # problem through bash-4.2
-${THIS_SH} ./dollar-star7.sub
+test_runsub ./dollar-star7.sub
 
 # tests for expansions of $* (unquoted) when IFS is null and word splitting is
 # not going to be performed.
 # problem through bash-4.4 in some parameter expansion contexts
-${THIS_SH} ./dollar-star8.sub
+test_runsub ./dollar-star8.sub
 
 # tests for expansions of "$@" when there are no positional parameter or when
 # $1 == '' and the expansion is preceded by something that results in a quoted
 # null string
-${THIS_SH} ./dollar-at7.sub
+test_runsub ./dollar-at7.sub
 
 # tests for expansions of $* when in an assignment context (no splitting) and
 # IFS is null
-${THIS_SH} ./dollar-star9.sub
+test_runsub ./dollar-star9.sub
 
 # more tests for expansions of $* when not splitting with IFS set or unset and
 # null strings as the positional parameters
-${THIS_SH} ./dollar-star10.sub
+test_runsub ./dollar-star10.sub
 
 # tests for expansions of $* when IFS=$'\1'
-${THIS_SH} ./dollar-star11.sub
+test_runsub ./dollar-star11.sub
 
 exit 0
index afb744840dce4ec72f1d9e14b795051cc884cc6a..b3b142d9997a2277edfdefd7be4f49c7110b1320 100644 (file)
@@ -95,6 +95,7 @@ ok 1
 ok 2
 ok 3
 ok 4
+       dollar-at-star1.sub
 var=${a[*]}   ... one:::two:three:::four
 var="${a[*]}" ... one:::two:three:::four
 var=$*        ... one:::two:three:::four
@@ -103,6 +104,7 @@ var=${a[@]}   ... one:::two three:::four
 var="${a[@]}" ... one:::two three:::four
 var=$@        ... one:::two three:::four
 var="$@"      ... one:::two three:::four
+       dollar-at-star2.sub
 ok 1
 ok 2
 ok 3
@@ -156,6 +158,7 @@ ok at 6
 ok at 7
 ok at 8
 ok at 9
+       dollar-at-star3.sub
 argv[1] = <a>
 argv[1] = <a>
 argv[1] = <a>
@@ -169,6 +172,7 @@ argv[1] = <o>
 argv[1] = <one>
 <123 abc> <def> <ghi 456> 
 <123 abc> <def> <ghi\ 456> 
+       dollar-at-star4.sub
 <c>
 a bc
 a b
@@ -199,6 +203,7 @@ argv[1] = <a b>
 <c>
 <d>
 <d>
+       dollar-at-star5.sub
 0
 0
 1
@@ -232,6 +237,7 @@ argv[1] = <>
 variable
 argv[1] = <>
 dollar-at
+       dollar-at-star6.sub
 argv[1] = <'a'>
 argv[2] = <'b'>
 argv[3] = <'c'>
@@ -269,6 +275,7 @@ argv[3] = <'c'>
 argv[1] = <'a'>
 argv[2] = <'b'>
 argv[3] = <'c'>
+       dollar-at-star7.sub
 |this|
 |is|
 |a|
@@ -297,11 +304,13 @@ argv[3] = <'c'>
 |is|
 |a|
 |test|
+       dollar-at-star8.sub
 
 a1=a b c a,b,c a b c a,b,c a b c a,b,c
 a2=a b c a,b,c a b c a,b,c a b c a,b,c
 a3=a b c a,b,c a b c a,b,c a b c a,b,c
 a4=a b c a,b,c a b c a,b,c a b c a,b,c
+       dollar-at-star9.sub
 argv[1] = <  >
 argv[1] = <  >
 argv[1] = <  >
@@ -399,6 +408,7 @@ argv[1] = <^?>
 argv[1] = <^?>
 argv[1] = <>
 argv[1] = <>
+       dollar-at-star10.sub
 argv[1] = <>
 argv[1] = <>
 argv[1] = <>
@@ -427,6 +437,7 @@ argv[1] = <>
 argv[1] = <>
 argv[1] = <>
 argv[1] = <>
+       dollar-at-star11.sub
 argv[1] = <>
 argv[1] = <>
 argv[1] = <>
@@ -466,6 +477,7 @@ argv[1] = <>
 argv[1] = <>
 argv[1] = </>
 1:1
+       dollar-star1.sub
 xa|xb|xc
 xa|xb|xc
 a|b|c
@@ -482,6 +494,7 @@ a|b|c
 a|b|c
 xa|xb|xc
 xa|xb|xc
+       dollar-at1.sub
 3
 3
 3
@@ -490,12 +503,14 @@ xa|xb|xc
 3
 3
 3
+       dollar-at2.sub
 argv[1] = <echo 1 ; echo 1>
 argv[1] = <echo 1 2 ; echo 1>
 argv[2] = <2>
 argv[1] = <echo 1 ; echo 1>
 argv[1] = <echo 1 2 ; echo 1>
 argv[2] = <2>
+       dollar-star2.sub
 argv[1] = <AB>
 argv[1] = <AB>
 argv[1] = <A BC D>
@@ -505,6 +520,7 @@ argv[1] = <A B>
 argv[2] = <C D>
 argv[1] = <A BC D>
 argv[1] = <A BC D>
+       dollar-star3.sub
 argv[1] = <fooq//barq/>
 argv[1] = <fooq>
 argv[2] = <>
@@ -520,23 +536,27 @@ argv[1] = <ooq>
 argv[2] = <>
 argv[3] = <arq>
 argv[4] = <>
+       dollar-at3.sub
 0
 bar
 
 after 1
 
 after 2
+       dollar-star4.sub
 0
 bar
 
 after 1
 
 after 2
+       dollar-star5.sub
 a b
 ab
 cd
 ok 1
 ok 2
+       dollar-at4.sub
 argv[1] = <a  b>
 argv[2] = <c  d>
 argv[1] = <a>
@@ -545,6 +565,7 @@ argv[3] = <c>
 argv[4] = <d>
 argv[1] = <a  b c  d>
 argv[1] = <a  b c  d>
+       dollar-at5.sub
 <1> <2> <3> <4> <5 1> 
 <1 1> <2> <3> <4> <5> 
 <11> <2> <3> <4> <51> 
@@ -596,6 +617,7 @@ ${@:2}c$1 c2 c3     #works as long as quoting omitted
 set y zcx c2 c3
 0
 declare -a c=([0]="y" [1]="zcx" [2]="c2" [3]="c3")
+       dollar-at6.sub
 argv[1] = <>
 argv[2] = <x>
 argv[1] = <>
@@ -617,6 +639,7 @@ argv[1] = <>
 argv[1] = <>
 argv[1] = <>
 argv[1] = <>
+       dollar-star6.sub
 argv[1] = <AwR>
 argv[1] = <AwR>
 argv[1] = <AR>
@@ -629,6 +652,7 @@ argv[1] = <A^?R>
 argv[1] = <AwR>
 argv[1] = <AwR>
 argv[1] = <A^?R>
+       dollar-star7.sub
 <a> <b> <ca> <b> <c-a-b-c> 
 after 1: IFS -
 argv[1] = <a-b-c>
@@ -645,6 +669,7 @@ argv[2] = <b>
 argv[3] = <c>
 argv[4] = <d>
 argv[1] = <a b c d>
+       dollar-star8.sub
 <3>
 <abc>
 <def ghi>
@@ -675,6 +700,7 @@ argv[1] = <a b c d>
 <def>
 <ghi>
 <jkl>
+       dollar-at7.sub
 argv[1] = <1>
 argv[2] = <>
 argv[1] = <2>
@@ -722,6 +748,7 @@ argv[1] = <1>
 argv[2] = <>
 argv[1] = <2>
 argv[2] = <>
+       dollar-star9.sub
 <12><12><12><12><12><12>
 <12><12><12><12><12><12>
 <12><'1''2'>
@@ -742,6 +769,8 @@ argv[2] = <2>
 var=1 2
 argv[1] = <1 2>
 argv[1] = <1 2>
+       dollar-star10.sub
+       dollar-star11.sub
 argv[1] = <^Aaa^Abb^Acc^A--^Add^A>
 argv[1] = <^A--^A>
 ok 1
index f46ebb11c54e6dcccb0c1ea1da3199fbb2aafca8..ac56c508e2a459557ebaca786931ff8840c75e86 100644 (file)
 unalias: usage: unalias [-a] name [name ...]
-./errors.tests: line 31: alias: -x: invalid option
+./errors.tests: line 33: alias: -x: invalid option
 alias: usage: alias [-p] [name[=value] ... ]
-./errors.tests: line 32: unalias: -x: invalid option
+./errors.tests: line 34: unalias: -x: invalid option
 unalias: usage: unalias [-a] name [name ...]
-./errors.tests: line 33: alias: hoowah: not found
-./errors.tests: line 34: unalias: hoowah: not found
-./errors.tests: line 37: `1': not a valid identifier
-./errors.tests: line 41: `f\1': not a valid identifier
-./errors.tests: line 45: `invalid-name': not a valid identifier
-./errors.tests: line 47: `f\1': not a valid identifier
-./errors.tests: line 50: `1': not a valid identifier
-./errors.tests: line 51: `f\1': not a valid identifier
-./errors.tests: line 52: `invalid-name': not a valid identifier
-./errors.tests: line 54: `1': not a valid identifier
-./errors.tests: line 55: `f\1': not a valid identifier
-./errors.tests: line 59: `$1': not a valid identifier
+./errors.tests: line 35: alias: hoowah: not found
+./errors.tests: line 36: unalias: hoowah: not found
+./errors.tests: line 39: `1': not a valid identifier
+./errors.tests: line 43: `f\1': not a valid identifier
+./errors.tests: line 47: `invalid-name': not a valid identifier
+./errors.tests: line 49: `f\1': not a valid identifier
+./errors.tests: line 52: `1': not a valid identifier
+./errors.tests: line 53: `f\1': not a valid identifier
+./errors.tests: line 54: `invalid-name': not a valid identifier
+./errors.tests: line 56: `1': not a valid identifier
+./errors.tests: line 57: `f\1': not a valid identifier
+./errors.tests: line 61: `$1': not a valid identifier
 declare -fr func
-./errors.tests: line 76: func: readonly function
-./errors.tests: line 79: unset: -x: invalid option
+./errors.tests: line 78: func: readonly function
+./errors.tests: line 81: unset: -x: invalid option
 unset: usage: unset [-f] [-v] [-n] [name ...]
-./errors.tests: line 82: unset: func: cannot unset: readonly function
-./errors.tests: line 85: declare: func: readonly function
-./errors.tests: line 89: declare: -a: invalid option
-./errors.tests: line 90: declare: -i: invalid option
-./errors.tests: line 94: unset: XPATH: cannot unset: readonly variable
-./errors.tests: line 100: unset: cannot simultaneously unset a function and a variable
-./errors.tests: line 103: declare: -z: invalid option
+./errors.tests: line 84: unset: func: cannot unset: readonly function
+./errors.tests: line 87: declare: func: readonly function
+./errors.tests: line 91: declare: -a: invalid option
+./errors.tests: line 92: declare: -i: invalid option
+./errors.tests: line 96: unset: XPATH: cannot unset: readonly variable
+./errors.tests: line 102: unset: cannot simultaneously unset a function and a variable
+./errors.tests: line 105: declare: -z: invalid option
 declare: usage: declare [-aAfFgiIlnrtux] [name[=value] ...] or declare -p [-aAfFilnrtux] [name ...]
-./errors.tests: line 105: declare: `-z': not a valid identifier
-./errors.tests: line 106: declare: `/bin/sh': not a valid identifier
-./errors.tests: line 110: declare: cannot use `-f' to make functions
-./errors.tests: line 113: exec: -i: invalid option
+./errors.tests: line 107: declare: `-z': not a valid identifier
+./errors.tests: line 108: declare: `/bin/sh': not a valid identifier
+./errors.tests: line 112: declare: cannot use `-f' to make functions
+./errors.tests: line 115: exec: -i: invalid option
 exec: usage: exec [-cl] [-a name] [command [argument ...]] [redirection ...]
-./errors.tests: line 120: export: XPATH: not a function
-./errors.tests: line 123: break: only meaningful in a `for', `while', or `until' loop
-./errors.tests: line 124: continue: only meaningful in a `for', `while', or `until' loop
-./errors.tests: line 127: shift: label: numeric argument required
-./errors.tests: line 132: shift: too many arguments
-./errors.tests: line 138: let: expression expected
-./errors.tests: line 141: local: can only be used in a function
-./errors.tests: line 144: logout: not login shell: use `exit'
-./errors.tests: line 147: hash: notthere: not found
-./errors.tests: line 150: hash: -v: invalid option
+./errors.tests: line 122: export: XPATH: not a function
+./errors.tests: line 125: break: only meaningful in a `for', `while', or `until' loop
+./errors.tests: line 126: continue: only meaningful in a `for', `while', or `until' loop
+./errors.tests: line 129: shift: label: numeric argument required
+./errors.tests: line 134: shift: too many arguments
+./errors.tests: line 140: let: expression expected
+./errors.tests: line 143: local: can only be used in a function
+./errors.tests: line 146: logout: not login shell: use `exit'
+./errors.tests: line 149: hash: notthere: not found
+./errors.tests: line 152: hash: -v: invalid option
 hash: usage: hash [-lr] [-p pathname] [-dt] [name ...]
-./errors.tests: line 153: hash: -d: option requires an argument
-./errors.tests: line 157: hash: hashing disabled
-./errors.tests: line 160: unset: [-2]: bad array subscript
-./errors.tests: line 164: AA: readonly variable
-./errors.tests: line 168: AA: readonly variable
-./errors.tests: line 176: shift: 5: shift count out of range
-./errors.tests: line 177: shift: -2: shift count out of range
+./errors.tests: line 155: hash: -d: option requires an argument
+./errors.tests: line 159: hash: hashing disabled
+./errors.tests: line 162: unset: [-2]: bad array subscript
+./errors.tests: line 166: AA: readonly variable
+./errors.tests: line 170: AA: readonly variable
 ./errors.tests: line 178: shift: 5: shift count out of range
 ./errors.tests: line 179: shift: -2: shift count out of range
-./errors.tests: line 182: shopt: no_such_option: invalid shell option name
-./errors.tests: line 183: shopt: no_such_option: invalid shell option name
-./errors.tests: line 184: shopt: no_such_option: invalid option name
-./errors.tests: line 187: umask: 09: octal number out of range
-./errors.tests: line 188: umask: `:': invalid symbolic mode character
-./errors.tests: line 189: umask: `:': invalid symbolic mode operator
-./errors.tests: line 192: umask: -i: invalid option
+./errors.tests: line 180: shift: 5: shift count out of range
+./errors.tests: line 181: shift: -2: shift count out of range
+./errors.tests: line 184: shopt: no_such_option: invalid shell option name
+./errors.tests: line 185: shopt: no_such_option: invalid shell option name
+./errors.tests: line 186: shopt: no_such_option: invalid option name
+./errors.tests: line 189: umask: 09: octal number out of range
+./errors.tests: line 190: umask: `:': invalid symbolic mode character
+./errors.tests: line 191: umask: `:': invalid symbolic mode operator
+./errors.tests: line 194: umask: -i: invalid option
 umask: usage: umask [-p] [-S] [mode]
-./errors.tests: line 196: umask: `p': invalid symbolic mode character
-./errors.tests: line 205: VAR: readonly variable
-./errors.tests: line 208: declare: VAR: readonly variable
-./errors.tests: line 209: declare: VAR: readonly variable
-./errors.tests: line 211: declare: unset: not found
-./errors.tests: line 214: VAR: readonly variable
+./errors.tests: line 198: umask: `p': invalid symbolic mode character
+./errors.tests: line 207: VAR: readonly variable
+./errors.tests: line 210: declare: VAR: readonly variable
+./errors.tests: line 211: declare: VAR: readonly variable
+./errors.tests: line 213: declare: unset: not found
+./errors.tests: line 216: VAR: readonly variable
 comsub: -c: line 1: syntax error near unexpected token `)'
 comsub: -c: line 1: `: $( for z in 1 2 3; do )'
 comsub: -c: line 1: syntax error near unexpected token `done' while looking for matching `)'
 comsub: -c: line 1: `: $( for z in 1 2 3; done )'
-./errors.tests: line 221: cd: HOME not set
-./errors.tests: line 222: cd: /tmp/xyz.bash: No such file or directory
-./errors.tests: line 224: cd: OLDPWD not set
-./errors.tests: line 225: cd: /bin/sh: Not a directory
-./errors.tests: line 227: cd: /tmp/cd-notthere: No such file or directory
-./errors.tests: line 229: cd: too many arguments
+./errors.tests: line 223: cd: HOME not set
+./errors.tests: line 224: cd: /tmp/xyz.bash: No such file or directory
+./errors.tests: line 226: cd: OLDPWD not set
+./errors.tests: line 227: cd: /bin/sh: Not a directory
+./errors.tests: line 229: cd: /tmp/cd-notthere: No such file or directory
+./errors.tests: line 231: cd: too many arguments
 bash: line 1: PWD: readonly variable
 1
 bash: line 1: OLDPWD: readonly variable
 1
-./errors.tests: line 236: .: filename argument required
+./errors.tests: line 238: .: filename argument required
 .: usage: . [-p path] filename [arguments]
-./errors.tests: line 237: source: filename argument required
+./errors.tests: line 239: source: filename argument required
 source: usage: source [-p path] filename [arguments]
-./errors.tests: line 240: .: -i: invalid option
+./errors.tests: line 242: .: -i: invalid option
 .: usage: . [-p path] filename [arguments]
-./errors.tests: line 243: set: -q: invalid option
+./errors.tests: line 245: set: -q: invalid option
 set: usage: set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [arg ...]
-./errors.tests: line 246: enable: sh: not a shell builtin
-./errors.tests: line 246: enable: bash: not a shell builtin
-./errors.tests: line 249: shopt: cannot set and unset shell options simultaneously
-./errors.tests: line 252: read: -x: invalid option
+./errors.tests: line 248: enable: sh: not a shell builtin
+./errors.tests: line 248: enable: bash: not a shell builtin
+./errors.tests: line 251: shopt: cannot set and unset shell options simultaneously
+./errors.tests: line 254: read: -x: invalid option
 read: usage: read [-Eers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]
-./errors.tests: line 255: read: var: invalid timeout specification
-./errors.tests: line 258: read: `/bin/sh': not a valid identifier
-./errors.tests: line 259: read: `/bin/sh': not a valid identifier
-./errors.tests: line 260: read: `invalid-name': not a valid identifier
-./errors.tests: line 263: VAR: readonly variable
-./errors.tests: line 266: read: XX: invalid file descriptor specification
-./errors.tests: line 267: read: 42: invalid file descriptor: Bad file descriptor
-./errors.tests: line 270: mapfile: XX: invalid file descriptor specification
-./errors.tests: line 271: mapfile: 42: invalid file descriptor: Bad file descriptor
-./errors.tests: line 275: mapfile: empty array variable name
-./errors.tests: line 276: mapfile: `invalid-var': not a valid identifier
-./errors.tests: line 279: readonly: -x: invalid option
+./errors.tests: line 257: read: var: invalid timeout specification
+./errors.tests: line 260: read: `/bin/sh': not a valid identifier
+./errors.tests: line 261: read: `/bin/sh': not a valid identifier
+./errors.tests: line 262: read: `invalid-name': not a valid identifier
+./errors.tests: line 265: VAR: readonly variable
+./errors.tests: line 268: read: XX: invalid file descriptor specification
+./errors.tests: line 269: read: 42: invalid file descriptor: Bad file descriptor
+./errors.tests: line 272: mapfile: XX: invalid file descriptor specification
+./errors.tests: line 273: mapfile: 42: invalid file descriptor: Bad file descriptor
+./errors.tests: line 277: mapfile: empty array variable name
+./errors.tests: line 278: mapfile: `invalid-var': not a valid identifier
+./errors.tests: line 281: readonly: -x: invalid option
 readonly: usage: readonly [-aAf] [name[=value] ...] or readonly -p
-./errors.tests: line 282: eval: -i: invalid option
+./errors.tests: line 284: eval: -i: invalid option
 eval: usage: eval [arg ...]
-./errors.tests: line 283: command: -i: invalid option
+./errors.tests: line 285: command: -i: invalid option
 command: usage: command [-pVv] command [arg ...]
-./errors.tests: line 286: /bin/sh + 0: arithmetic syntax error: operand expected (error token is "/bin/sh + 0")
-./errors.tests: line 287: /bin/sh + 0: arithmetic syntax error: operand expected (error token is "/bin/sh + 0")
-./errors.tests: line 290: trap: NOSIG: invalid signal specification
-./errors.tests: line 293: trap: -s: invalid option
+./errors.tests: line 288: /bin/sh + 0: arithmetic syntax error: operand expected (error token is "/bin/sh + 0")
+./errors.tests: line 289: /bin/sh + 0: arithmetic syntax error: operand expected (error token is "/bin/sh + 0")
+./errors.tests: line 292: trap: NOSIG: invalid signal specification
+./errors.tests: line 295: trap: -s: invalid option
 trap: usage: trap [-Plp] [[action] signal_spec ...]
-./errors.tests: line 299: return: can only `return' from a function or sourced script
-./errors.tests: line 303: break: 0: loop count out of range
-./errors.tests: line 307: continue: 0: loop count out of range
-./errors.tests: line 312: builtin: -x: invalid option
+./errors.tests: line 301: return: can only `return' from a function or sourced script
+./errors.tests: line 305: break: 0: loop count out of range
+./errors.tests: line 309: continue: 0: loop count out of range
+./errors.tests: line 314: builtin: -x: invalid option
 builtin: usage: builtin [shell-builtin [arg ...]]
-./errors.tests: line 315: builtin: bash: not a shell builtin
-./errors.tests: line 319: bg: no job control
-./errors.tests: line 320: fg: no job control
+./errors.tests: line 317: builtin: bash: not a shell builtin
+./errors.tests: line 321: bg: no job control
+./errors.tests: line 322: fg: no job control
 kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
-./errors.tests: line 324: kill: -s: option requires an argument
-./errors.tests: line 326: kill: S: invalid signal specification
-./errors.tests: line 328: kill: `': not a pid or valid job spec
+./errors.tests: line 326: kill: -s: option requires an argument
+./errors.tests: line 328: kill: S: invalid signal specification
+./errors.tests: line 330: kill: `': not a pid or valid job spec
 kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
-./errors.tests: line 332: kill: SIGBAD: invalid signal specification
-./errors.tests: line 334: kill: BAD: invalid signal specification
-./errors.tests: line 336: kill: `@12': not a pid or valid job spec
-./errors.tests: line 339: unset: BASH_LINENO: cannot unset
-./errors.tests: line 339: unset: BASH_SOURCE: cannot unset
-./errors.tests: line 342: set: trackall: invalid option name
-./errors.tests: line 343: set: -q: invalid option
+./errors.tests: line 334: kill: SIGBAD: invalid signal specification
+./errors.tests: line 336: kill: BAD: invalid signal specification
+./errors.tests: line 338: kill: `@12': not a pid or valid job spec
+./errors.tests: line 341: unset: BASH_LINENO: cannot unset
+./errors.tests: line 341: unset: BASH_SOURCE: cannot unset
+./errors.tests: line 344: set: trackall: invalid option name
+./errors.tests: line 345: set: -q: invalid option
 set: usage: set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [arg ...]
-./errors.tests: line 344: set: -i: invalid option
+./errors.tests: line 346: set: -i: invalid option
 set: usage: set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [arg ...]
-./errors.tests: line 348: xx: readonly variable
+./errors.tests: line 350: xx: readonly variable
 1
+       errors1.sub
 ./errors1.sub: line 14: .: -i: invalid option
 .: usage: . [-p path] filename [arguments]
 ./errors1.sub: line 22: shift: -4: shift count out of range
@@ -149,11 +150,14 @@ set: usage: set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [arg ...]
 ./errors1.sub: line 29: break: -5: loop count out of range
 ./errors1.sub: line 30: continue: -5: loop count out of range
 after f
+       errors2.sub
 ./errors2.sub: line 3: ${$NO_SUCH_VAR}: bad substitution
 1
+       errors3.sub
 ./errors3.sub: line 5: no_such_file: No such file or directory
 TEST
 ./errors3.sub: line 7: no_such_file: No such file or directory
+       errors4.sub
 1
 2
 ./errors4.sub: line 20: var: readonly variable
@@ -170,14 +174,17 @@ after readonly assignment
 3) 3
 #? ./errors4.sub: line 40: var: readonly variable
 ./errors4.sub: line 45: break: x: numeric argument required
+       errors4.sub
 1
 2
 ./errors4.sub: line 20: var: readonly variable
+       errors5.sub
 ./errors5.sub: line 6: array: unbound variable
 ./errors5.sub: line 7: array: unbound variable
 ./errors5.sub: line 8: array[7]: unbound variable
 ./errors5.sub: line 11: 7: unbound variable
 ./errors5.sub: line 12: 7: unbound variable
+       errors6.sub
 after 1: 1
 after 2: 1
 after 3: 1
@@ -201,6 +208,7 @@ unset
 ./errors6.sub: line 54: invalid-ident: invalid variable name
 ./errors6.sub: line 55: invalid-ident: invalid variable name
 ./errors6.sub: line 56: invalid-ident: invalid variable name
+       errors6.sub
 4
 array after 1: 0
 
@@ -221,6 +229,7 @@ unset
 ./errors6.sub: line 54: invalid-ident: invalid variable name
 ./errors6.sub: line 55: invalid-ident: invalid variable name
 ./errors6.sub: line 56: invalid-ident: invalid variable name
+       errors7.sub
 ./errors7.sub: line 21: x: readonly variable
 ./errors7.sub: line 21: notthere: command not found
 after no such command: 127
@@ -232,6 +241,7 @@ after special builtin: 0
 ./errors7.sub: line 27: x: readonly variable
 ./errors7.sub: line 29: x: readonly variable
 ./errors7.sub: line 32: v: readonly variable
+       errors7.sub
 ./errors7.sub: line 21: x: readonly variable
 after no such command: 1
 ./errors7.sub: line 23: x: readonly variable
@@ -240,6 +250,7 @@ after non-special builtin: 1
 ./errors7.sub: line 27: x: readonly variable
 ./errors7.sub: line 29: x: readonly variable
 ./errors7.sub: line 32: v: readonly variable
+       errors8.sub
 ./errors8.sub: eval: line 7: syntax error: unexpected end of file from `(' command on line 6
 ok 1
 ./errors8.sub: line 8: v: readonly variable
@@ -257,12 +268,14 @@ ok 7
 ./errors8.sub: line 17: .: -x: invalid option
 .: usage: . [-p path] filename [arguments]
 ok 8
+       errors9.sub
 DEBUG
 ./errors9.sub: line 6: [[: ++: arithmetic syntax error: operand expected (error token is "+")
 DEBUG
 ./errors9.sub: line 8: ((: -- : arithmetic syntax error: operand expected (error token is "- ")
 DEBUG
 ./errors9.sub: line 10: ((: -- : arithmetic syntax error: operand expected (error token is "- ")
+       errors10.sub
 invalid numeric argument
 bash: line 1: exit: abcde: numeric argument required
 after exit: 2
@@ -302,6 +315,7 @@ errors: line 3: break: too many arguments
 after break: 2
 errors: line 3: continue: too many arguments
 after continue: 2
+       errors11.sub
 bash: line 1: readonly: `non-identifier': not a valid identifier
 after: 1
 bash: line 1: export: `non-identifier': not a valid identifier
@@ -330,6 +344,7 @@ bash: line 1: readonly: `AA[4]': not a valid identifier
 array: 1
 sh: line 1: export: `AA[4]': not a valid identifier
 sh: line 1: readonly: `AA[4]': not a valid identifier
+       errors12.sub
 bash: -c: line 5: syntax error: unexpected end of file from `if' command on line 1
 bash: -c: line 3: syntax error: unexpected end of file from `while' command on line 1
 bash: -c: line 4: syntax error: unexpected end of file from `until' command on line 1
index d10935dc34e09d18b46bb7f4a87c8ef2085cd90b..45d6994e160588419110aea1bb94df87106d9f11 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 # These should all be safe
 LC_ALL=C
 LC_CTYPE=C
@@ -348,31 +350,34 @@ readonly xx=5
 echo $((xx=5))
 echo $?
 
-${THIS_SH} ./errors1.sub
-${THIS_SH} ./errors2.sub
-${THIS_SH} ./errors3.sub
-${THIS_SH} ./errors4.sub
+test_runsub ./errors1.sub
+test_runsub ./errors2.sub
+test_runsub ./errors3.sub
+test_runsub ./errors4.sub
+printf '\terrors4.sub\n'
 ${THIS_SH} -o posix ./errors4.sub
 
-${THIS_SH} ./errors5.sub
+test_runsub ./errors5.sub
 
-${THIS_SH} ./errors6.sub
+test_runsub ./errors6.sub
+printf '\terrors6.sub\n'
 THIS_SH="${THIS_SH} -o posix" ${THIS_SH} ./errors6.sub
 
-${THIS_SH} ./errors7.sub
+test_runsub ./errors7.sub
+printf '\terrors7.sub\n'
 ${THIS_SH} -o posix ./errors7.sub
 
-${THIS_SH} ./errors8.sub
-${THIS_SH} ./errors9.sub
+test_runsub ./errors8.sub
+test_runsub ./errors9.sub
 
 # invalid numeric arguments and too many arguments
-${THIS_SH} ./errors10.sub
+test_runsub ./errors10.sub
 
 # invalid identifiers to readonly/export
-${THIS_SH} ./errors11.sub
+test_runsub ./errors11.sub
 
 # EOF when parsing compound commands
-${THIS_SH} ./errors12.sub
+test_runsub ./errors12.sub
 
 ${THIS_SH} -c 'return ; echo after return' bash
 ${THIS_SH} -o posix -c 'return ; echo after return' bash
index bc30e5fc80b3d1113dcdbc9d36e69f48bfcac5b5..d14f7fffe96c62360e3dbb00e3dbe153b2a9af65 100644 (file)
@@ -5,14 +5,14 @@ after exec1.sub with args: 0
 
 after exec1.sub without args: 0
 after exec1.sub: one two three
-./execscript: line 37: notthere: command not found
+./execscript: line 39: notthere: command not found
 127
 we would do something here with notthere
 /tmp/bash: notthere: No such file or directory
 127
 /bin/sh: /bin/sh: cannot execute binary file
 126
-./execscript: line 64: /: Is a directory
+./execscript: line 66: /: Is a directory
 126
 /: /: Is a directory
 126
@@ -20,7 +20,7 @@ bash: line 1: exec: .: cannot execute: Is a directory
 posix-bash: line 1: exec: .: cannot execute: Is a directory
 bash: line 1: exec: .: cannot execute: Is a directory
 posix-bash: line 1: exec: .: cannot execute: Is a directory
-./execscript: line 79: .: /: is a directory
+./execscript: line 81: .: /: is a directory
 1
 126
 0
@@ -37,26 +37,30 @@ trap -- 'echo USR1' SIGUSR1
 trap -- 'rm -f x.sh x.output ; echo EXIT' EXIT
 USR1
 EXIT
-./execscript: line 103: notthere: command not found
-127
 ./execscript: line 105: notthere: command not found
 127
 ./execscript: line 107: notthere: command not found
 127
-./execscript: line 113: notthere: command not found
+./execscript: line 109: notthere: command not found
 127
 ./execscript: line 115: notthere: command not found
 127
 ./execscript: line 117: notthere: command not found
 127
+./execscript: line 119: notthere: command not found
+127
 this is sh
 this is sh
 unset
 ok
+       exec2.sub
 5
+       exec4.sub
+       exec5.sub
 ./exec5.sub: line 4: exec: bash-notthere: not found
 127
 this is ohio-state
+       exec6.sub
 0
 1
 1
@@ -78,8 +82,10 @@ this is ohio-state
 0
 1
 0
+       exec7.sub
 testb
 expand_aliases         on
+       exec9.sub
 1
 1
 1
@@ -88,6 +94,7 @@ expand_aliases        on
 0
 0
 0
+       exec10.sub
 /usr/local/bin:/usr/GNU/bin:/usr/bin:/bin:.
 cannot find cat in $TMPDIR
 cannot find cat with empty $PATH
@@ -95,6 +102,7 @@ PATH = /usr/local/bin:/usr/GNU/bin:/usr/bin:/bin:.
 cannot find cat in $TMPDIR with hash
 cannot find cat with empty $PATH with hash
 PATH = /usr/local/bin:/usr/GNU/bin:/usr/bin:/bin:.
+       exec11.sub
 trap -- 'echo foo $BASH_SUBSHELL' EXIT
 trap -- 'echo USR1 $BASHPID' SIGUSR1
 between
@@ -109,11 +117,17 @@ group pipeline: 1
 EXIT-group.1
 foo 0
 after
+       exec12.sub
 exit code: 1
+       exec12.sub
 exit code: 1
+       exec12.sub
 exit code: 1
+       exec12.sub
 exit code: 1
+       exec12.sub
 exit code: 1
+       exec12.sub
 exit code: 1
 a
 b
@@ -125,6 +139,7 @@ d
 c
 d
 e
+       exec13.sub
 x1
 x1a
 x2
@@ -133,6 +148,7 @@ x2b
 x3
 x3a
 x3b
+       exec14.sub
 WORKS
 done
 WORKS
@@ -189,6 +205,7 @@ w
 x
 y
 z
+       exec15.sub
 Darwin
 x
 archive
@@ -219,6 +236,7 @@ test
 sub3
 1 done
 42
+       exec16.sub
 test invert
 reached subshell
 reached group
@@ -247,6 +265,7 @@ reached AND-AND body
 reached OR-OR body
 reached AND-AND group
 reached OR-OR group
+       exec17.sub
 ./exec17.sub: line 26: exec: notthere: not found
 after failed exec: 127
 ./exec17.sub: line 31: exec: notthere: not found
index 15a9da8f01156f913070597adb5be4e0807c8d2f..df5a0203d5a464c19607552502ac56905e949eae 100644 (file)
@@ -18,6 +18,8 @@ if [ $UID -eq 0 ]; then
         echo "execscript: the test suite should not be run as root" >&2
 fi
 
+. ./test-aux-functions
+
 # this should succeed silently
 $cmd &
 
@@ -129,13 +131,13 @@ echo ${PATH-unset}
 
 echo "echo ok" | ${THIS_SH} -t
 
-${THIS_SH} ./exec2.sub
+test_runsub ./exec2.sub
 echo $?
 
-${THIS_SH} ./exec4.sub
+test_runsub ./exec4.sub
 
 # try exec'ing a command that cannot be found in $PATH
-${THIS_SH} ./exec5.sub
+test_runsub ./exec5.sub
 
 # this was a bug in bash versions before bash-2.04
 ${THIS_SH} -c 'cat </dev/null | cat >/dev/null' >&-
@@ -143,17 +145,17 @@ ${THIS_SH} -c 'cat </dev/null | cat >/dev/null' >&-
 # checks for proper return values in subshell commands with inverted return
 # values
 
-${THIS_SH} ./exec6.sub
+test_runsub ./exec6.sub
 
 # checks for properly deciding what constitutes an executable file
-${THIS_SH} ./exec7.sub
+test_runsub ./exec7.sub
 
 HISTFILE= ${THIS_SH} --norc -i ${PWD}/exec8.sub
 
-${THIS_SH} ./exec9.sub
+test_runsub ./exec9.sub
 
-${THIS_SH} ./exec10.sub
-${THIS_SH} ./exec11.sub
+test_runsub ./exec10.sub
+test_runsub ./exec11.sub
 
 true | `echo true` &
 
@@ -181,13 +183,13 @@ fi
 
 # problem with undoing redirections before running exit trap through bash-4.3
 
-${THIS_SH} ./exec12.sub false  # function
-${THIS_SH} ./exec12.sub command false
-${THIS_SH} ./exec12.sub $FALSE
+test_runsub ./exec12.sub false # function
+test_runsub ./exec12.sub command false
+test_runsub ./exec12.sub $FALSE
 
-${THIS_SH} ./exec12.sub notfound
-${THIS_SH} ./exec12.sub syntaxerror
-${THIS_SH} ./exec12.sub nosuchcommand
+test_runsub ./exec12.sub notfound
+test_runsub ./exec12.sub syntaxerror
+test_runsub ./exec12.sub nosuchcommand
 
 # problem with fork optimization in bash-4.4-alpha
 
@@ -197,14 +199,14 @@ $THIS_SH -c 'echo A && /bin/echo B'
 $THIS_SH -c '/bin/echo c && echo d'
 $THIS_SH -c '/bin/echo c && /bin/echo d && echo e'
 
-${THIS_SH} ./exec13.sub
-${THIS_SH} ./exec14.sub
+test_runsub ./exec13.sub
+test_runsub ./exec14.sub
 
 # problems with fork optimization in bash-5.2
-${THIS_SH} ./exec15.sub
+test_runsub ./exec15.sub
 
 # problems with set -e and inverting commands' return status
-${THIS_SH} ./exec16.sub
+test_runsub ./exec16.sub
 
 # test behavior of redirections when exec fails and does not exit the shell
-${THIS_SH} ./exec17.sub
+test_runsub ./exec17.sub
index bc2dae5e57719c753f0e5d973aa464cd639f1b45..ac4e014a7f7f704557ca0fabaad669d95472218b 100644 (file)
@@ -155,6 +155,7 @@ a b c
 argv[1] = <a>
 argv[2] = <b>
 argv[3] = <>
+       exp1.sub
 argv[1] = <^?>
 argv[1] = <^?>
 argv[1] = <^?>
@@ -180,20 +181,24 @@ argv[1] = <\^A^?>
 argv[1] = <\^A^?>
 argv[1] = <^\^A ^\^?>
 argv[1] = <^A ^_>
+       exp2.sub
 0.net
 0.net0
 
 0.net
 0.net
 0.net
+       exp3.sub
 graph
 yes
 a
 a
+       exp4.sub
  val
 val
  val
 no arg passed
+       exp5.sub
 hello
 [0;31m\]
 ]
@@ -202,6 +207,7 @@ hello
 
 hello
 eo
+       exp6.sub
 argv[1] = <a>
 argv[1] = <a>
 argv[1] = <^?>
@@ -229,6 +235,7 @@ argv[1] = <correct>
 argv[2] = <a>
 argv[1] = <correct>
 argv[2] = <a>
+       exp7.sub
 argv[1] = <^A>
 argv[1] = <3>
 argv[2] = <^C>
@@ -241,6 +248,7 @@ argv[1] = <XY^AYX>
 argv[1] = <XY>
 argv[2] = <Y>
 argv[1] = <XY^AY>
+       exp8.sub
 argv[1] = <x^Ay^?z>
 argv[1] = <x^Ay^?z>
 declare -- var=$'x\001y\177z'
@@ -258,6 +266,7 @@ declare -a array=([0]=$'x\001y\177z')
 argv[1] = <x^Ay^?z>
 declare -a array=([0]=$'x\001y\177z')
 declare -A array=([$'x\001y\177z']=$'a\242b\002c' )
+       exp9.sub
 abc
 def
 ghi
@@ -360,6 +369,7 @@ jkl
 []
 [foo]
 []
+       exp10.sub
 < A >< B >< A >< B >
 < A >< B >< A >< B >
 < A >< B >< a >< b >
@@ -371,6 +381,7 @@ jkl
 < A >< B >< a >< b >
 < A >< B >< A >< B >
 < A >< B ><' A '><' B '>
+       exp11.sub
 argv[1] = <1>
 argv[2] = <2>
 argv[1] = <1>
@@ -412,6 +423,7 @@ ok 6
 ok 7
 ok 8
 ok 9
+       exp12.sub
 argv[1] = <file.o>
 argv[1] = <posix>
 argv[1] = </src/cmd>
@@ -425,6 +437,7 @@ cdefg
 abcdefg
 abcde
 abcdefg
+       exp13.sub
 foo
 declare -- a="foo"
 7
index 8dc0a601b2684e6fab016fe101d98f0fbd168253..ca752fdc867341606636df97050e79ca1608328c 100644 (file)
@@ -19,6 +19,8 @@
 #
 # Chet Ramey
 
+. ./test-aux-functions
+
 #
 # If you comment out the body of this function, you can do a diff against
 # `expansion-tests.right' to see if the shell is behaving correctly
@@ -415,21 +417,16 @@ echo ${a//\?/ }
 
 ${THIS_SH} -c 'var=a:b: ; IFS=" :" ; recho $var""' bash
 
-${THIS_SH} ./exp1.sub
-
-${THIS_SH} ./exp2.sub
-
-${THIS_SH} ./exp3.sub
-
-${THIS_SH} ./exp4.sub
-
-${THIS_SH} ./exp5.sub
-
-${THIS_SH} ./exp6.sub
-${THIS_SH} ./exp7.sub
-${THIS_SH} ./exp8.sub
-${THIS_SH} ./exp9.sub
-${THIS_SH} ./exp10.sub
-${THIS_SH} ./exp11.sub
-${THIS_SH} ./exp12.sub
-${THIS_SH} ./exp13.sub
+test_runsub ./exp1.sub
+test_runsub ./exp2.sub
+test_runsub ./exp3.sub
+test_runsub ./exp4.sub
+test_runsub ./exp5.sub
+test_runsub ./exp6.sub
+test_runsub ./exp7.sub
+test_runsub ./exp8.sub
+test_runsub ./exp9.sub
+test_runsub ./exp10.sub
+test_runsub ./exp11.sub
+test_runsub ./exp12.sub
+test_runsub ./exp13.sub
index 32e2630809bc3a1bfdc7120cd2476a3dc633583a..a0125b7937001c71278c92b75e788126471bdf7b 100644 (file)
@@ -3,9 +3,12 @@ exportfunc ok 2
 ./exportfunc.tests: line 37: cve7169-bad: No such file or directory
 ./exportfunc.tests: eval: line 44: syntax error: unexpected end of file from `{' command on line 42
 ./exportfunc.tests: line 43: cve7169-bad2: No such file or directory
+       exportfunc1.sub
 ./exportfunc1.sub: line 14: maximum here-document count exceeded
-./exportfunc.tests: line 72: HELLO_WORLD: No such file or directory
-./exportfunc.tests: eval: line 83: unexpected EOF while looking for matching `}'
+       exportfunc2.sub
+./exportfunc.tests: line 74: HELLO_WORLD: No such file or directory
+./exportfunc.tests: eval: line 85: unexpected EOF while looking for matching `}'
+       exportfunc3.sub
 ./exportfunc3.sub: line 23: export: foo=bar: cannot export
 status: 1
 equals-1
index 64eb38bb2894fb2f29a6144b4ab943e45630220a..a112eba55a92179c208422f491c485b9096a8920 100644 (file)
@@ -44,9 +44,11 @@ eval  'X() { (a)>\' ; . ./bar 2>/dev/null
 rm -f cve7169-bad2 $TMPDIR/bar
 
 # CVE-2014-7186
+printf '\texportfunc1.sub\n'
 ${THIS_SH} ./exportfunc1.sub
 
 # CVE-2014-7187
+printf '\texportfunc2.sub\n'
 ${THIS_SH} ./exportfunc2.sub
 
 # CVE-2014-6277
@@ -90,4 +92,5 @@ unset -f foo
 env $'BASH_FUNC_#badname%%'=$'() { :; }\nfoo () { echo transform-4; }  ' ${THIS_SH} -c 'foo' 2>/dev/null
 
 # tests of exported names
+printf '\texportfunc3.sub\n'
 ${THIS_SH} ./exportfunc3.sub
index e01a60fb466ea42e1a4644bbb93e1552e904dde6..60e5aa0c8432a0b8724b5614befd20c3d379257c 100644 (file)
@@ -79,6 +79,7 @@ a b a,b a-b a.b a:b a;b a_b
 a b a,b a-b a.b a:b a;b a_b
 argv[1] = <ef>
 a,b
+       extglob1.sub
 a.c
 a.c
 a.c
@@ -88,10 +89,12 @@ a.c
 ok 1
 ok 2
 ok 3
+       extglob1a.sub
 a ab
 a ab
 a ab
 a
+       extglob3.sub
 *(.)
 a.log
 *(foo)
@@ -104,6 +107,7 @@ a.log
 *(foo|bar).*
 a.log
 a.log
+       extglob4.sub
 .x .y .z
 a b c
 .x .y .z a b c
@@ -113,7 +117,9 @@ a b c
 a b c
 .x .y .z a b c
 .x .y .z a b c
+       extglob5.sub
 *
+       extglob6.sub
 .b a
 .b a
 a .b
@@ -124,6 +130,7 @@ a .b
 a .b
 .b
 .b
+       extglob7.sub
 dotglob: .a .foo bar
 @(.foo)
 .foo
@@ -182,6 +189,7 @@ no dotglob: .a .foo bar
 ? . .. .a .foo
 *
 bar
+       extglob8.sub
 extglob                off
 x
 extglob                off
index ef5d7793c1fac66e8d9dbec362bd86d6a2e30abc..74f3f37dea3a770113ba58d036c4286a73c2ab7f 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+.  ./test-aux-functions
+#
 # test the ksh-like extended globbing features: [!@*?+](patlist)
 
 shopt -s extglob
@@ -384,13 +386,13 @@ foo=
 foo=${foo/#*([.])}
 unset foo
 
-${THIS_SH} ./extglob1.sub
-${THIS_SH} ./extglob1a.sub
-${THIS_SH} ./extglob3.sub
-${THIS_SH} ./extglob4.sub
-${THIS_SH} ./extglob5.sub
-${THIS_SH} ./extglob6.sub
-${THIS_SH} ./extglob7.sub
-${THIS_SH} ./extglob8.sub
+test_runsub ./extglob1.sub
+test_runsub ./extglob1a.sub
+test_runsub ./extglob3.sub
+test_runsub ./extglob4.sub
+test_runsub ./extglob5.sub
+test_runsub ./extglob6.sub
+test_runsub ./extglob7.sub
+test_runsub ./extglob8.sub
 
 exit 0
index da718d2179cc401fd196a51a2a6cb9cb6d38d4b8..30f3d8e277bd25bbaa98714262f3a7d385015dc2 100644 (file)
@@ -38,6 +38,7 @@ zf ()
 { 
     echo this is zf
 }
+       func1.sub
 f is a function
 f () 
 { 
@@ -118,6 +119,7 @@ testgrp ()
     } 1>&2;
     echo testgrp-b
 }
+       func2.sub
 funca is a function
 funca () 
 { 
@@ -141,6 +143,7 @@ foo-bar ()
 { 
     :
 }
+       func3.sub
 expect 5 10
 5 10
 expect 20
@@ -153,6 +156,7 @@ expect 2 40
 2 40
 expect 5 20
 5 20
+       func4.sub
 ./func4.sub: line 23: foo: maximum function nesting level exceeded (100)
 1
 after: f = 100
@@ -166,6 +170,7 @@ after FUNCNEST unset: f = 201
 ./func4.sub: line 23: foo: maximum function nesting level exceeded (20)
 1
 after FUNCNEST assign: f = 38
+       func5.sub
 ./func5.sub: line 31: `sys$read': not a valid identifier
 11111 () 
 { 
index 1a753af7832bc1cfec6c363dfb95143c3c1b8c5d..0a545da252d8416f61efad45219e446113771351 100644 (file)
@@ -17,6 +17,8 @@ if [ -n "$funcs" ]; then
         unset -f $funcs
 fi
 
+. ./test-aux-functions
+
 a()
 {
        x=$((x - 1))
@@ -168,20 +170,20 @@ ${THIS_SH} -c 'type -t zf'
 ${THIS_SH} -c 'type zf'
 unset -f zf
 
-${THIS_SH} ./func1.sub
+test_runsub ./func1.sub
 
 # tests for functions whose bodies are not group commands, with and without
 # attached redirections
-${THIS_SH} ./func2.sub
+test_runsub ./func2.sub
 
 # test for some posix-specific function behavior
-${THIS_SH} ./func3.sub
+test_runsub ./func3.sub
 
 # FUNCNEST testing
-${THIS_SH} ./func4.sub
+test_runsub ./func4.sub
 
 # function naming restrictions
-${THIS_SH} ./func5.sub
+test_runsub ./func5.sub
 
 unset -f myfunction
 myfunction() {
index f5a5262a73625fba66acd5c8559e5c2bdfa66091..810d1003d7e82c0bfa8e4a08e055b8d043d54581 100644 (file)
@@ -2,34 +2,45 @@ getopts: usage: getopts optstring name [arg ...]
 2
 getopts: usage: getopts optstring name [arg ...]
 2
-./getopts.tests: line 23: getopts: -a: invalid option
+./getopts.tests: line 25: getopts: -a: invalid option
 getopts: usage: getopts optstring name [arg ...]
+       getopts1.sub
 -a specified
 -b bval specified
 remaining args: one two three
+       getopts1.sub
 -a specified
 -b bval specified
 remaining args: one two three four five six seven eight nine ten eleven twelve
+       getopts1.sub
 ./getopts1.sub: option requires an argument -- b
 Usage: ./getopts1.sub [-a] [-b value] args
+       getopts2.sub
 -a specified
 -c cval specified
 -d specified
+       getopts3.sub
 -a specified
 -b 3 specified
 remaining args: one two three four five
+       getopts4.sub
 -a specified
 -b bval specified
 remaining args: one two three
+       getopts4.sub
 -a specified
 -b bval specified
 remaining args: one two three
+       getopts4.sub
 ./getopts4.sub: error: option `b' requires an argument
 Usage: ./getopts4.sub [-a] [-b value] args
+       getopts4.sub
 ./getopts4.sub: error: illegal option character `c'
 Usage: ./getopts4.sub [-a] [-b value] args
+       getopts4.sub
 -a specified
 remaining args: -b bval one two three
+       getopts5.sub
 OPTERR=0
 a here
 something else here
@@ -45,22 +56,29 @@ something else here
 getop: OPTIND=5
 OPTIND=3
 OPTERR=0
+       getopts6.sub
 -a specified
 remaining args: 
+       getopts6.sub
 -a specified
 remaining args: 
+       getopts6.sub
 -a specified
 remaining args: 
 0
+       getopts7.sub
 ./getopts7.sub: line 17: getopts: `opt-var': not a valid identifier
 remaining args: 
+       getopts8.sub
 opt: x
 opt: y
 opt: a
 opt: b
 opt: c
 opt: z
+       getopts9.sub
 $1 = a
+       getopts10.sub
 ./getopts10.sub: line 16: OPTARG: readonly variable
 OPTARG = x = ?
 unset x = ?
index 06cc29a2b0b76ced317953c372921edd137bf07b..06d599a27ae211f77f43c9bce9f72a9cc72db20d 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 # getopts tests
 # this should fail
 getopts
@@ -22,35 +24,35 @@ echo $?
 # used in error messages, but not yet
 getopts -a opts name
 
-${THIS_SH} ./getopts1.sub -a -b bval one two three
+test_runsub ./getopts1.sub -a -b bval one two three
 # make sure getopts works when there are more than 9 positional parameters
-${THIS_SH} ./getopts1.sub -a -b bval one two three four five six seven eight nine ten eleven twelve
-${THIS_SH} ./getopts1.sub -a -b 
+test_runsub ./getopts1.sub -a -b bval one two three four five six seven eight nine ten eleven twelve
+test_runsub ./getopts1.sub -a -b 
 
-${THIS_SH} ./getopts2.sub -ad -c cval three four five
+test_runsub ./getopts2.sub -ad -c cval three four five
 
-${THIS_SH} ./getopts3.sub
+test_runsub ./getopts3.sub
 
 # make sure that `-b bval' and `-bbval' are equivalent
-${THIS_SH} ./getopts4.sub -a -b bval one two three
-${THIS_SH} ./getopts4.sub -a -bbval one two three
+test_runsub ./getopts4.sub -a -b bval one two three
+test_runsub ./getopts4.sub -a -bbval one two three
 # this tests `silent' error reporting
-${THIS_SH} ./getopts4.sub -a -b
-${THIS_SH} ./getopts4.sub -a -c
+test_runsub ./getopts4.sub -a -b
+test_runsub ./getopts4.sub -a -c
 
 # make sure that `--' can be used to end the list of options
-${THIS_SH} ./getopts4.sub -a -- -b bval one two three
+test_runsub ./getopts4.sub -a -- -b bval one two three
 
-${THIS_SH} ./getopts5.sub -a -c
+test_runsub ./getopts5.sub -a -c
 
-${THIS_SH} ./getopts6.sub -a
-${THIS_SH} ./getopts6.sub -a -c
-${THIS_SH} ./getopts6.sub -ac
+test_runsub ./getopts6.sub -a
+test_runsub ./getopts6.sub -a -c
+test_runsub ./getopts6.sub -ac
 echo $? # this should be 2
 
-${THIS_SH} ./getopts7.sub -a
+test_runsub ./getopts7.sub -a
 
-${THIS_SH} ./getopts8.sub
-${THIS_SH} ./getopts9.sub
+test_runsub ./getopts8.sub
+test_runsub ./getopts9.sub
 
-${THIS_SH} ./getopts10.sub
+test_runsub ./getopts10.sub
index bde7e6312c9b313939ac95e1407ff01751f2cb79..95e8f3b6510f0f441779005049387e24e977ef3b 100644 (file)
@@ -1,4 +1,6 @@
+       glob1.sub
 foo/bar foobar/bar
+       glob2.sub
 ok 1
 ok 2
 ok 3
@@ -13,6 +15,7 @@ argv[1] = <a
 0000004
 ok 6
 ok 7
+       glob3.sub
 invalid bracket expression
 == LANG=C ==
 [[:alpha:]
@@ -64,6 +67,7 @@ ok 2
 ok 3
 ok 4
 ok 5
+       glob4.sub
 argv[1] = <a\?>
 a\?
 argv[1] = <a\?>
@@ -71,6 +75,7 @@ a\?
 a\a
 <define\/\
 />
+       glob5.sub
 ./tmp/a/b/c ./tmp/a/b/c ./tmp/a/b/c
 ./tmp/a/b/c ./tmp/a/b/c ./tmp/a/b/c
 ./tmp/a/b/c
@@ -99,6 +104,7 @@ argv[1] = <./tmp/>
 argv[1] = <\$foo>
 argv[2] = <\$foo>
 argv[1] = <mixed\$foo/>
+       glob6.sub
 <abcdefg>
 <\.>
 *abc.c
@@ -111,20 +117,25 @@ readable/\.
 searchable/.
 searchable/.
 searchable/.
+       glob7.sub
 1: [qwe/qwe]
 2: [qwe/
 3: [qwe/]
 4:
 5: [qwe/
 6:
+       glob8.sub
 a\*b
 a\\ 1*b*
+       glob9.sub
 é/*
 é/*
+       glob10.sub
 a aa b bb
 .a .aa .b .bb a aa b bb
 .a .aa .b .bb
 . .. .a .aa .b .bb
+       glob11.sub
 mailcheck.o make_cmd.o mksignames mksignames.o mksyntax mksyntax.dSYM
 
 mailcheck.o make_cmd.o mksignames mksignames.o mksyntax mksyntax.dSYM
@@ -157,7 +168,7 @@ argv[2] = <abc>
 argv[3] = <abd>
 argv[4] = <abe>
 tmp/l1 tmp/l2 tmp/*4 tmp/l3
-./glob.tests: line 67: no match: tmp/*4
+./glob.tests: line 69: no match: tmp/*4
 argv[1] = <bdir/>
 argv[1] = <*>
 argv[1] = <a*>
index bdb2b774cc7f4c0c8af6a532346952bf794ceaf3..db9d02b3095c5a2c16224871465d1ba22a4159d1 100644 (file)
@@ -20,18 +20,20 @@ expect()
 :      # if needed, change me to echo expect "$@"
 }
 
+. ./test-aux-functions
+
 # First, a test that bash-2.01.1 fails
-${THIS_SH} ./glob1.sub
-${THIS_SH} ./glob2.sub
-${THIS_SH} ./glob3.sub
-${THIS_SH} ./glob4.sub
-${THIS_SH} ./glob5.sub
-${THIS_SH} ./glob6.sub
-${THIS_SH} ./glob7.sub
-${THIS_SH} ./glob8.sub
-${THIS_SH} ./glob9.sub
-${THIS_SH} ./glob10.sub
-${THIS_SH} ./glob11.sub
+test_runsub ./glob1.sub
+test_runsub ./glob2.sub
+test_runsub ./glob3.sub
+test_runsub ./glob4.sub
+test_runsub ./glob5.sub
+test_runsub ./glob6.sub
+test_runsub ./glob7.sub
+test_runsub ./glob8.sub
+test_runsub ./glob9.sub
+test_runsub ./glob10.sub
+test_runsub ./glob11.sub
 
 MYDIR=$PWD     # save where we are
 
@@ -64,7 +66,7 @@ mkdir tmp
 touch tmp/l1 tmp/l2 tmp/l3
 builtin echo tmp/l[12] tmp/*4 tmp/*3
 shopt -s failglob
-builtin echo tmp/l[12] tmp/*4 tmp/*3
+( builtin echo tmp/l[12] tmp/*4 tmp/*3 ) 2>&1
 rm -r tmp
 shopt -u failglob
 
index c8211bc8f4c56a58adfa4e428aaa630e0a05ab69..78539a754d2e8976ea6e0fabbfb76006f594a3ed 100644 (file)
@@ -150,9 +150,11 @@ getenv.o
 input_avail.o
 itos.o
 alias.o builtins builtins/history.o builtins/jobs.o builtins/kill.o builtins/let.o builtins/mapfile.o lib lib/glob lib/glob/glob.o lib/glob/smatch.o lib/glob/strmatch.o lib/readline lib/readline/bind.o lib/readline/callback.o lib/readline/compat.o lib/readline/complete.o lib/readline/display.o lib/sh lib/sh/casemod.o lib/sh/clktck.o lib/sh/clock.o lib/sh/eaccess.o lib/sh/fdprintf.o lib/sh/fmtullong.o lib/sh/fmtulong.o lib/sh/fmtumax.o lib/sh/fpurge.o lib/sh/getenv.o lib/sh/input_avail.o lib/sh/itos.o pcomplib.o print_cmd.o redir.o shell.o sig.o stringlib.o subst.o syntax.o test.o trap.o unwind_prot.o variables.o version.o xmalloc.o y.tab.o
+       globstar1.sub
 bar/foo foo
 bar/foo/ foo/
 bar/foo/e bar/foo/f foo/a foo/b
+       globstar2.sub
 <a>
 <a/a>
 <a/a/a>
@@ -582,6 +584,7 @@ bar/foo/e bar/foo/f foo/a foo/b
 <b/b/a/a>
 <b/b/a/b>
 <b/b/b/a>
+       globstar3.sub
 a a/aa a/ab b b/bb b/bc c
 a/ b/ c/
 a/ab b b/bb
index 33714b4f14ecfe535c03ff4ac476c95d5fcf5e20..ce4157a88a657de65eba62015a24f8837994e083 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 : ${TMPDIR:=/var/tmp}
 dir=$PWD
 
@@ -51,6 +53,6 @@ echo **
 cd $dir
 rm -rf $GDIR
 
-${THIS_SH} ./globstar1.sub
-${THIS_SH} ./globstar2.sub
-${THIS_SH} ./globstar3.sub
+test_runsub ./globstar1.sub
+test_runsub ./globstar2.sub
+test_runsub ./globstar3.sub
index 214ef520da0ffaf837947f9e661bf4437da6df9b..5d751cc6fe38709bca6179118c9affb7fad126f0 100644 (file)
@@ -51,6 +51,7 @@ ENDOFINPUT
 
     aa=1
 }
+       heredoc1.sub
 foo is a function
 foo () 
 { 
@@ -70,7 +71,9 @@ qux
 
 bar
 qux
+       heredoc2.sub
 abc def geh
+       heredoc3.sub
 ./heredoc3.sub: line 20: warning: here-document at line 18 delimited by end-of-file (wanted `EOF')
 = here is the text =
 ./heredoc3.sub: line 26: warning: here-document at line 24 delimited by end-of-file (wanted `EOF')
@@ -96,6 +99,7 @@ hello
 end hello<NL>\END
 ./heredoc3.sub: line 98: warning: here-document at line 96 delimited by end-of-file (wanted `EOF')
 ./heredoc3.sub: line 99: syntax error: unexpected end of file from `(' command on line 96
+       heredoc4.sub
 heredoc1
 EOF
 Ok:0
@@ -104,6 +108,8 @@ argv[2] = <threefour>
 argv[1] = <two>
 argv[2] = <threefi>
 argv[3] = <ve>
+       heredoc5.sub
+       heredoc6.sub
 1: OK
 2: OK
 3: OK
@@ -124,6 +130,7 @@ argv[3] = <ve>
 5: ${x#$pat}
 6: ${y#$'not'}
 7: ${y#'not'}
+       heredoc7.sub
 ./heredoc7.sub: line 17: warning: command substitution: 1 unterminated here-document
 foo bar
 ./heredoc7.sub: line 21: after: command not found
@@ -131,6 +138,8 @@ foo bar
 ./heredoc7.sub: line 26: foobar: command not found
 ./heredoc7.sub: line 27: EOF: command not found
 grep: *.c: No such file or directory
+       heredoc8.sub
+       heredoc9.sub
 foo () 
 { 
     echo begin;
@@ -153,6 +162,7 @@ HERE
         echo 3 4;
     done
 }
+       heredoc10.sub
 hello
 world
 hello
@@ -162,7 +172,7 @@ here-doc line 2
 here-document
 here-document
 comsub here-string
-./heredoc.tests: line 184: warning: here-document at line 181 delimited by end-of-file (wanted `')
+./heredoc.tests: line 186: warning: here-document at line 183 delimited by end-of-file (wanted `')
 hi
 there
 ''
index d6431b8a7119163ea0b0899a49f17e258a2fbdfe..8c1bfc922733abc3279d4cafa329662a280fba90 100644 (file)
@@ -148,28 +148,30 @@ type fff
 export -f fff
 ${THIS_SH} -c 'type fff'
 
-${THIS_SH} ./heredoc1.sub
+. ./test-aux-functions
+
+test_runsub ./heredoc1.sub
 
 # test heredocs in command substitutions
-${THIS_SH} ./heredoc2.sub
-${THIS_SH} ./heredoc3.sub
-${THIS_SH} ./heredoc4.sub
+test_runsub ./heredoc2.sub
+test_runsub ./heredoc3.sub
+test_runsub ./heredoc4.sub
 
 # heredoc tests that use different size documents to test pipe implementation
-${THIS_SH} ./heredoc5.sub
+test_runsub ./heredoc5.sub
 
 # test $'...' and $"..." quoted strings in here-documents
-${THIS_SH} ./heredoc6.sub
+test_runsub ./heredoc6.sub
 
 # interaction between here-documents and command substitutions
-${THIS_SH} ./heredoc7.sub
-${THIS_SH} ./heredoc8.sub
+test_runsub ./heredoc7.sub
+test_runsub ./heredoc8.sub
 
 # various tests for printing here-documents in function bodies
-${THIS_SH} ./heredoc9.sub
+test_runsub ./heredoc9.sub
 
 # test various combinations of here-documents and aliases
-${THIS_SH} ./heredoc10.sub
+test_runsub ./heredoc10.sub
 
 echo $(
        cat <<< "comsub here-string"
index 4ac2cc65b3947a0dbabfb94bdaa2c2dc6d7cc888..e7810222997f772bed0c5f1ee2e124c20aa776eb 100644 (file)
@@ -32,6 +32,7 @@ echo $(echo hi)
 echo ho
 echo off to work we go
 declare -a uu=([0]="" [1]="kghfjk" [2]="jkfzuk" [3]=$'i\n')
+       herestr1.sub
 foo        bar
 foo        bar
 qux:::::bax
index c97fa4f23c8b067d0722d3e08810990a5d6e8175..a1f85136dcefebc16a55c0694d2b2052a58c87c9 100644 (file)
@@ -77,4 +77,5 @@ cat <<< "echo $(echo off to work we go)"
 IFS="/" read -r -d $'\000' -a uu <<< /kghfjk/jkfzuk/i
 declare -p uu
 
+printf '\therestr1.sub\n'
 ${THIS_SH} ./herestr1.sub
index cc8cb04d5b5204bc204f6b0261fbb76e93c2b83b..1c30fc871960e55c226442d08cea3d6c066e6300 100644 (file)
@@ -1,5 +1,5 @@
 echo $BASH_VERSION
-./histexp.tests: line 37: history: !!:z: history expansion failed
+./histexp.tests: line 39: history: !!:z: history expansion failed
     1  for i in one two three; do echo $i; done
     2  /bin/sh -c 'echo this is $0'
     3  ls
@@ -138,6 +138,7 @@ echo four ; echo two
 3
 echo $((1+2))
 3
+       histexp1.sub
 !
 !
 !
@@ -155,6 +156,7 @@ echo $((1+2))
 2 hi 0
 !
 !
+       histexp2.sub
 a
 b
 c
@@ -162,6 +164,7 @@ echo "#!/bin/bash" set -o posix
 #!/bin/bash set -o posix
 !!
 !!
+       histexp3.sub
 a
 echo $(echo echo a)
 echo a
@@ -197,6 +200,7 @@ echo i echo i
 j
 echo `echo j` echo j
 j echo j
+       histexp4.sub
 a
 cat < <(echo echo a)
 echo a
@@ -210,6 +214,7 @@ d
 e
 ! !
 ./histexp4.sub: line 33: !': event not found
+       histexp5.sub
 /tmp/Step1
 echo /$(echo tmp)/Step1
 /tmp/Step1
@@ -230,6 +235,7 @@ echo +(/one|/two|/three)/Step1
 *(/tmp|/dev|/usr)/Step1
 echo *(/tmp|/dev|/usr)/Step1
 *(/tmp|/dev|/usr)/Step1
+       histexp6.sub
 one
        echo echo one
 echo one
@@ -247,6 +253,7 @@ echo two
     1  echo two
     2  for f in a b c; do      echo echo two; done
     3  history
+       histexp7.sub
 a
 echo !!
 --between--
index 18a028161b6ae35969d3d628be3222a1450d1a17..2683cd4f7b1064654c2a1b3690e2d51258b91de7 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 LC_ALL=C
 LANG=C
 trap 'rm $TMPDIR/newhistory' 0
@@ -153,10 +155,10 @@ echo !$ ; echo !:2:p
 echo $((1+2))
 echo !!:1
 
-${THIS_SH} ./histexp1.sub
-${THIS_SH} ./histexp2.sub
-${THIS_SH} ./histexp3.sub
-${THIS_SH} ./histexp4.sub
-${THIS_SH} ./histexp5.sub
-${THIS_SH} ./histexp6.sub
-${THIS_SH} ./histexp7.sub
+test_runsub ./histexp1.sub
+test_runsub ./histexp2.sub
+test_runsub ./histexp3.sub
+test_runsub ./histexp4.sub
+test_runsub ./histexp5.sub
+test_runsub ./histexp6.sub
+test_runsub ./histexp7.sub
index 5e1ab36b9d4d47e341baaaf3e6b7c5bcfdd87117..7c12f3e1dfb538f5eee3326eef3b3db768a9cbc2 100644 (file)
@@ -1,7 +1,7 @@
-./history.tests: line 17: history: -x: invalid option
+./history.tests: line 19: history: -x: invalid option
 history: usage: history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]
-./history.tests: line 19: history: cannot use more than one of -anrw
-./history.tests: line 22: fc: -v: invalid option
+./history.tests: line 21: history: cannot use more than one of -anrw
+./history.tests: line 24: fc: -v: invalid option
 fc: usage: fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]
     1  for i in one two three; do echo $i; done
     2  /bin/sh -c 'echo this is $0'
@@ -97,7 +97,7 @@ line 2 for history
 6       HISTFILE=$TMPDIR/newhistory
 7       echo displaying \$HISTFILE after history -a
 8       cat $HISTFILE
-./history.tests: line 91: fc: no command found
+./history.tests: line 93: fc: no command found
    15  echo line 2 for history
    16  unset HISTSIZE
    17  unset HISTFILE
@@ -107,7 +107,7 @@ echo xx xb xc
 xx xb xc
 echo 44 48 4c
 44 48 4c
-./history.tests: line 106: fc: no command found
+./history.tests: line 108: fc: no command found
 aa
 bb
 cc
@@ -121,6 +121,7 @@ echo cc
 echo cc
 cc
 1
+       history1.sub
 one
 two
 three
@@ -142,10 +143,12 @@ two
 three
 (exit 42)
 42
+       history2.sub
 5.3
 echo ${BASH_VERSION%\.*}
 5.3
         echo ${BASH_VERSION%\.*}
+       history3.sub
 a
 b
 c
@@ -182,6 +185,7 @@ i
 
 ./history3.sub: line 48: history: @42: invalid number
 ./history3.sub: line 49: history: @42: numeric argument required
+       history4.sub
 
 0
 1
@@ -231,6 +235,7 @@ mid
 right)
 A
 B
+       history5.sub
 a
 b
 ./history5.sub: line 24: fc: history specification out of range
@@ -284,6 +289,7 @@ e
 6       echo a
 7       echo d
 8       echo e
+       history6.sub
 1
 2
 3
@@ -317,6 +323,7 @@ e
     7  echo 9
     8  echo 10
     5  echo 10
+       history7.sub
 $ 1
 $ 2
 $ 3
@@ -361,6 +368,7 @@ $ 1
 $ 2
 $ exit
 0
+       history8.sub
 a
 b
 c
@@ -372,6 +380,7 @@ d
     5  history
 ./history8.sub: line 15: history: 72: history position out of range
 ./history8.sub: line 16: history: -72: history position out of range
+       history9.sub
     1  echo below zero
     2  cat <<EOF
 
index fd3f65aab8432968f54b4b044027d755afd99520..213c75c4bf3b85397f74e8b70c767e6c774c9b56 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 trap 'rm $TMPDIR/newhistory' 0
 
 # bad options
@@ -124,14 +126,14 @@ set +o history
 shopt -q -o history
 echo $?
 
-${THIS_SH} ./history1.sub
+test_runsub ./history1.sub
 rm -f $TMPDIR/foohist-*
 
-${THIS_SH} ./history2.sub
-${THIS_SH} ./history3.sub
-${THIS_SH} ./history4.sub
-${THIS_SH} ./history5.sub
-${THIS_SH} ./history6.sub
-${THIS_SH} ./history7.sub
-${THIS_SH} ./history8.sub
-${THIS_SH} ./history9.sub
+test_runsub ./history2.sub
+test_runsub ./history3.sub
+test_runsub ./history4.sub
+test_runsub ./history5.sub
+test_runsub ./history6.sub
+test_runsub ./history7.sub
+test_runsub ./history8.sub
+test_runsub ./history9.sub
index 465efcf0e2a1b800c04a00b4d1aabe88a3b35d34..36431149c1d2325b94c8f9b9fca7c0a8d6970fa5 100644 (file)
@@ -8,5 +8,6 @@ a:b:c:d:e
 a:b:c:d:e
 a b c d e
 a b c d e
+       ifs1.sub
 argv[1] = <file>
 argv[1] = <*>
index 27f27dd662a41242f6c5d8122947c132ac9ddfca..90f0de7ba01ee1e08cd6f82ca1fbdd4e86df075e 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 OIFS="$IFS"
 IFS=":$IFS"
 eval foo="a:b:c"
@@ -73,4 +75,4 @@ echo $x
 
 IFS="$DEFIFS"
 
-${THIS_SH} ./ifs1.sub
+test_runsub ./ifs1.sub
index 7e25d29f8a84bd7dd894ac067ce4ae59600becfa..4943cb31036938cc1354e54896e862555e10103b 100644 (file)
@@ -8,20 +8,25 @@ ok 2
 aéb
 0000000 141 303 251 142
 0000004
+       intl1.sub
 -абвгдежзиклмноп - 16
 -абвгдежзиклмноп- 15
 -абвгд- 5
+       intl2.sub
 1,0000
 1.0000
 1.0000
 1.0000
 1.0000
 1,0000
+       intl3.sub
 1
 bytematch
 0000000 254 012
 0000002
+       unicode1.sub
 Passed all 1770 Unicode tests
+       unicode2.sub
 0000000 303 277 012
 0000003
 0000000 303 277 012
@@ -50,11 +55,13 @@ Passed all 1770 Unicode tests
 0000003
 0000000 101 040 302 243 040 305 222 012
 0000010
+       unicode3.sub
 ./unicode3.sub: line 5: $'5\247@3\231+\306S8\237\242\352\263': command not found
 ./unicode3.sub: line 7: cd: $'5\247@3\231+\306S8\237\242\352\263': No such file or directory
 $'5\247@3\231+\306S8\237\242\352\263'
 + : $'5\247@3\231+\306S8\237\242\352\263'
 + set +x
+       intl4.sub
 ಇಳಿಕೆಗಳು
 ಇಳ
 ಇ
index 2a4b26e0e1e32373b6dd807e9bb100e1c4e5b10a..5d86ec5a43f95bd79d29285db0c2b515ac6b7660 100644 (file)
@@ -54,17 +54,17 @@ printf '%s\n' "$*"
 printf '%s' "$*" | od -b | _intl_normalize_spaces
 
 # display differences make this problematic
-${THIS_SH} ./intl1.sub
+test_runsub ./intl1.sub
 
 # this tests both international handling in printf and temporary environments
-${THIS_SH} ./intl2.sub
+test_runsub ./intl2.sub
 
 # test splitting on characters instead of bytes
-${THIS_SH} ./intl3.sub
+test_runsub ./intl3.sub
 
-${THIS_SH} ./unicode1.sub # 2>/dev/null
-${THIS_SH} ./unicode2.sub
+test_runsub ./unicode1.sub # 2>/dev/null
+test_runsub ./unicode2.sub
 
-${THIS_SH} ./unicode3.sub 2>&1
+test_runsub ./unicode3.sub 2>&1
 
-${THIS_SH} ./intl4.sub
+test_runsub ./intl4.sub
index 304fc91d12abc592e0f16c8654457758d31a0f23..39e152b1ab8dc39c9f21f3511cc2d2acf44da756 100644 (file)
@@ -71,11 +71,13 @@ Shell options:
        -abefhkmnptuvxBCEHPT or -o option
 this-bash this-bash
 $- for -c includes c
+       invocation1.sub
 bash: line 0: badopt: invalid shell option name
 checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath
 checkhash:checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath
 cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath
 ./invocation1.sub: line 40: BASHOPTS: readonly variable
+       invocation2.sub
 braceexpand:hashall:interactive-comments
 braceexpand:hashall:interactive-comments
 hashall:interactive-comments
@@ -83,6 +85,7 @@ hashall:interactive-comments
 braceexpand:hashall:interactive-comments:noglob
 braceexpand:hashall:interactive-comments:noglob
 ./invocation2.sub: line 50: SHELLOPTS: readonly variable
+       invocation3.sub
 for i in 1 2 3;
 do
     select var in a b c;
index c629c297f2e74130c548c2867af1d490114c6099..17128cdd7f24026623a466b5a26ca8946e97b7ee 100644 (file)
@@ -11,6 +11,7 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
 
 : ${THIS_SH:=./bash}
 
@@ -34,12 +35,12 @@ unset BASH_ARGV0
 { ${THIS_SH} -c 'echo $-' bash | grep c >/dev/null; } && echo '$- for -c includes c'
 
 # BASHOPTS
-${THIS_SH} ./invocation1.sub
+test_runsub ./invocation1.sub
 # SHELLOPTS
-${THIS_SH} ./invocation2.sub
+test_runsub ./invocation2.sub
 
 # rudimentary pretty-print tests
-${THIS_SH} ./invocation3.sub
+test_runsub ./invocation3.sub
 
 : ${TMPDIR:=/tmp}
 TDIR=$TMPDIR/invocation-$$
index 9476128c39fca721f2b0730ed570a25427174b88..bb7c9cfa499a85880206d18a3a831864764d2ef8 100644 (file)
@@ -59,6 +59,7 @@ argv[1] = <aaa^?bbb>
 argv[1] = <ccc^?ddd>
 argv[1] = <eee^?fff>
 argv[1] = <ggg^?hhh>
+       iquote1.sub
 argv[1] = <xy>
 argv[1] = <xy>
 argv[1] = <xy>
index 8411c8abf195fbd582975386ea9110607046246f..cdbca4a58d898343685c2894520ae38a734ae1ca 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 # bug in bash up to and including bash-3.0 (including patches)
 #
 # problem is conflict between CTLNUL used internally to denote quoted null
@@ -155,4 +157,4 @@ recho ccc"\7f"ddd
 recho "eee\7ffff"
 recho ggg"$(echo $'\177')"hhh
 
-${THIS_SH} ./iquote1.sub
+test_runsub ./iquote1.sub
index 442b82600515a5c55b9e034b0ab82e04c42a8493..e35aae31e8d0c5b886a7fad69b944fd0a8c86f00 100644 (file)
@@ -1,5 +1,8 @@
+       jobs1.sub
+       jobs2.sub
 ./jobs2.sub: line 9: fg: job 1 started without job control
 fg: 1
+       jobs3.sub
 Waiting for job 0
 job 0 returns 0
 Waiting for job 1
@@ -16,6 +19,7 @@ Waiting for job 6
 job 6 returns 0
 Waiting for job 7
 job 7 returns 0
+       jobs4.sub
 [1]   Running                    sleep 2 &
 [2]   Running                    sleep 2 &
 [3]   Running                    sleep 2 &
@@ -24,6 +28,7 @@ job 7 returns 0
 4
 0
 i killed it
+       jobs5.sub
 12
 [1]-  Running                    sleep 20 &
 [3]+  Running                    sleep 20 &
@@ -35,18 +40,22 @@ i killed it
 ./jobs5.sub: line 71: declare: wpid: not found
 ./jobs5.sub: line 74: wait: `invalid-varname': not a valid identifier
 ./jobs5.sub: line 76: wait: WV: cannot unset: readonly variable
+       jobs6.sub
 child1 exit status 0
+       jobs7.sub
 [1]+ Running sleep 20 &
 ./jobs7.sub: line 5: fg: no current jobs
 [1]+ Running sleep 20 &
+       jobs8.sub
+       jobs9.sub
 got USR1
 0
-./jobs.tests: line 45: wait: %1: no such job
-./jobs.tests: line 50: fg: no job control
+./jobs.tests: line 47: wait: %1: no such job
+./jobs.tests: line 52: fg: no job control
 wait-for-pid
 wait-errors
-./jobs.tests: line 70: wait: `1-1': not a pid or valid job spec
-./jobs.tests: line 71: wait: `-4': not a pid or valid job spec
+./jobs.tests: line 72: wait: `1-1': not a pid or valid job spec
+./jobs.tests: line 73: wait: `-4': not a pid or valid job spec
 wait-for-background-pids
 async list wait-for-background-pids
 async list wait for child
@@ -55,7 +64,7 @@ wait-when-no-children
 posix jobs output
 [1]+  Done                       sleep 1
 wait-for-job
-./jobs.tests: line 96: wait: %2: no such job
+./jobs.tests: line 98: wait: %2: no such job
 127
 async list wait-for-job
 forked
@@ -68,21 +77,21 @@ sleep 2
 fg-bg 4
 sleep 2
 fg-bg 5
-./jobs.tests: line 123: fg: %2: no such job
-./jobs.tests: line 124: bg: job 1 already in background
+./jobs.tests: line 125: fg: %2: no such job
+./jobs.tests: line 126: bg: job 1 already in background
 fg-bg 6
-./jobs.tests: line 131: fg: -s: invalid option
+./jobs.tests: line 133: fg: -s: invalid option
 fg: usage: fg [job_spec]
-./jobs.tests: line 132: bg: -s: invalid option
+./jobs.tests: line 134: bg: -s: invalid option
 bg: usage: bg [job_spec ...]
-./jobs.tests: line 137: disown: -s: invalid option
+./jobs.tests: line 139: disown: -s: invalid option
 disown: usage: disown [-h] [-ar] [jobspec ... | pid ...]
-./jobs.tests: line 141: disown: %1: no such job
-./jobs.tests: line 144: disown: %2: no such job
-./jobs.tests: line 147: disown: warning: @12: job specification requires leading `%'
-./jobs.tests: line 147: disown: @12: no such job
+./jobs.tests: line 143: disown: %1: no such job
+./jobs.tests: line 146: disown: %2: no such job
+./jobs.tests: line 149: disown: warning: @12: job specification requires leading `%'
+./jobs.tests: line 149: disown: @12: no such job
 wait-for-non-child
-./jobs.tests: line 150: wait: pid 1 is not a child of this shell
+./jobs.tests: line 152: wait: pid 1 is not a child of this shell
 127
 3 -- 1 2 3 -- 1 - 2 - 3
 [1]   Running                    sleep 300 &
@@ -92,8 +101,8 @@ running jobs:
 [1]   Running                    sleep 300 &
 [2]-  Running                    sleep 350 &
 [3]+  Running                    sleep 400 &
-./jobs.tests: line 167: kill: %4: no such job
-./jobs.tests: line 169: jobs: %4: no such job
+./jobs.tests: line 169: kill: %4: no such job
+./jobs.tests: line 171: jobs: %4: no such job
 current job:
 [3]+  Running                    sleep 400 &
 previous job:
@@ -123,9 +132,9 @@ done
 after KILL -STOP, foregrounding %1
 sleep 4
 done
-./jobs.tests: line 229: jobs: -q: invalid option
+./jobs.tests: line 231: jobs: -q: invalid option
 jobs: usage: jobs [-lnprs] [jobspec ...] or jobs -x command [args]
-./jobs.tests: line 231: suspend: -z: invalid option
+./jobs.tests: line 233: suspend: -z: invalid option
 suspend: usage: suspend [-f]
-./jobs.tests: line 232: suspend: cannot suspend: no job control
-./jobs.tests: line 233: suspend: cannot suspend: no job control
+./jobs.tests: line 234: suspend: cannot suspend: no job control
+./jobs.tests: line 235: suspend: cannot suspend: no job control
index 4fa19b7cc45c0a858b6642d6c6df335b878ee1e2..1b98ba0c1fa2723c3fb0ac02465873ed70edb3cc 100644 (file)
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 # test out %+, jobs -p, and $! agreement in a subshell first
-${THIS_SH} ./jobs1.sub
+test_runsub ./jobs1.sub
 
 # test out fg/bg failure in a subshell
-${THIS_SH} ./jobs2.sub
+test_runsub ./jobs2.sub
 
 # test out behavior of waiting for background pids -- bug in versions
 # before 2.03
-${THIS_SH} ./jobs3.sub
+test_runsub ./jobs3.sub
 
 # test out behavior of using job control notation when job control is not
 # active
-${THIS_SH} ./jobs4.sub
+test_runsub ./jobs4.sub
 
 # test out wait -n framework
-${THIS_SH} ./jobs5.sub
+test_runsub ./jobs5.sub
 
 # test out wait -f framework
-${THIS_SH} ./jobs6.sub
+test_runsub ./jobs6.sub
 
-${THIS_SH} ./jobs7.sub
+test_runsub ./jobs7.sub
 # more disown -h tests
-${THIS_SH} ./jobs8.sub
+test_runsub ./jobs8.sub
 
 # wait interrupted by signal for which a trap has been set
-${THIS_SH} ./jobs9.sub
+test_runsub ./jobs9.sub
 
 jobs
 echo $?
index d311d6f8c34b4bd4489f965478821d2157ad5960..6c2b5feffb37a192e8f986214c53efc750aa255f 100644 (file)
@@ -8,7 +8,9 @@ last = c
 1 -- 0 0 1
 1 -- 0 1 0
 1 42
+       lastpipe1.sub
 lastpipe1.sub returns 14
+       lastpipe2.sub
 A1
 A2
 B1
@@ -19,5 +21,6 @@ A2
 B1
 B2
 HI -- 42 -- 0 42
+       lastpipe3.sub
 x=x
 x=x
index 2fc5e8e6440f3c1c5acc1270b3276b3e0e872379..e7239b38c6bfb854db47709cb1011b6767cb8d04 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 binfalse()
 {
        $binfalse || return 1   # normalize return value
@@ -70,8 +72,8 @@ binfalse | true | true | VAR=42
 echo $? $VAR
 set +o pipefail
 
-${THIS_SH} ./lastpipe1.sub
+test_runsub ./lastpipe1.sub
 echo lastpipe1.sub returns $?
 
-${THIS_SH} ./lastpipe2.sub
-${THIS_SH} ./lastpipe3.sub
+test_runsub ./lastpipe2.sub
+test_runsub ./lastpipe3.sub
index 4452232d59dbd53822c9bea04d25e63cd66456d9..3685e9f7e3cccf6957c70b184af282efde5911d2 100644 (file)
@@ -152,6 +152,7 @@ a
 [28] aaa
 [29] aaa
 declare -a array=([0]="a" [1]="b" [2]="c" [3]=$'\n')
+       mapfile1.sub
 1 2 3 4 5
 foo 0 1
 
@@ -163,6 +164,7 @@ foo 3 4
 
 foo 4 5
 
+       mapfile2.sub
 0 abc
 1 def
 2 ghi
index c2ea7d24d488a4ac819e4361db93e7fb1780ded4..a866a5f55462cbce3261ed0e575ec2043a407681 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 declare -a A
 mapfile A < mapfile.data
 for (( i = 0 ; i < ${#A[@]} ; i++ )); do
@@ -58,5 +60,5 @@ mapfile -t -d $'\xff' array <<<"$s"
 declare -p array
 unset -v s array
 
-${THIS_SH} ./mapfile1.sub
-${THIS_SH} ./mapfile2.sub
+test_runsub ./mapfile1.sub
+test_runsub ./mapfile2.sub
index ec424e0f3960657faf0bbc0c9025bd873643fecd..ef3ef710b8bd21bf1c2b1d38446a2b09f03a1714 100644 (file)
@@ -27,20 +27,23 @@ changevar: expect <three four five>
 argv[1] = <three four five>
 expect <three four five>
 argv[1] = <three four five>
-./nameref.tests: line 106: foo: readonly variable
-./nameref.tests: line 107: foo: readonly variable
+./nameref.tests: line 108: foo: readonly variable
+./nameref.tests: line 109: foo: readonly variable
 one
 one
-./nameref.tests: line 119: foo: readonly variable
-./nameref.tests: line 116: foo: readonly variable
+./nameref.tests: line 121: foo: readonly variable
+./nameref.tests: line 118: foo: readonly variable
 one
 abxde
 abxde
+       nameref1.sub
 one
 bar
 
+       nameref2.sub
 ./nameref2.sub: line 5: foo: readonly variable
 
+       nameref3.sub
 expect <unset>
 argv[1] = <unset>
 expect <unset>
@@ -57,6 +60,7 @@ two
 three
 unset
 four
+       nameref4.sub
 0
 expect <a b>
 a b
@@ -97,6 +101,7 @@ X
 expect <X>
 X
 errors = 0
+       nameref5.sub
 1
 2
 v1: 1
@@ -114,6 +119,7 @@ ref -> one, value: 1
 ref -> two, value: 2
 ref -> three, value: 3
 final state: ref -> three, value: 3
+       nameref6.sub
 ./nameref6.sub: line 15: typeset: x: nameref variable self references not allowed
 ./nameref6.sub: line 18: typeset: x[3]: reference variable cannot be an array
 ./nameref6.sub: line 25: typeset: x: reference variable cannot be an array
@@ -123,8 +129,10 @@ y -- 0
 2 -- 0
 2 -- 0
 y -- 0
+       nameref7.sub
 bar
 unset
+       nameref8.sub
 ./nameref8.sub: line 16: typeset: warning: v: circular name reference
 ./nameref8.sub: line 16: warning: v: circular name reference
 ./nameref8.sub: line 18: warning: v: maximum nameref depth (8) exceeded
@@ -143,10 +151,12 @@ local
 ./nameref8.sub: line 67: warning: x: circular name reference
 ./nameref8.sub: line 68: warning: x: circular name reference
 x =
+       nameref9.sub
 idx2
 idX2
 idx2
 idX2
+       nameref10.sub
 declare -n foo="x[\$zero]"
 42
 declare -a x=([0]="4")
@@ -180,6 +190,7 @@ declare -i bar="8"
 8
 declare -n foo="bar"
 ./nameref10.sub: line 77: typeset: bar: not found
+       nameref11.sub
 ./nameref11.sub: line 14: declare: `/': invalid variable name for name reference
 ./nameref11.sub: line 15: declare: `/': invalid variable name for name reference
 ./nameref11.sub: line 16: `/': not a valid identifier
@@ -210,33 +221,34 @@ x
 declare -a r=()
 ./nameref11.sub: line 33: declare: r: reference variable cannot be an array
 ./nameref11.sub: line 34: printf: `/': not a valid identifier
-./nameref11.sub: line 36: `': not a valid identifier
-./nameref11.sub: line 37: declare: `': not a valid identifier
 ./nameref11.sub: line 38: `': not a valid identifier
-./nameref11.sub: line 39: printf: `': not a valid identifier
-./nameref11.sub: line 40: declare: `': invalid variable name for name reference
+./nameref11.sub: line 39: declare: `': not a valid identifier
+./nameref11.sub: line 40: `': not a valid identifier
+./nameref11.sub: line 41: printf: `': not a valid identifier
+./nameref11.sub: line 42: declare: `': invalid variable name for name reference
 declare -r ROVAR="42"
-./nameref11.sub: line 45: ROVAR: readonly variable
-./nameref11.sub: line 45: ROVAR: cannot unset: readonly variable
+./nameref11.sub: line 47: ROVAR: readonly variable
+./nameref11.sub: line 47: ROVAR: cannot unset: readonly variable
 declare -r ROVAR="42"
 ./nameref11.sub
-./nameref11.sub: line 47: `@': not a valid identifier
+./nameref11.sub: line 49: `@': not a valid identifier
 ./nameref11.sub
 declare -n ref="x"
-./nameref11.sub: line 52: RO: readonly variable
+./nameref11.sub: line 54: RO: readonly variable
 declare -r RO_PID
-./nameref11.sub: line 52: RO: cannot unset: readonly variable
+./nameref11.sub: line 54: RO: cannot unset: readonly variable
 declare -r RO="x"
-./nameref11.sub: line 52: declare: RO_PID: not found
-./nameref11.sub: line 54: RO2: readonly variable
+./nameref11.sub: line 54: declare: RO_PID: not found
+./nameref11.sub: line 56: RO2: readonly variable
 declare -r RO2="a"
 2
-./nameref11.sub: line 65: typeset: `2': invalid variable name for name reference
+./nameref11.sub: line 67: typeset: `2': invalid variable name for name reference
 2
-./nameref11.sub: line 70: typeset: `2': invalid variable name for name reference
+./nameref11.sub: line 72: typeset: `2': invalid variable name for name reference
 2
-./nameref11.sub: line 75: foo[2]: invalid indirect expansion
-./nameref11.sub: line 76: bar: invalid indirect expansion
+./nameref11.sub: line 77: foo[2]: invalid indirect expansion
+./nameref11.sub: line 78: bar: invalid indirect expansion
+       nameref12.sub
 ./nameref12.sub: line 19: declare: `/': invalid variable name for name reference
 ./nameref12.sub: line 22: declare: `%': invalid variable name for name reference
 ./nameref12.sub: line 26: `^': not a valid identifier
@@ -262,6 +274,7 @@ declare -n ref
 declare -- ref="global"
 declare -a var=([0]="foo2")
 ./nameref12.sub: line 113: declare: global: not found
+       nameref13.sub
 declare -- a
 declare -n r="a"
 declare -- a
@@ -278,6 +291,7 @@ declare -n r
 declare -n foo
 ./nameref13.sub: line 110: typeset: `12345': invalid variable name for name reference
 declare -n foo
+       nameref14.sub
 declare -nx ref="var"
 var
 var
@@ -300,6 +314,7 @@ after
 declare -n ref="var"
 ./nameref14.sub: line 45: typeset: var: not found
 declare -n ref="var"
+       nameref15.sub
 ./nameref15.sub: line 14: local: warning: a: circular name reference
 ./nameref15.sub: line 14: warning: a: circular name reference
 ./nameref15.sub: line 14: `a[0]': not a valid identifier
@@ -356,6 +371,7 @@ declare -a v=([0]="0")
 declare -a xref=([1]="one")
 ./nameref15.sub: line 126: warning: xref: removing nameref attribute
 declare -a xref=([1]="one")
+       nameref16.sub
 declare -n r1="y"
 declare -n r2="x"
 ./nameref16.sub: line 25: typeset: x: not found
@@ -372,6 +388,7 @@ declare -n r1="y"
 declare -n r2="x"
 declare -- x="one"
 declare -- y="two"
+       nameref17.sub
 ./nameref17.sub: line 21: declare: bar: not found
 ./nameref17.sub: line 22: unset: foo0: cannot unset: readonly variable
 declare -nr foo0="bar"
@@ -409,6 +426,7 @@ declare -nr foo5
 declare -r foo5
 declare -nr foo5
 declare -r foo5
+       nameref18.sub
 ./nameref18.sub: line 15: mapfile: `XXX[0]': not a valid identifier
 ./nameref18.sub: line 16: declare: XXX[0]: not found
 ./nameref18.sub: line 22: `XXX[0]': not a valid identifier
@@ -450,6 +468,7 @@ argv[2] = <2>
 argv[3] = <31>
 argv[4] = <2>
 argv[5] = <3>
+       nameref19.sub
 declare -n foo="bar"
 declare -- foo="bar"
 ./nameref19.sub: line 22: declare: bar: not found
@@ -468,6 +487,7 @@ declare -- foo="bar"
 declare -- bar
 8
 declare -n ivar="foo"
+       nameref20.sub
 declare -a v=([0]="Y")
 r: <Y>
 v: <Y>
@@ -497,6 +517,7 @@ declare -- ref="Y"
 declare -- ref="Y"
 ./nameref20.sub: line 74: declare: var: not found
 declare -- ref="Y"
+       nameref21.sub
 declare -n ref="var"
 declare -A var=([2]="" )
 declare -n ref="var"
@@ -511,6 +532,7 @@ declare -n ref="var"
 declare -ai var=([1]="0")
 declare -n ref="var"
 declare -- var="1"
+       nameref22.sub
 a string with spaces
 many spaces
 declare -n foo="bar[0]"
@@ -532,6 +554,7 @@ declare -a array
 declare -ai array=([0]="one")
 declare -a array=([0]="zero")
 declare -a array=([0]="one" [1]="two" [2]="three")
+       nameref23.sub
 declare -ai a=([0]="5")
 declare -ai a=([0]="6")
 declare -ai a=([0]="42")
@@ -566,6 +589,7 @@ declare -ai a=([0]="0" [1]="16")
 12
 16
 declare -ai a=([0]="0" [1]="16")
+       nameref24.sub
 ./nameref24.sub: line 24: declare: `': not a valid identifier
 ./nameref24.sub: line 25: declare: `a&b': invalid variable name for name reference
 3
@@ -577,6 +601,7 @@ declare -ai a=([0]="0" [1]="16")
 3
 3
 5
+       nameref25.sub
 bash: line 1: a[k]: unbound variable
 ok 1
 bash: line 1: r0: unbound variable
index 3a6c5d98e11762db9e7a170b5c3afdab7dffffbb..ecb65633507fd6c7324447310182469fc9b34dac 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+
 # basic nameref tests
 bar=one
 flow=two
@@ -129,5 +131,5 @@ echo ${!x//c/x}
 echo ${v//c/x}
 
 for testfile in ./nameref[0-9].sub ./nameref[1-9][0-9].sub ; do
-       ${THIS_SH} "$testfile"
+       test_runsub "$testfile"
 done
index ea14c0db7a3bdded865033263e63df71a610f0c6..19de4ee65905a9811517a361f74fdc376e799b24 100644 (file)
@@ -33,6 +33,8 @@ declare -n r; mapfile r < /dev/null ; declare -p r; unset r ; unset -n r
 mapfile r < /dev/null; declare -n r ; unset r ; unset -n r
 declare -n r; printf -v r / ; unset -n r
 
+declare -n r ; declare -u r r ; unset -n r
+
 declare -n r; r="" ; unset -n r
 declare -n r="" ; unset -n r
 declare -n r; : ${r=} ; unset -n r
index d412e8ac2da56d7853ca967fae91166f4b22c644..ac720ac3bcc9303e6b3320421621578924d5cf92 100644 (file)
@@ -3,7 +3,7 @@ argv[1] = <foo>
 argv[1] = </usr/homes/chet>
 argv[1] = </usr/homes/chet>
 argv[1] = </usr/homes/chet>
-./new-exp.tests: line 41: HOME: }: arithmetic syntax error: operand expected (error token is "}")
+./new-exp.tests: line 43: HOME: }: arithmetic syntax error: operand expected (error token is "}")
 unset
 argv[1] = </usr/homes/chet>
 argv[1] = </usr/homes/chet>
@@ -59,7 +59,7 @@ argv[1] = <4>
 argv[1] = <op>
 argv[1] = <abcdefghijklmnop>
 argv[1] = <abcdefghijklmnop>
-./new-exp.tests: line 189: bad-var: invalid variable name
+./new-exp.tests: line 191: bad-var: invalid variable name
 argv[1] = <a>
 argv[2] = <b>
 argv[3] = <c>
@@ -67,8 +67,8 @@ argv[4] = <d>
 argv[1] = <a>
 argv[2] = <b c>
 argv[3] = <d>
-./new-exp.tests: line 202: ABX: unbound variable
-./new-exp.tests: line 206: $6: cannot assign in this way
+./new-exp.tests: line 204: ABX: unbound variable
+./new-exp.tests: line 208: $6: cannot assign in this way
 argv[1] = <xxcde>
 argv[1] = <axxde>
 argv[1] = <abxyz>
@@ -168,16 +168,8 @@ has
 multiple
 lines.
 This-string-has-multiple-lines.
-this is a test of proc subst
-this is test 2
-a
-./new-exp2.sub: line 55: /tmp/redir-notthere: No such file or directory
-1
-
-./new-exp2.sub: line 62: 1111111111111111111111: command not found
-
 argv[1] = <6>
-./new-exp.tests: line 307: ${#:}: bad substitution
+./new-exp.tests: line 300: ${#:}: bad substitution
 argv[1] = <'>
 argv[1] = <">
 argv[1] = <"hello">
@@ -412,60 +404,18 @@ argv[6] = <w>
 argv[7] = <x>
 argv[8] = <y>
 argv[9] = <z>
-./new-exp.tests: line 525: $9: unbound variable
-./new-exp.tests: line 526: 9: unbound variable
-./new-exp.tests: line 527: UNSET: unbound variable
-./new-exp.tests: line 528: UNSET: unbound variable
-./new-exp.tests: line 529: UNSET: unbound variable
-./new-exp.tests: line 530: UNSET: unbound variable
-./new-exp.tests: line 531: UNSET: unbound variable
+./new-exp.tests: line 518: $9: unbound variable
+./new-exp.tests: line 519: 9: unbound variable
+./new-exp.tests: line 520: UNSET: unbound variable
+./new-exp.tests: line 521: UNSET: unbound variable
+./new-exp.tests: line 522: UNSET: unbound variable
+./new-exp.tests: line 523: UNSET: unbound variable
+./new-exp.tests: line 524: UNSET: unbound variable
 argv[1] = <5>
 argv[1] = <#>
 argv[1] = <#>
 argv[1] = <>
-argv[1] = <_QUANTITY>
-argv[2] = <_QUART>
-argv[3] = <_QUEST>
-argv[4] = <_QUILL>
-argv[5] = <_QUOTA>
-argv[6] = <_QUOTE>
-argv[1] = <_QUANTITY>
-argv[2] = <_QUART>
-argv[3] = <_QUEST>
-argv[4] = <_QUILL>
-argv[5] = <_QUOTA>
-argv[6] = <_QUOTE>
-argv[1] = <_QUANTITY>
-argv[2] = <_QUART>
-argv[3] = <_QUEST>
-argv[4] = <_QUILL>
-argv[5] = <_QUOTA>
-argv[6] = <_QUOTE>
-argv[1] = <_QUANTITY-_QUART-_QUEST-_QUILL-_QUOTA-_QUOTE>
-argv[1] = <_QUANTITY>
-argv[2] = <_QUART>
-argv[3] = <_QUEST>
-argv[4] = <_QUILL>
-argv[5] = <_QUOTA>
-argv[6] = <_QUOTE>
-argv[1] = <_QUANTITY>
-argv[2] = <_QUART>
-argv[3] = <_QUEST>
-argv[4] = <_QUILL>
-argv[5] = <_QUOTA>
-argv[6] = <_QUOTE>
-./new-exp3.sub: line 36: ${!_Q* }: bad substitution
-./new-exp3.sub: line 41: ${!1*}: bad substitution
-./new-exp3.sub: line 43: ${!@*}: bad substitution
-Case01---3---A:B:C---
-Case02---1---A B C::---
-Case03---3---A:B:C---
-Case04---3---A:B:C---
-Case05---3---A:B:C---
-Case06---1---A B C::---
-Case07---3---A:B:C---
-Case08---3---A:B:C---
-./new-exp.tests: line 551: ${$(($#-1))}: bad substitution
+./new-exp.tests: line 538: ${$(($#-1))}: bad substitution
 argv[1] = <a>
 argv[2] = <b>
 argv[3] = <c>
@@ -482,8 +432,8 @@ argv[1] = <a>
 argv[1] = <a>
 argv[2] = <b>
 argv[1] = <>
-./new-exp.tests: line 570: $(($# - 2)): substring expression < 0
-./new-exp.tests: line 572: -2: substring expression < 0
+./new-exp.tests: line 557: $(($# - 2)): substring expression < 0
+./new-exp.tests: line 559: -2: substring expression < 0
 argv[1] = <bin>
 argv[2] = <bin>
 argv[3] = <ucb>
@@ -515,6 +465,78 @@ argv[1] = </full/path/to>
 argv[1] = </>
 argv[1] = <full/path/to/x16>
 argv[1] = <x16>
+h
+h
+--blah
+--blah
+lah
+lah
+abcde abcfg abchi
+foode foofg foohi
+argv[1] = </>
+argv[1] = </>
+
+1/##2/%3
+1/##2/##3
+1##2/%3
+1/%%2/#3
+1/%%2/%%3
+1%%2/#3
+       new-exp1.sub
+this is a test of proc subst
+this is test 2
+a
+       new-exp2.sub
+./new-exp2.sub: line 55: /tmp/redir-notthere: No such file or directory
+1
+
+./new-exp2.sub: line 62: 1111111111111111111111: command not found
+
+       new-exp3.sub
+argv[1] = <_QUANTITY>
+argv[2] = <_QUART>
+argv[3] = <_QUEST>
+argv[4] = <_QUILL>
+argv[5] = <_QUOTA>
+argv[6] = <_QUOTE>
+argv[1] = <_QUANTITY>
+argv[2] = <_QUART>
+argv[3] = <_QUEST>
+argv[4] = <_QUILL>
+argv[5] = <_QUOTA>
+argv[6] = <_QUOTE>
+argv[1] = <_QUANTITY>
+argv[2] = <_QUART>
+argv[3] = <_QUEST>
+argv[4] = <_QUILL>
+argv[5] = <_QUOTA>
+argv[6] = <_QUOTE>
+argv[1] = <_QUANTITY-_QUART-_QUEST-_QUILL-_QUOTA-_QUOTE>
+argv[1] = <_QUANTITY>
+argv[2] = <_QUART>
+argv[3] = <_QUEST>
+argv[4] = <_QUILL>
+argv[5] = <_QUOTA>
+argv[6] = <_QUOTE>
+argv[1] = <_QUANTITY>
+argv[2] = <_QUART>
+argv[3] = <_QUEST>
+argv[4] = <_QUILL>
+argv[5] = <_QUOTA>
+argv[6] = <_QUOTE>
+./new-exp3.sub: line 36: ${!_Q* }: bad substitution
+./new-exp3.sub: line 41: ${!1*}: bad substitution
+./new-exp3.sub: line 43: ${!@*}: bad substitution
+       new-exp4.sub
+Case01---3---A:B:C---
+Case02---1---A B C::---
+Case03---3---A:B:C---
+Case04---3---A:B:C---
+Case05---3---A:B:C---
+Case06---1---A B C::---
+Case07---3---A:B:C---
+Case08---3---A:B:C---
+       new-exp5.sub
 two
 one
 ne
@@ -534,14 +556,7 @@ one
 9
 4, A B C D
 2, C D
-h
-h
---blah
---blah
-lah
-lah
-abcde abcfg abchi
-foode foofg foohi
+       new-exp6.sub
 argv[1] = <>
 argv[1] = <+>
 argv[1] = <+^?>
@@ -558,6 +573,7 @@ argv[1] = <12>
 argv[1] = <>
 argv[1] = <>
 argv[1] = </tmp/test/TEST>
+       new-exp7.sub
 foo is a function
 foo () 
 { 
@@ -573,6 +589,7 @@ bar ()
 { 
     echo < <(cat x1)
 }
+       new-exp8.sub
 start;ing0;ing1;ing2;ing3;ing4;ing5;ing6;ing7;ing8;ing9;ing10;ing11;ing12;ing13;ing14;ing15;ing16;ing17;ing18;ing19;ing20;ing21;ing22;ing23;ing24;ing25;ing26;ing27;ing28;ing29;ing30;ing31;ing32;ing33;ing34;ing35;ing36;ing37;ing38;ing39;ing40;ing41;ing42;ing43;ing44;ing45;ing46;ing47;ing48;ing49;ing50;ing51;ing52;ing53;ing54;ing55;ing56;ing57;ing58;ing59;ing60;ing61;ing62;ing63;ing64;ing65;ing66;ing67;ing68;ing69;ing70;ing71;ing72;ing73;ing74;ing75;ing76;ing77;ing78;ing79;ing80;ing81;ing82;ing83;ing84;ing85;ing86;ing87;ing88;ing89;ing90;ing91;ing92;ing93;ing94;ing95;ing96;ing97;ing98;ing99;ing100;ing101;ing102;ing103;ing104;ing105;ing106;ing107;ing108;ing109;ing110;ing111;ing112;ing113;ing114;ing115;ing116;ing117;ing118;ing119;ing120;ing121;ing122;ing123;ing124;ing125;ing126;ing127;ing128;ing129;ing130;ing131;ing132;ing133;ing134;ing135;ing136;ing137;ing138;ing139;ing140;ing141;ing142;ing143;ing144;ing145;ing146;ing147;ing148;ing149;ing150;ing151;ing152;ing153;ing154;ing155;ing156;ing157;ing158;ing159;ing160;ing161;ing162;ing163;ing164;ing165;ing166;ing167;ing168;ing169;ing170;ing171;ing172;ing173;ing174;ing175;ing176;ing177;ing178;ing179;ing180;ing181;ing182;ing183;ing184;ing185;ing186;ing187;ing188;ing189;ing190;ing191;ing192;ing193;ing194;ing195;ing196;ing197;ing198;ing199;ing200;ing201;ing202;ing203;ing204;ing205;ing206;ing207;ing208;ing209;ing210;ing211;ing212;ing213;ing214;ing215;ing216;ing217;ing218;ing219;ing220;ing221;ing222;ing223;ing224;ing225;ing226;ing227;ing228;ing229;ing230;ing231;ing232;ing233;ing234;ing235;ing236;ing237;ing238;ing239;ing240;ing241;ing242;ing243;ing244;ing245;ing246;ing247;ing248;ing249;ing250;ing251;ing252;ing253;ing254;ing255;ing256;ing257;ing258;ing259;ing260;ing261;ing262;ing263;ing264;ing265;ing266;ing267;ing268;ing269;ing270;ing271;ing272;ing273;ing274;ing275;ing276;ing277;ing278;ing279;ing280;ing281;ing282;ing283;ing284;ing285;ing286;ing287;ing288;ing289;ing290;ing291;ing292;ing293;ing294;ing295;ing296;ing297;ing298;ing299;ing300;ing301;ing302;ing303;ing304;ing305;ing306;ing307;ing308;ing309;ing310;ing311;ing312;ing313;ing314;ing315;ing316;ing317;ing318;ing319;ing320;ing321;ing322;ing323;ing324;ing325;ing326;ing327;ing328;ing329;ing330;ing331;ing332;ing333;ing334;ing335;ing336;ing337;ing338;ing339;ing340;ing341;ing342;ing343;ing344;ing345;ing346;ing347;ing348;ing349;ing350;ing351;ing352;ing353;ing354;ing355;ing356;ing357;ing358;ing359;ing360;ing361;ing362;ing363;ing364;ing365;ing366;ing367;ing368;ing369;ing370;ing371;ing372;ing373;ing374;ing375;ing376;ing377;ing378;ing379;ing380;ing381;ing382;ing383;ing384;ing385;ing386;ing387;ing388;ing389;ing390;ing391;ing392;ing393;ing394;ing395;ing396;ing397;ing398;ing399;ing400;ing401;ing402;ing403;ing404;ing405;ing406;ing407;ing408;ing409;ing410;ing411;ing412;ing413;ing414;ing415;ing416;ing417;ing418;ing419;ing420;ing421;ing422;ing423;ing424;ing425;ing426;ing427;ing428;ing429;ing430;ing431;ing432;ing433;ing434;ing435;ing436;ing437;ing438;ing439;ing440;ing441;ing442;ing443;ing444;ing445;ing446;ing447;ing448;ing449;ing450;ing451;ing452;ing453;ing454;ing455;ing456;ing457;ing458;ing459;ing460;ing461;ing462;ing463;ing464;ing465;ing466;ing467;ing468;ing469;ing470;ing471;ing472;ing473;ing474;ing475;ing476;ing477;ing478;ing479;ing480;ing481;ing482;ing483;ing484;ing485;ing486;ing487;ing488;ing489;ing490;ing491;ing492;ing493;ing494;ing495;ing496;ing497;ing498;ing499;ing500;ing501;ing502;ing503;ing504;ing505;ing506;ing507;ing508;ing509;ing510;ing511;ing512;ing513;ing514;ing515;ing516;ing517;ing518;ing519;ing520;ing521;ing522;ing523;ing524;ing525;ing526;ing527;ing528;ing529;ing530;ing531;ing532;ing533;ing534;ing535;ing536;ing537;ing538;ing539;ing540;ing541;ing542;ing543;ing544;ing545;ing546;ing547;ing548;ing549;ing550;ing551;ing552;ing553;ing554;ing555;ing556;ing557;ing558;ing559;ing560;ing561;ing562;ing563;ing564;ing565;ing566;ing567;ing568;ing569;ing570;ing571;ing572;ing573;ing574;ing575;ing576;ing577;ing578;ing579;ing580;ing581;ing582;ing583;ing584;ing585;ing586;ing587;ing588;ing589;ing590;ing591;ing592;ing593;ing594;ing595;ing596;ing597;ing598;ing599;ing600;ing601;ing602;ing603;ing604;ing605;ing606;ing607;ing608;ing609;ing610;ing611;ing612;ing613;ing614;ing615;ing616;ing617;ing618;ing619;ing620;ing621;ing622;ing623;ing624;ing625;ing626;ing627;ing628;ing629;ing630;ing631;ing632;ing633;ing634;ing635;ing636;ing637;ing638;ing639;ing640;ing641;ing642;ing643;ing644;ing645;ing646;ing647;ing648;ing649;ing650;ing651;ing652;ing653;ing654;ing655;ing656;ing657;ing658;ing659;ing660;ing661;ing662;ing663;ing664;ing665;ing666;ing667;ing668;ing669;ing670;ing671;ing672;ing673;ing674;ing675;ing676;ing677;ing678;ing679;ing680;ing681;ing682;ing683;ing684;ing685;ing686;ing687;ing688;ing689;ing690;ing691;ing692;ing693;ing694;ing695;ing696;ing697;ing698;ing699;ing700;ing701;ing702;ing703;ing704;ing705;ing706;ing707;ing708;ing709;ing710;ing711;ing712;ing713;ing714;ing715;ing716;ing717;ing718;ing719;ing720;ing721;ing722;ing723;ing724;ing725;ing726;ing727;ing728;ing729;ing730;ing731;ing732;ing733;ing734;ing735;ing736;ing737;ing738;ing739;ing740;ing741;ing742;ing743;ing744;ing745;ing746;ing747;ing748;ing749;ing750;ing751;ing752;ing753;ing754;ing755;ing756;ing757;ing758;ing759;ing760;ing761;ing762;ing763;ing764;ing765;ing766;ing767;ing768;ing769;ing770;ing771;ing772;ing773;ing774;ing775;ing776;ing777;ing778;ing779;ing780;ing781;ing782;ing783;ing784;ing785;ing786;ing787;ing788;ing789;ing790;ing791;ing792;ing793;ing794;ing795;ing796;ing797;ing798;ing799;ing800;ing801;ing802;ing803;ing804;ing805;ing806;ing807;ing808;ing809;ing810;ing811;ing812;ing813;ing814;ing815;ing816;ing817;ing818;ing819;ing820;ing821;ing822;ing823;ing824;ing825;ing826;ing827;ing828;ing829;ing830;ing831;ing832;ing833;ing834;ing835;ing836;ing837;ing838;ing839;ing840;ing841;ing842;ing843;ing844;ing845;ing846;ing847;ing848;ing849;ing850;ing851;ing852;ing853;ing854;ing855;ing856;ing857;ing858;ing859;ing860;ing861;ing862;ing863;ing864;ing865;ing866;ing867;ing868;ing869;ing870;ing871;ing872;ing873;ing874;ing875;ing876;ing877;ing878;ing879;ing880;ing881;ing882;ing883;ing884;ing885;ing886;ing887;ing888;ing889;ing890;ing891;ing892;ing893;ing894;ing895;ing896;ing897;ing898;ing899;ing900;ing901;ing902;ing903;ing904;ing905;ing906;ing907;ing908;ing909;ing910;ing911;ing912;ing913;ing914;ing915;ing916;ing917;ing918;ing919;ing920;ing921;ing922;ing923;ing924;ing925;ing926;ing927;ing928;ing929;ing930;ing931;ing932;ing933;ing934;ing935;ing936;ing937;ing938;ing939;ing940;ing941;ing942;ing943;ing944;ing945;ing946;ing947;ing948;ing949;ing950;ing951;ing952;ing953;ing954;ing955;ing956;ing957;ing958;ing959;ing960;ing961;ing962;ing963;ing964;ing965;ing966;ing967;ing968;ing969;ing970;ing971;ing972;ing973;ing974;ing975;ing976;ing977;ing978;ing979;ing980;ing981;ing982;ing983;ing984;ing985;ing986;ing987;ing988;ing989;ing990;ing991;ing992;ing993;ing994;ing995;ing996;ing997;ing998;ing999
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -605,6 +622,7 @@ axd
 axxd
 axxd
 zzzz
+       new-exp9.sub
 a Value = 1 2 3 4 5
 a Sub = 0 1 2 3 4
 b Value = a b c d e
@@ -613,6 +631,7 @@ c Value = 10 20 40 80
 c Sub = 0 2 4 8
 <1> <2> <3> <4> <5> 
 <10> <20> <40> <80> 
+       new-exp10.sub
 <>
 <>
 <>
@@ -658,6 +677,7 @@ argv[1] = <^A^G^B[0:1]~\$ >
 argv[1] = </ bash$ >
 argv[1] = <1^J/ bash$ >
 ./new-exp10.sub: line 153: ${V@}: bad substitution
+       new-exp11.sub
 abcxxxdef
 abcÃ¥def
 ḅć
@@ -678,9 +698,11 @@ prependÃ¥
 Ã¥
 ḅć
 ḅć
+       new-exp12.sub
 HELLO;1 foo;2 foo;
 PASS;1 foo;2 foo;
 after: PASS
+       new-exp13.sub
 'zzz'
 'zzz'
 declare -rl VAR1
@@ -712,6 +734,7 @@ aaa bbb
 'aaa' 'bbb'
 a bbb
 aaa bb
+       new-exp14.sub
 'string'
 'string'
 'value with spaces'
@@ -728,6 +751,7 @@ argv[5] = <2>
 argv[6] = <two t>
 argv[7] = <3>
 argv[8] = <three t>
+       new-exp15.sub
 declare -a foo=()
 ai
 declare -ai foo
@@ -739,6 +763,7 @@ a
 a
 a
 a
+       new-exp16.sub
 /homes/chetdefg
 /homes/chetdefg
 ~defg
@@ -798,13 +823,4 @@ two
 &two
 otwone
 &twone
-argv[1] = </>
-argv[1] = </>
-
-1/##2/%3
-1/##2/##3
-1##2/%3
-1/%%2/#3
-1/%%2/%%3
-1%%2/#3
 ./new-exp.tests: line 1: ABXD: parameter unset
index 43c222096680abd311ec8a9d3810702ea77f45f8..05959ac283a067c9afd4f038e2d89a8871910a7e 100644 (file)
@@ -15,6 +15,8 @@ if (( $UID == 0 )); then
        echo "new-exp.tests: the test suite should not be run as root" >&2
 fi
 
+. ./test-aux-functions
+
 # must do this because posix mode causes process substitution to be disabled
 # and flagged as a syntax error, which causes the shell to exit
 set +o posix
@@ -292,15 +294,6 @@ echo "$BVAR"
 
 unset AVAR BVAR
 
-# run process substitution tests in a subshell so that syntax errors
-# caused by a shell not implementing process substitution (e.g., one
-# built on a NeXT) will not cause the whole test to exit prematurely
-${THIS_SH} ./new-exp1.sub
-
-# run the tests of $(<filename) in a subshell to avoid cluttering up
-# this script
-${THIS_SH} ./new-exp2.sub
-
 expect '<6>'
 recho ${#:-foo}
 expect $0: '${#:}: bad substitution'
@@ -540,12 +533,6 @@ recho "${RECEIVED:$((${#RECEIVED}-1)):1}"
 RECEIVED=""
 recho "${RECEIVED:$((${#RECEIVED}-1)):1}"
 
-# tests of new prefix expansion ${!prefix*}
-${THIS_SH} ./new-exp3.sub
-
-# bug with indirect expansion through bash-2.05b
-${THIS_SH} ./new-exp4.sub
-
 # these caused errors and core dumps in versions before bash-2.04
 c=""
 echo ${c//${$(($#-1))}/x/}
@@ -587,8 +574,6 @@ recho ${1%%[!/]*}
 recho ${1#*/}
 recho ${1##*/}
 
-${THIS_SH} ./new-exp5.sub
-
 unset var
 var=blah
 
@@ -608,37 +593,6 @@ echo ${var[*]//#abc/foo}
 echo ${var[*]/#abc/foo}
 unset var
 
-${THIS_SH} ./new-exp6.sub
-
-${THIS_SH} ./new-exp7.sub
-
-${THIS_SH} ./new-exp8.sub
-
-# tests to check whether things like indirect expansion of a variable whose
-# value is 'anothervar[@]' stop working
-${THIS_SH} ./new-exp9.sub
-
-# new parameter transformation `@' expansion operator
-${THIS_SH} ./new-exp10.sub
-
-# parameter substring replacement and removal operators with multibyte chars
-${THIS_SH} ./new-exp11.sub
-
-# indirect expansion with arrays and local variables
-${THIS_SH} ./new-exp12.sub
-
-# more indirect expansion and parameter transformation issues
-${THIS_SH} ./new-exp13.sub
-
-# new K parameter transformation operator
-${THIS_SH} ./new-exp14.sub
-
-# ongoing work with a/A parameter transformations and `nounset'
-${THIS_SH} ./new-exp15.sub
-
-# pattern substitution with `&' (quoted and unquoted) in the replacement string
-${THIS_SH} ./new-exp16.sub
-
 
 # problems with stray CTLNUL in bash-4.0-alpha
 unset a
@@ -667,5 +621,53 @@ echo "${b/\/#/%%}"
 
 unset a b
 
+# run process substitution tests in a subshell so that syntax errors
+# caused by a shell not implementing process substitution (e.g., one
+# built on a NeXT) will not cause the whole test to exit prematurely
+test_runsub ./new-exp1.sub
+
+# run the tests of $(<filename) in a subshell to avoid cluttering up
+# this script
+test_runsub ./new-exp2.sub
+
+# tests of new prefix expansion ${!prefix*}
+test_runsub ./new-exp3.sub
+
+# bug with indirect expansion through bash-2.05b
+test_runsub ./new-exp4.sub
+
+test_runsub ./new-exp5.sub
+
+test_runsub ./new-exp6.sub
+
+test_runsub ./new-exp7.sub
+
+test_runsub ./new-exp8.sub
+
+# tests to check whether things like indirect expansion of a variable whose
+# value is 'anothervar[@]' stop working
+test_runsub ./new-exp9.sub
+
+# new parameter transformation `@' expansion operator
+test_runsub ./new-exp10.sub
+
+# parameter substring replacement and removal operators with multibyte chars
+test_runsub ./new-exp11.sub
+
+# indirect expansion with arrays and local variables
+test_runsub ./new-exp12.sub
+
+# more indirect expansion and parameter transformation issues
+test_runsub ./new-exp13.sub
+
+# new K parameter transformation operator
+test_runsub ./new-exp14.sub
+
+# ongoing work with a/A parameter transformations and `nounset'
+test_runsub ./new-exp15.sub
+
+# pattern substitution with `&' (quoted and unquoted) in the replacement string
+test_runsub ./new-exp16.sub
+
 expect $0: 'ABXD: parameter unset'
 ${THIS_SH} -c 'recho ${ABXD:?"parameter unset"}' $0
index 31c35c3b4cd8e9ad5e0a8364ec561308b3b3fe5a..963da6ae005a5e117f1856d6d5e3b0a88c7d9fea 100644 (file)
@@ -39,9 +39,11 @@ argv[1] = <a^Ib^Ic>
 argv[1] = <$'a\tb\tc'>
                AD
 E
+       nquote1.sub
 hello' world
 hello world!
 hello' world!
+       nquote2.sub
 '  |  '
 '  |  '
 x  |  x
@@ -60,14 +62,17 @@ $'\''
 $'\'abcd\''
 '
 1
+       nquote3.sub
 argv[1] = <^?>
 0000000 del nl
 0000002
 0000000 esc fs gs rs us del nl
 0000007
 \q
+       nquote4.sub
 foo
 ./nquote4.sub: line 6: quux: command not found
+       nquote5.sub
 argv[1] = <a^A)b>
 argv[1] = <a^Ab>
 argv[1] = <^A>
index e4d1a56f2598cd4f05c6ba4b67958abfac4ec392..97224a00e19d451099fe1c9575c7d63f2e2e3e15 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 expect()
 {
         echo expect "$@"
@@ -135,8 +137,8 @@ recho "$'a\tb\tc'"
 # tests for $'...' being expanded in command substitution, and when
 echo "$(echo $'\t\t\101\104\n\105')"
 
-${THIS_SH} ./nquote1.sub
-${THIS_SH} ./nquote2.sub
-${THIS_SH} ./nquote3.sub
-${THIS_SH} ./nquote4.sub
-${THIS_SH} ./nquote5.sub
+test_runsub ./nquote1.sub
+test_runsub ./nquote2.sub
+test_runsub ./nquote3.sub
+test_runsub ./nquote4.sub
+test_runsub ./nquote5.sub
index 6424dba60ffc0210f540274b94394e4eacc3372c..673c55ce34968c0f24bde403abc859487f3701a3 100644 (file)
@@ -1,5 +1,7 @@
 bash: -c: line 1: unexpected EOF while looking for matching `)'
+       parser1.sub
 AAA
+       posix2syntax.sub
 bash5: line 1: `invalid-name': not a valid identifier
 in
 in
index 51f566855f7ae4a81f99b895ac6d6f2a6460445b..60e4437b5801ceb6a5a593011b9f1b9987092a1e 100644 (file)
@@ -1,4 +1,5 @@
 # catch-all for parsing problems that don't fit anywhere else
+. ./test-aux-functions
 
 # word_top issues in bash-5.2
 case x in x) if ((1)); then :; fi ;; esac
@@ -11,6 +12,6 @@ case x in x) if ((true ) ); then :; fi esac
 ${THIS_SH} -c '((X=([))]' bash
 
 # this has to be in a separate file to get desired EOF behavior
-${THIS_SH} ./parser1.sub
+test_runsub ./parser1.sub
 
-${THIS_SH} ./posix2syntax.sub
+test_runsub ./posix2syntax.sub
index 7204b960a99fc39d7abd94e4f53356c86e7bc006..6d8f3f76f52664bf39a08b857c2c11c3f057e8c2 100644 (file)
@@ -37,6 +37,10 @@ argv[1] = <'bar>
 argv[1] = <foo 'bar baz>
 argv[1] = <}z>
 argv[1] = <''z}>
+       posixexp1.sub
+       posixexp1.sub
+       posixexp2.sub
+       posixexp3.sub
 argv[1] = <1>
 argv[2] = <2>
 argv[1] = <1>
@@ -79,6 +83,7 @@ argv[1] = <1 2>
 argv[1] = <1 2>
 argv[1] = <12>
 argv[1] = <12>
+       posixexp4.sub
 normal IFS
 argv[1] = <abc>
 argv[2] = <def>
@@ -112,6 +117,7 @@ argv[2] = <def ghi>
 argv[3] = <jkl >
 argv[1] = < abc def ghi jkl >
 argv[1] = < abc def ghi jkl >
+       posixexp5.sub
 
 001: IFS = (unset): unset -v foo; set -- ${foo=$*}
 soh stx etx del   / soh stx etx del
@@ -256,6 +262,7 @@ soh stx etx del   / soh stx etx del
 
 048: IFS = sp  ht  nl: foo=; set -- "${foo:=$@}"
 soh stx etx del   / soh stx etx del
+       posixexp6.sub
 argv[1] = <^A^B^C^?>
 argv[1] = <^A^B^C^?>
 argv[1] = <^A^B^C^?>
@@ -275,6 +282,7 @@ argv[2] = <b>
 [  abc    def  ghi  jkl /  abc    def  ghi  jkl ]
 [  abc    def  ghi  jkl ]
 [  abc    def  ghi  jkl /  abc    def  ghi  jkl /  abc    def  ghi  jkl ]
+       posixexp7.sub
 1: OK
 2: $'not'
 3: OK
@@ -300,9 +308,10 @@ tOK
 ./posixexp7.sub: line 70: ${'x1'%'t'}: bad substitution
 ./posixexp7.sub: line 73: ${'x1'%'t'}: bad substitution
 ./posixexp7.sub: line 74: ${'x1'%'t'}: bad substitution
+       posixexp8.sub
 "A"
 A
 argv[1] = <"A">
 argv[1] = <A>
 argv[1] = <A>
-./posixexp.tests: line 97: unexpected EOF while looking for matching `}'
+./posixexp.tests: line 101: unexpected EOF while looking for matching `}'
index d8f6644195d901f2cf879c9fa11e424c0de18f6e..8f595d0708bf35be74808ea6d7da61d0993e00cb 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 unset a
 printf "%s\n" ${a:=a\ b}
 echo "$a"
@@ -79,18 +81,20 @@ recho "${IFS+'}'z}"
 : ${TMPDIR:=/var/tmp}
 rm -f $TMPDIR/sh
 cp ${THIS_SH} $TMPDIR/sh
-THIS_SH=$TMPDIR/sh ${THIS_SH} ./posixexp1.sub || echo "sh posixexp1.sub: test $? failed"
-${THIS_SH} ./posixexp1.sub || echo "bash posixexp1.sub: test $? failed"
+THIS_SH=$TMPDIR/sh test_runsub ./posixexp1.sub || echo "sh posixexp1.sub: test $? failed"
+test_runsub ./posixexp1.sub || echo "bash posixexp1.sub: test $? failed"
 
-THIS_SH=$TMPDIR/sh ${THIS_SH} ./posixexp2.sub || echo "sh posixexp2.sub: test $? failed"
+THIS_SH=$TMPDIR/sh test_runsub ./posixexp2.sub || echo "sh posixexp2.sub: test $? failed"
 rm -f $TMPDIR/sh
 
-${THIS_SH} ./posixexp3.sub
-${THIS_SH} ./posixexp4.sub
-${THIS_SH} ./posixexp5.sub
-${THIS_SH} ./posixexp6.sub
-${THIS_SH} ./posixexp7.sub
-${THIS_SH} ./posixexp8.sub
+. ./test-aux-functions
+
+test_runsub ./posixexp3.sub
+test_runsub ./posixexp4.sub
+test_runsub ./posixexp5.sub
+test_runsub ./posixexp6.sub
+test_runsub ./posixexp7.sub
+test_runsub ./posixexp8.sub
 
 # this will be an error
 foo=bar
index 1816837a596a9916747ae792eee58c383c7859d5..9674f182db63a7951f576f952f0a9e9ef40333f2 100644 (file)
@@ -1,10 +1,10 @@
 printf: usage: printf [-v var] format [arguments]
 printf: usage: printf [-v var] format [arguments]
-./printf.tests: line 44: printf: -x: invalid option
+./printf.tests: line 46: printf: -x: invalid option
 printf: usage: printf [-v var] format [arguments]
-./printf.tests: line 47: printf: `invalid-var': not a valid identifier
+./printf.tests: line 49: printf: `invalid-var': not a valid identifier
 abc
-./printf.tests: line 48: printf: `invalid-var': not a valid identifier
+./printf.tests: line 50: printf: `invalid-var': not a valid identifier
 10
        one
 one\ctwo
@@ -40,7 +40,7 @@ A7
 --\"abcd\"--
 --\'abcd\'--
 --a\x--
-./printf.tests: line 133: printf: missing hex digit for \x
+./printf.tests: line 135: printf: missing hex digit for \x
 --\x--
 ----
 ----
@@ -101,12 +101,12 @@ A7
 26
 26
 26
-./printf.tests: line 257: printf: `%10': missing format character
-./printf.tests: line 258: printf: `M': invalid format character
-ab./printf.tests: line 261: printf: `y': invalid format character
-./printf.tests: line 264: printf: GNU: invalid number
+./printf.tests: line 259: printf: `%10': missing format character
+./printf.tests: line 260: printf: `M': invalid format character
+ab./printf.tests: line 263: printf: `y': invalid format character
+./printf.tests: line 266: printf: GNU: invalid number
 0
-./printf.tests: line 265: printf: GNU: invalid number
+./printf.tests: line 267: printf: GNU: invalid number
 0
 -
 (foo )(bar )
@@ -167,12 +167,13 @@ xx
 ''
 9223372036854775807
 -9223372036854775808
-./printf.tests: line 386: printf: +: invalid number
+./printf.tests: line 388: printf: +: invalid number
 0
-./printf.tests: line 387: printf: z: invalid number
+./printf.tests: line 389: printf: z: invalid number
 0
-./printf.tests: line 388: printf: : invalid number
+./printf.tests: line 390: printf: : invalid number
 0
+       printf1.sub
        one
 one\ctwo
 4\.2
@@ -277,6 +278,8 @@ A7
 ^G
 ^Ge
 "?
+       printf2.sub
+       printf3.sub
 16:09:15
 ./printf3.sub: line 27: printf: warning: `Z': invalid time format specification
 %(abde)Z
@@ -288,6 +291,7 @@ random time: 2010-05-30 04:09:15 PM -0400
 local time: Sun May 30 16:09:15 EDT 2010
 Sun May 30 16:09:15 EDT 2010             date-style time
 05/30/10 (foo) 16:09:15                  date-style time
+       printf4.sub
 x       123x
 x       123x
 x       123x
@@ -322,6 +326,7 @@ x      +123x
 x      +123x
 x      +123x
 x      +123x
+       printf5.sub
 abcd
 ab
  123
@@ -342,6 +347,7 @@ hello  --
 hello --
 123 --
 6 --
+       printf6.sub
 0000000 000                                                            
 0000001
 0000000 000                                                            
@@ -372,6 +378,7 @@ hello --
 0000000 340 262 207 040 040 040 055 055 055 012                        
 000000a
 [][]
+       printf7.sub
 []
 [X]
 VAR=[]
index b8c2196b42576a39a8d8b0f657ccd9e95a70dbee..15ab5dc7317f567f0f9434b0d8b20f3b572cc4d8 100644 (file)
@@ -17,6 +17,8 @@ LC_NUMERIC=C
 : ${TMPDIR:=/tmp}
 TMPF=$TMPDIR/printf-oflow-$RANDOM
 
+. ./test-aux-functions
+
 printf_overflow ()
 {
         local r;
@@ -388,11 +390,11 @@ printf '%d\n' z
 printf '%d\n' ''
 
 # tests variable assignment with -v
-${THIS_SH} ./printf1.sub
-${THIS_SH} ./printf2.sub
-${THIS_SH} ./printf3.sub
-${THIS_SH} ./printf4.sub
-${THIS_SH} ./printf5.sub
+test_runsub ./printf1.sub
+test_runsub ./printf2.sub
+test_runsub ./printf3.sub
+test_runsub ./printf4.sub
+test_runsub ./printf5.sub
 # multibyte characters with %ls/%S and %lc/%C
-${THIS_SH} ./printf6.sub
-${THIS_SH} ./printf7.sub
+test_runsub ./printf6.sub
+test_runsub ./printf7.sub
index c6471c516cc7ad695cdc9e4064f63ce8ab4d0d40..535be834eb78b6668d5fc0a4301661b898cecaea 100644 (file)
@@ -25,7 +25,9 @@ extern
 0
 0
 0
+       procsub1.sub
 123
+       procsub2.sub
 bar1
 ouch
 bar2
index 140f6e70c85dc8b8f352d7d1622bce8f9871583b..f3485b23a3679a641a2d52eb3813c59ceec4ff54 100644 (file)
@@ -117,5 +117,5 @@ moo() { ls -al "$1" >/dev/null; (true); ls -al "$1" >/dev/null; }; moo >(true)
 
 unset -f moo
 
-${THIS_SH} ./procsub1.sub
-${THIS_SH} ./procsub2.sub
+test_runsub ./procsub1.sub
+test_runsub ./procsub2.sub
index bf9aba0dc523ad6b01fe061728384f477df7c5ba..814008862d18bc12ee47596dad46a7c3119e0013 100644 (file)
@@ -74,6 +74,7 @@ string \
 string \}
 escape\
 escape\
+       quote1.sub
 'weferfds'\''dsfsdf' 
 'weferfdsdsfsdf'
 'weferfds'\''dsfsdf'
@@ -88,6 +89,7 @@ test'string
 a'b'c
 foo b   c baz
 foo 'bar baz
+       quote2.sub
 argv[1] = <>
 argv[1] = <>
 argv[1] = <>
@@ -130,6 +132,7 @@ argv[2] = <>
 argv[1] = <>
 argv[2] = <>
 argv[1] = <>
+       quote3.sub
 argv[1] = <4>
 argv[2] = <>
 argv[1] = <ab>
@@ -144,6 +147,7 @@ argv[1] = <ab ''>
 argv[1] = <ab >
 argv[1] = <ab ''>
 argv[1] = <ab >
+       quote4.sub
 0
 1
 1
index f454f8b08d62077502604d94842517c0f70f32d7..2422349eef9ac7d3734d5156795948946b5638e9 100644 (file)
@@ -135,12 +135,14 @@ echo ${foo:-string \\\}}
 
 : ${TMPDIR:=/tmp}
 
+. ./test-aux-functions
+
 ${THIS_SH} -c 'echo escape\'
 printf 'echo escape\' > $TMPDIR/quote-$$
 ${THIS_SH} $TMPDIR/quote-$$
 rm -f $TMPDIR/quote-$$
 
-${THIS_SH} ./quote1.sub
-${THIS_SH} ./quote2.sub
-${THIS_SH} ./quote3.sub
-${THIS_SH} ./quote4.sub
+test_runsub ./quote1.sub
+test_runsub ./quote2.sub
+test_runsub ./quote3.sub
+test_runsub ./quote4.sub
index a75ef52a67eeb9c38d5d81ef0e2c6edae25c0c2d..208b067dd37e981652adcb55807a7d444c833c85 100644 (file)
@@ -1,9 +1,9 @@
 declare -A assoc=(["x],b[\$(echo uname >&2)"]="1" )
 declare -A assoc=(["\$key"]="1" ["x],b[\$(echo uname >&2)"]="1" )
 declare -A assoc=(["\$key"]="1" ["x],b[\$(echo uname >&2)"]="2" )
-./quotearray.tests: line 31: ((: 'assoc[x\],b\[\$(echo uname >&2)]++' : arithmetic syntax error: operand expected (error token is "'assoc[x\],b\[\$(echo uname >&2)]++' ")
+./quotearray.tests: line 32: ((: 'assoc[x\],b\[\$(echo uname >&2)]++' : arithmetic syntax error: operand expected (error token is "'assoc[x\],b\[\$(echo uname >&2)]++' ")
 declare -A assoc=(["\$key"]="1" ["x],b[\$(echo uname >&2)"]="2" )
-./quotearray.tests: line 34: ((: 'assoc[x\],b\[\$(echo uname >&2)]'++ : arithmetic syntax error: operand expected (error token is "'assoc[x\],b\[\$(echo uname >&2)]'++ ")
+./quotearray.tests: line 35: ((: 'assoc[x\],b\[\$(echo uname >&2)]'++ : arithmetic syntax error: operand expected (error token is "'assoc[x\],b\[\$(echo uname >&2)]'++ ")
 declare -A assoc=(["\$key"]="1" ["x],b[\$(echo uname >&2)"]="2" )
 declare -A assoc=(["\$key"]="1" ["x],b[\$(echo uname >&2)"]="3" )
 4
@@ -24,15 +24,16 @@ declare -a a=([0]="12" [1]="42")
 declare -Ai assoc=(["']"]="3" ["\$var"]="1" )
 105
 declare -A assoc=(["\` echo >&2 foo\`"]="42" ["\$( echo >&2 bar)"]="63" )
-./quotearray.tests: line 140: x],b[$(echo uname >&2): arithmetic syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
-./quotearray.tests: line 144: x],b[$(echo uname >&2): arithmetic syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
+./quotearray.tests: line 141: x],b[$(echo uname >&2): arithmetic syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
+./quotearray.tests: line 145: x],b[$(echo uname >&2): arithmetic syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
 1
-./quotearray.tests: line 147: x],b[$(echo uname >&2): arithmetic syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
+./quotearray.tests: line 148: x],b[$(echo uname >&2): arithmetic syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
 1
-./quotearray.tests: line 150: x],b[$(echo uname >&2): arithmetic syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
+./quotearray.tests: line 151: x],b[$(echo uname >&2): arithmetic syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
 1
-./quotearray.tests: line 153: x],b[$(echo uname >&2): arithmetic syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
+./quotearray.tests: line 154: x],b[$(echo uname >&2): arithmetic syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
 1
+       quotearray1.sub
 declare -A assoc
 0
 0
@@ -62,6 +63,7 @@ foo
 [[ -v assoc[a] ]]; $?=0
 [[ -v assoc["] ]]; $?=0
 declare -A assoc=(["\""]="123" [a]="123" )
+       quotearray2.sub
 declare -A a=([1]="1" [0]="0" [" "]="11" )
 7
 7
@@ -79,6 +81,7 @@ declare -A A=(["*"]="X" ["@"]="X" )
 declare -A assoc
 declare -A assoc=(["\$(echo foo)"]="1" )
 0
+       quotearray3.sub
 declare -A assoc=(["\$var"]="value" )
 declare -A assoc=(["\$var"]="value" )
 declare -A assoc=(["\$var"]="value" )
@@ -100,6 +103,7 @@ declare -A map=(["foo\$(uname >/dev/tty)bar"]="1" )
 declare -A map=()
 $(DOESNOTEXIST)
 declare -A blah=()
+       quotearray4.sub
 declare -A assoc=(["*"]="star" ["!"]="bang" ["@"]="at" )
 declare -A assoc=(["*"]="star" ["!"]="bang" )
 declare -A assoc=(["!"]="bang" )
@@ -127,6 +131,7 @@ declare -a array=([0]="1" [1]="2" [2]="3")
 0
 ./quotearray4.sub: line 115: array[@]: bad array subscript
 declare -a array=([0]="1" [1]="2" [2]="3")
+       quotearray5.sub
 ./quotearray5.sub: line 27: unset: `a[$(echo': not a valid identifier
 ./quotearray5.sub: line 27: unset: `foo)]': not a valid identifier
 declare -A a=()
index e1ed83b0e01aac58e5036df8d24d033b0c8d5c8d..c95c976a01d700e2483595a42cd33dbbb7ddec5e 100644 (file)
@@ -13,6 +13,7 @@
 #
 
 # a set of tests for associative arrays in arithmetic contexts
+. ./test-aux-functions
 
 declare -A assoc
 key='x],b[$(echo uname >&2)'
@@ -153,12 +154,12 @@ echo $?
 (( expr ))
 echo $?
 
-${THIS_SH} ./quotearray1.sub
-${THIS_SH} ./quotearray2.sub
-${THIS_SH} ./quotearray3.sub
+test_runsub ./quotearray1.sub
+test_runsub ./quotearray2.sub
+test_runsub ./quotearray3.sub
 
 # behavior of builtins with array subscripts @ and *
-${THIS_SH} ./quotearray4.sub
+test_runsub ./quotearray4.sub
 
 # behavior of unset with quoted and unquoted array arguments
-${THIS_SH} ./quotearray5.sub
+test_runsub ./quotearray5.sub
index 277a02b65fecd945d19e535edfb5f1b4b4033ae3..17d0518535501ed4443d9321c47620be7a5fd80d 100644 (file)
@@ -31,8 +31,9 @@ argv[1] = < foo>
 argv[1] = <foo>
 argv[1] = <foo>
 argv[1] = < foo>
-./read.tests: line 101: b: readonly variable
+./read.tests: line 103: b: readonly variable
 a = a b = c = stat = 2
+       read1.sub
 a = abcdefg
 xyz
 a = xyz
@@ -52,6 +53,7 @@ a = abc
 <$'spring\375'>
 <summer>
 <automn>
+       read2.sub
 timeout 1: ok
 unset or null 1
 timeout 2: ok
@@ -64,6 +66,7 @@ unset or null 3
 abcde
 abcde
 abcde
+       read3.sub
 ./read3.sub: line 17: read: -1: invalid number
 abc
 defg
@@ -71,10 +74,12 @@ ab
 abc
 #
 0
+       read4.sub
 while read -u 3 var
 do
 echo "$var"
 done 3<$0
+       read5.sub
 argv[1] = <>
 argv[1] = <>
 argv[1] = <>
@@ -86,9 +91,11 @@ argv[2] = <>
 argv[3] = <>
 FOO
 0 0 0
+       read6.sub
 0
 0
 1
+       read7.sub
 timeout 1: ok
 unset or null 1
 timeout 2: ok
@@ -99,10 +106,13 @@ timeout 4: ok
 abcde
 abcde
 
+       read8.sub
 one
 two three four
 one
 two three four
+       read9.sub
+       read10.sub
 IFS=[,] var=[abc] rest=[def,ghi]
 IFS=[] var=[abc] rest=[def,ghi]
 IFS=[ ] var=[  abc] rest=[def,ghi ]
index c06cd7a76591cabf057a2ec158663094cf608354..6015da73baf0567f66c461f3b2c182c6cd5a615a 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 echo " a " | (read x; echo "$x.")
 
 echo " a  b  " | ( read x y ; echo -"$x"-"$y"- )
@@ -106,31 +108,31 @@ EOF
 echo a = $a b = $b c = $c stat = $?
 
 # test read -d delim behavior
-${THIS_SH} ./read1.sub
+test_runsub ./read1.sub
 
 # test read -t timeout behavior
-${THIS_SH} ./read2.sub
+test_runsub ./read2.sub
 
 # test read -n nchars behavior
-${THIS_SH} ./read3.sub
+test_runsub ./read3.sub
 
 # test read -u fd behavior
-${THIS_SH} ./read4.sub
+test_runsub ./read4.sub
 
 # test behavior when IFS is not the default -- bug through bash-2.05b
-${THIS_SH} ./read5.sub
+test_runsub ./read5.sub
 
 # test behavior of read -t 0
-${THIS_SH} ./read6.sub
+test_runsub ./read6.sub
 
 # test behavior of readline timeouts
-${THIS_SH} ./read7.sub
+test_runsub ./read7.sub
 
 # test behavior of read -n and read -d on regular files
-${THIS_SH} ./read8.sub
+test_runsub ./read8.sub
 
 # test behavior of trailing IFS whitespace - POSIX conformance
-${THIS_SH} ./read9.sub
+test_runsub ./read9.sub
 
 # test behavior of read builtin modifying $IFS
-${THIS_SH} ./read10.sub
+test_runsub ./read10.sub
index b3f1ba28123ab2ce4f67b73ad261e254f2568637..f96ba0155ba12060028b28a634ad93bce1e77878 100644 (file)
@@ -1,13 +1,13 @@
 abc
-./redir.tests: line 31: /tmp/redir-test: cannot overwrite existing file
+./redir.tests: line 32: /tmp/redir-test: cannot overwrite existing file
 abc
 def
 def
 ghi
-./redir.tests: line 52: -1: ambiguous redirect
-./redir.tests: line 53: exec: -1: invalid option
+./redir.tests: line 53: -1: ambiguous redirect
+./redir.tests: line 54: exec: -1: invalid option
 exec: usage: exec [-cl] [-a name] [command [argument ...]] [redirection ...]
-./redir.tests: line 58: $z: ambiguous redirect
+./redir.tests: line 59: $z: ambiguous redirect
 Point 1
 Point 2
 to a
@@ -20,12 +20,15 @@ to b
 Point 4
 to c
 Point 5
+       redir1.sub
 this is redir1.sub
 this is redir2.sub
+       redir3.sub
 read line1 "ab"
 read line2 "root"
 read line3 "cd"
 read line4 "daemon"
+       redir4.sub
 from stdin: aa
 to stdout
 ./redir4.sub: line 45: $fd: ambiguous redirect
@@ -48,7 +51,8 @@ kl
 ab
 cd
 cd
-./redir.tests: line 184: redir1.*: No such file or directory
+./redir.tests: line 186: redir1.*: No such file or directory
+       redir5.sub
 #   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
 #   the Free Software Foundation, either version 3 of the License, or
@@ -103,6 +107,7 @@ f ()
 }
 after read
 # This program is free software: you can redistribute it and/or modify
+       redir6.sub
 /
 /
 /
@@ -111,10 +116,12 @@ after read
 0
 before block
 after block
+       redir7.sub
 c1 is 1
 c2 is 2
 c3 is 3
 c4 is 4
+       redir8.sub
 fd 10
 fd 8
 fd 10
@@ -131,6 +138,7 @@ fd 8
 4
 cat /tmp/foo
 whatsis
+       redir9.sub
 hey
 to stdout
 to stderr
@@ -158,7 +166,9 @@ bix ()
 foo
 foo
 foo
+       redir10.sub
 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+       redir11.sub
 1
 7
 after: 42
@@ -169,6 +179,7 @@ foo
 foo
 ./redir11.sub: line 77: 42: No such file or directory
 42
+       redir12.sub
 ./redir12.sub: line 27: unwritable-file: Permission denied
 1 x =
 ./redir12.sub: line 31: unwritable-file: cannot overwrite existing file
index a17da0fc367cf8e8f50e0653eee10ec514318ede..4790dae8e05ac9c111b7528a225da75bdae5d1d8 100644 (file)
@@ -12,6 +12,7 @@
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 : ${TMPDIR:=/tmp}
+. ./test-aux-functions
 
 export LC_ALL=C
 export LANG=C
@@ -92,13 +93,14 @@ rm -f $TMPDIR/bash-a $TMPDIR/bash-b $TMPDIR/bash-c
 #
 # Test the effect of input buffering on the shell's input
 #
+printf '\tredir1.sub\n'
 ${THIS_SH} < redir1.sub
 
 # more open, close, duplicate file descriptors
-${THIS_SH} ./redir3.sub < ./redir3.in1
+test_runsub ./redir3.sub < ./redir3.in1
 
 # still more redirections
-${THIS_SH} ./redir4.sub < redir4.in1
+test_runsub ./redir4.sub < redir4.in1
 
 # various forms of null redirection
 testf()
@@ -184,10 +186,10 @@ set -o posix
 cat < redir1.*
 
 # test ksh93 dup-and-close (move fd) redirections
-${THIS_SH} ./redir5.sub
+test_runsub ./redir5.sub
 
 # test behavior after a write error with a builtin command
-${THIS_SH} ./redir6.sub
+test_runsub ./redir6.sub
 
 # problem with redirections using fds bash uses internally
 : ${TMPDIR:=$TMPDIR}
@@ -203,9 +205,9 @@ echo before block
 
 echo after block
 
-${THIS_SH} ./redir7.sub
+test_runsub ./redir7.sub
 
-${THIS_SH} ./redir8.sub
+test_runsub ./redir8.sub
 
 exec 9>&2
 command exec 2>>$TMPDIR/foo-$$
@@ -216,9 +218,9 @@ rm -f $TMPDIR/foo-$$
 exec 2>&9
 exec 9>&-
 
-${THIS_SH} ./redir9.sub
-${THIS_SH} ./redir10.sub
-${THIS_SH} ./redir11.sub
-${THIS_SH} ./redir12.sub
+test_runsub ./redir9.sub
+test_runsub ./redir10.sub
+test_runsub ./redir11.sub
+test_runsub ./redir12.sub
 
 ${THIS_SH} < ./redir13.in
index 4ce6743ec62fcc2729885cfe9e35557ea8b38f6f..6b930bbabe254a6ad96937157fbd0602611b0978 100644 (file)
@@ -72,6 +72,7 @@ a?b
 ab
 a/b
 ab
+       rhs-exp1.sub
 argv[1] = <bc>
 argv[1] = <bc>
 argv[1] = <ab>
index 6abdd2a7b854dc0268899acb4849c81dd3e54b0d..c56568130e8b84389c3641990add60455d03e053 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+#
 selvecs='&m68kcoff_vec'
 recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS='$selvecs'}"
 recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS=\'$selvecs\'}"
@@ -61,4 +63,4 @@ var="a?b" ; echo "${var//\?/}"
 var="a/b" ; echo "${var//\\//}"
 var="a/b" ; echo "${var//\//}"
 
-${THIS_SH} ./rhs-exp1.sub
+test_runsub ./rhs-exp1.sub
index e9a4ae6a144b997b8781ae9a410a7a50913b0447..cb8bfe5dd4d99dcf4b13c6720eaee57f334394d0 100644 (file)
@@ -1,20 +1,22 @@
+       rsh1.sub
 ./rsh1.sub: line 22: /bin/sh: restricted
 ./rsh1.sub: line 24: sh: not found
 ./rsh1.sub: line 25: a: command not found
+       rsh2.sub
 ./rsh2.sub: line 23: hash: /bin/sh: restricted
 ./rsh2.sub: line 25: hash: sh: not found
 ./rsh2.sub: line 26: a: command not found
-./rsh.tests: line 25: cd: restricted
-./rsh.tests: line 26: PATH: readonly variable
-./rsh.tests: line 27: SHELL: readonly variable
-./rsh.tests: line 28: /bin/sh: restricted: cannot specify `/' in command names
-./rsh.tests: line 29: /bin/cat: restricted: cannot specify `/' in command names
-./rsh.tests: line 31: .: ./source.sub3: restricted
-./rsh.tests: line 34: /tmp/restricted: restricted: cannot redirect output
-./rsh.tests: line 38: /tmp/restricted: restricted: cannot redirect output
-./rsh.tests: line 43: command: -p: restricted
-./rsh.tests: line 45: set: +r: invalid option
+./rsh.tests: line 26: cd: restricted
+./rsh.tests: line 27: PATH: readonly variable
+./rsh.tests: line 28: SHELL: readonly variable
+./rsh.tests: line 29: /bin/sh: restricted: cannot specify `/' in command names
+./rsh.tests: line 30: /bin/cat: restricted: cannot specify `/' in command names
+./rsh.tests: line 32: .: ./source.sub3: restricted
+./rsh.tests: line 35: /tmp/restricted: restricted: cannot redirect output
+./rsh.tests: line 39: /tmp/restricted: restricted: cannot redirect output
+./rsh.tests: line 44: command: -p: restricted
+./rsh.tests: line 46: set: +r: invalid option
 set: usage: set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [arg ...]
-./rsh.tests: line 46: set: restricted: invalid option name
-./rsh.tests: line 48: exec: restricted
+./rsh.tests: line 47: set: restricted: invalid option name
+./rsh.tests: line 49: exec: restricted
 ./rsh.tests: after exec
index 491608bffd519cea0f27cb13a87a40a5bfa450c8..6f87fb5018183ab2fdeaeb83d085d81239d65daa 100644 (file)
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # test restricted shell mode -- these should all be errors
+. ./test-aux-functions
 #
 # things not tested for:
 #      adding builtins dynamically with enable -f
 #      importing function definitions from environment
 
-${THIS_SH} ./rsh1.sub
-${THIS_SH} ./rsh2.sub
+test_runsub ./rsh1.sub
+test_runsub ./rsh2.sub
 
 set -r
 
index f9dfa604a5039deef3a52dee92b09605b7840dbd..6201f7b1be3a75123912ded1235a5fce455f6cfa 100644 (file)
@@ -56,15 +56,52 @@ ${THIS_SH} ./version
 
 rm -f ${BASH_TSTOUT}
 
+export TAB='   '
+
 echo Any output from any test, unless otherwise noted, indicates a possible anomaly
 
+# keep track of passed and failed tests and report them
+if [ -t 1 ]; then
+       # can't rely on having $'...' or printf understanding \e
+       # bright red background, white foreground text
+       CSTART=$(printf '\033[01;101;37m') CEND=$(printf '\033[0m')
+else
+       CSTART= CEND=
+fi
+
+passed=0
+total=0
+failed=0
+
+if [ -n "$BASH_TSTOUT_SAVEDIR" ] && [ -d "$BASH_TSTOUT_SAVEDIR" ]; then
+       echo "Using $BASH_TSTOUT_SAVEDIR to save output from failed tests"
+else
+       unset BASH_TSTOUT_SAVEDIR
+fi
+
 for x in run-*
 do
        case $x in
        $0|run-minimal|run-gprof)       ;;
-       *.orig|*~) ;;
-       *)      echo $x ; sh $x ; rm -f ${BASH_TSTOUT} ;;
+       *.orig|*.save|*~) ;;
+       *)      echo $x
+               total=$(( $total + 1 ))
+               if sh $x; then
+                       passed=$(( $passed + 1 ))
+               else
+                       failed=$(( $failed + 1 ))
+                       echo "${CSTART}${x}: NON-ZERO exit status $?${CEND}"
+                       if [ -n "$BASH_TSTOUT_SAVEDIR" ]; then
+                               mv ${BASH_TSTOUT} ${BASH_TSTOUT_SAVEDIR}/${x}-${SUFFIX}
+                               echo "${CSTART}output saved to ${BASH_TSTOUT_SAVEDIR}/${x}-${SUFFIX}${CEND}"
+                       elif [ $failed -eq 1 ]; then
+                               echo "${CSTART}Set environment variable BASH_TSTOUT_SAVEDIR to a directory to save failed test output${CEND}"
+                       fi
+               fi
+               rm -f ${BASH_TSTOUT}
+               ;;
        esac
 done
 
-exit 0
+echo "${CSTART}${passed}/${total} tests succeeded${CEND}"
+exit $failed
index 6c5ec2771de4503747c110d05ad2769de71d0cac..5de82916f3ebe2f113c08b4037487edb23cbc9a5 100644 (file)
@@ -1,6 +1,6 @@
 echo "warning: all of these tests will fail if arrays have not" >&2
-echo "warning: been compiled into the shell" >&2
-echo "warning: the BASH_ARGC and BASH_ARGV tests will fail if debugging support" >&2
-echo "warning: has not been compiled into the shell" >&2
+echo "${TAB}been compiled into the shell" >&2
+echo "warning: the BASH_ARGC and BASH_ARGV tests will fail if debugging" >&2
+echo "${TAB}support has not been compiled into the shell" >&2
 ${THIS_SH} ./array.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} array.right && rm -f ${BASH_TSTOUT}
index 54852ec9b436c764ca2afea31fe156d7cf32c899..e0fe49b25a42a8d273af1ffdd02232e6b72bb88e 100644 (file)
@@ -1,4 +1,4 @@
 echo "warning: all of these tests will fail if arrays have not" >&2
-echo "warning: been compiled into the shell" >&2
+echo "${TAB}been compiled into the shell" >&2
 ${THIS_SH} ./array-at-star > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} array2.right && rm -f ${BASH_TSTOUT}
index 7fef2344c1d07292fd6eb02bcd38194f93acad90..d840e72a253b0dab8aceb9d07963398467538188 100644 (file)
@@ -1,4 +1,4 @@
 echo "warning: all of these tests will fail if arrays have not" >&2
-echo "warning: been compiled into the shell" >&2
+echo "${TAB}been compiled into the shell" >&2
 ${THIS_SH} ./assoc.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} assoc.right && rm -f ${BASH_TSTOUT}
index 69644f27e5a94634aba8d7f3cc21960137fbbd5a..0ee115a1993afd5490e914691ac32fd5a70b1637 100644 (file)
@@ -1,6 +1,6 @@
 echo "warning: some of these tests may fail if process substitution has not" >&2
-echo "warning: been compiled into the shell or if the OS does not provide" >&2
-echo "warning: /dev/fd." >&2
+echo "${TAB}been compiled into the shell or if the OS does not provide" >&2
+echo "${TAB}/dev/fd." >&2
 
 ${THIS_SH} ./builtins.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} builtins.right && rm -f ${BASH_TSTOUT}
index 2cbc86ac633d8fcf654bfd0d95d5a7b880b61ab6..afa0f14bb15b7af5d2bb2f7f199a358102c19884 100644 (file)
@@ -1,9 +1,9 @@
 echo "warning: all of these tests will fail if the conditional command has not" >&2
-echo "warning: been compiled into the shell" >&2
+echo "${TAB}been compiled into the shell" >&2
 echo "warning: some of these tests will fail if extended pattern matching has not" >&2
-echo "warning: been compiled into the shell" >&2
+echo "${TAB}been compiled into the shell" >&2
 echo "warning: the text of system error messages may vary between systems and" >&2
-echo "warning: produce diff output." >&2
+echo "${TAB}produce diff output." >&2
 
 ${THIS_SH} ./cond.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} cond.right && rm -f ${BASH_TSTOUT}
index af64517daeb5851c3829f1657a53582c323c025b..0b286d8186cc8a0262dda61b1efb6a71b5276880 100644 (file)
@@ -1,6 +1,5 @@
-
 TEST_NAME='dbg-support'
-TEST_FILE="/tmp/${TEST_NAME}.check"
+TEST_FILE="${BASH_TSTOUT}"
 ${THIS_SH} ./${TEST_NAME}.tests > $TEST_FILE 2>&1 < /dev/null
 set -f
 diff $TEST_FILE ${TEST_NAME}.right && rm -f $TEST_FILE
index 375c32f9ebd3af72e10d9c35eec2e2c40be82f33..676cc267185593d81675e68cd6953c252f761464 100644 (file)
@@ -1,6 +1,6 @@
 
 TEST_NAME='dbg-support2'
-TEST_FILE="/tmp/${TEST_NAME}.check"
+TEST_FILE="${BASH_TSTOUT}"
 ${THIS_SH} ./${TEST_NAME}.tests > $TEST_FILE 2>&1 < /dev/null
 set -f
 diff $TEST_FILE ${TEST_NAME}.right && rm -f $TEST_FILE
index 4581a649e0f5f14b4950099955e63ba9a8438064..55c95392d117152b618b0bff36329e3b9771402b 100644 (file)
 #
 
 echo "warning: the text of a system error message may vary between systems and" >&2
-echo "warning: produce diff output." >&2
-echo "warning: if the text of the error messages concerning \`notthere' or" >&2
-echo "warning: \`/tmp/bash-notthere' not being found or \`/' being a directory" >&2
-echo "warning: produce diff output, please do not consider this a test failure" >&2
+echo "${TAB}produce diff output." >&2
+echo "${TAB}if the text of the error messages concerning \`notthere' or" >&2
+echo "${TAB}\`/tmp/bash-notthere' not being found or \`/' being a directory" >&2
+echo "${TAB}produce diff output, please do not consider this a test failure" >&2
 echo "warning: if diff output differing only in the location of the bash" >&2
-echo "warning: binary appears, please do not consider this a test failure" >&2
+echo "${TAB}binary appears, please do not consider this a test failure" >&2
 ${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} exec.right && rm -f ${BASH_TSTOUT}
index a804364f0875b984827e7742c1cdc6d23551166d..aa8c8b120123a3767b3273041a4174cea9703153 100644 (file)
@@ -1,5 +1,5 @@
 echo "warning: if you have exported functions defined in your environment," >&2
-echo "warning: they may show up as diff output." >&2
-echo "warning: if so, please do not consider this a test failure" >&2
+echo "${TAB}they may show up as diff output." >&2
+echo "${TAB}If so, please do not consider this a test failure" >&2
 ${THIS_SH} ./func.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} func.right && rm -f ${BASH_TSTOUT}
index 246501ccf6b08c548662417cc55b5fd152ec16f6..3f91d19c045dfcadd552a3f89994e0bf0fcd9dd3 100644 (file)
@@ -3,5 +3,5 @@ export PATH
 
 ( diff -a glob.right glob.right >/dev/null 2>&1 ) && AFLAG=-a
 
-${THIS_SH} ./glob.tests > ${BASH_TSTOUT} 2>&1
+${THIS_SH} ./glob.tests > ${BASH_TSTOUT} 2>&1
 diff ${AFLAG} ${BASH_TSTOUT} glob.right && rm -f ${BASH_TSTOUT}
index b655c4f8e9d3a4ddfc1f57ea0cc5caa982e15585..80c98ac1f4cca2bac000f1710c5176289b15c341 100644 (file)
@@ -1,6 +1,6 @@
 echo "warning: UNIX versions number signals and schedule processes differently." >&2
-echo "warning: If output differing only in line numbers is produced, please" >&2
-echo "warning: do not consider this a test failure." >&2
+echo "${TAB}If output differing only in line numbers is produced, please" >&2
+echo "${TAB}do not consider this a test failure." >&2
 
 ${THIS_SH} ./heredoc.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} heredoc.right && rm -f ${BASH_TSTOUT}
index a0fc3312a97ad0326a11d6b125991f8ac4b7f392..3618c2bc952fd8628f3002b61d92f10146ba3321 100644 (file)
@@ -1,4 +1,4 @@
 echo "warning: all of these tests will fail if history has not been compiled" >&2
-echo "warning: into the shell" >&2
+echo "${TAB}into the shell" >&2
 ${THIS_SH} ./histexp.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} histexp.right && rm -f ${BASH_TSTOUT}
index f4fa4663ea9d493bd2e80bb79bdc94d982b20b65..9334fd7f36992cc5b437c7281d487db6bdef855d 100644 (file)
@@ -1,4 +1,4 @@
 echo "warning: all of these tests will fail if history has not been compiled" >&2
-echo "warning: into the shell" >&2
+echo "${TAB}into the shell" >&2
 ${THIS_SH} ./history.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} history.right && rm -f ${BASH_TSTOUT}
index 8429b0db936c0ce1596479baf90240aca473d08b..3d442973254c6a7bc880ac78911e1ab781e72537 100644 (file)
@@ -1,7 +1,7 @@
 echo "warning: some of these tests may fail if job control has not been compiled" >&2
-echo "warning: into the shell" >&2
+echo "${TAB}into the shell" >&2
 echo "warning: there may be a message regarding a cat process dying due to a" >&2
-echo "warning: SIGHUP.  Please disregard." >&2
+echo "${TAB}SIGHUP. Please disregard." >&2
 
 ${THIS_SH} ./jobs.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} jobs.right && rm -f ${BASH_TSTOUT}
index b73e1b8cd8e6733732d864b41f8234b3b216a2f6..0d851b8c842d50f30d8f2353d0a36ee7a4849752 100644 (file)
@@ -1,4 +1,4 @@
 echo "warning: some of these tests will fail if arrays have not" >&2
-echo "warning: been compiled into the shell" >&2
+echo "${TAB}been compiled into the shell" >&2
 ${THIS_SH} ./nameref.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} nameref.right && rm -f ${BASH_TSTOUT}
index 8777c7bd8ea5471b5493318e15d2e31fe97dc806..15774e5b6659c34b2de9956d4e6dbe214cb2fdd1 100644 (file)
@@ -1,10 +1,10 @@
 echo "warning: two of these tests will fail if your OS does not support" >&2
-echo "warning: named pipes or the /dev/fd filesystem.  If the tests of the" >&2
-echo "warning: process substitution mechanism fail, please do not consider" >&2
-echo "warning: this a test failure" >&2
+echo "${TAB}named pipes or the /dev/fd filesystem.  If the tests of the" >&2
+echo "${TAB}process substitution mechanism fail, please do not consider" >&2
+echo "${TAB}this a test failure" >&2
 echo "warning: if you have exported variables beginning with the string _Q," >&2
-echo "warning: diff output may be generated.  If so, please do not consider" >&2
-echo "warning: this a test failure" >&2
+echo "${TAB}the tests may generate diff output. If so, please do not consider" >&2
+echo "${TAB}this a test failure" >&2
 
 ${THIS_SH} ./new-exp.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT}
 diff ${BASH_TSTOUT} new-exp.right && rm -f ${BASH_TSTOUT}
index bd9e9398c0d2e489f95f0b94e3a3334b96d3aa0d..6dd880a8db2acab731bf898d494f69f6215e0c96 100644 (file)
@@ -1,4 +1,4 @@
 echo "warning: several of these tests will fail if arrays have not" >&2
-echo "warning: been compiled into the shell." >&2
+echo "${TAB}been compiled into the shell." >&2
 ${THIS_SH} ./nquote1.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT}
 diff ${BASH_TSTOUT} nquote1.right && rm -f ${BASH_TSTOUT}
index 4648d3ee0a2f3de8edc48be4ded2c945763dc8b3..f744445ea799a212987d8150b150f1d54ab7776d 100644 (file)
@@ -1,4 +1,4 @@
 echo "warning: several of these tests will fail if arrays have not" >&2
-echo "warning: been compiled into the shell." >&2
+echo "${TAB}been compiled into the shell." >&2
 ${THIS_SH} ./nquote2.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT}
 diff ${BASH_TSTOUT} nquote2.right && rm -f ${BASH_TSTOUT}
index 4a3e32af412cd686a05b15a930441b6f7d412460..f96f45ee5c65309189d078b9b665ab0323821032 100644 (file)
@@ -1,4 +1,4 @@
 echo "warning: several of these tests will fail if arrays have not" >&2
-echo "warning: been compiled into the shell." >&2
+echo "${TAB}been compiled into the shell." >&2
 ${THIS_SH} ./nquote3.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT}
 diff ${BASH_TSTOUT} nquote3.right && rm -f ${BASH_TSTOUT}
index 985c31113385f9cdb54fc55891847f94da4dd173..07b083c7aa1c1666c9b450aba33a74df1ab6bb8c 100644 (file)
@@ -1,8 +1,8 @@
 # See whether or not we can use `diff -a'
 ( diff -a ./nquote4.right ./nquote4.right >/dev/null 2>&1 ) && AFLAG=-a
 
-echo warning: some of these tests will fail if you do not have UTF-8 >&2
-echo warning: locales installed on your system >&2
+echo "warning: some of these tests will fail if you do not have UTF-8" >&2
+echo "${TAB}locales installed on your system" >&2
 
 ${THIS_SH} ./nquote4.tests > ${BASH_TSTOUT} 2>&1
 diff ${AFLAG} ${BASH_TSTOUT} nquote4.right && rm -f ${BASH_TSTOUT}
index 796faaa8f5b2621141349cbb8de6a7bc78c8d79c..c15d8002d0c1cfa9186b6be0f20b7c7cdd837b36 100644 (file)
@@ -1,7 +1,7 @@
 echo "warning: all of these tests will fail if process substitution has not" >&2
-echo "warning: been compiled into the shell or if the OS does not provide" >&2
-echo "warning: FIFOs or /dev/fd. Some tests may fail if the OS does not" >&2
-echo "warning: provide FIFOs." >&2
+echo "${TAB}been compiled into the shell or if the OS does not provide" >&2
+echo "${TAB}FIFOs or /dev/fd. Some tests may fail if the OS does not" >&2
+echo "${TAB}provide FIFOs." >&2
 
 ${THIS_SH} ./procsub.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} procsub.right && rm -f ${BASH_TSTOUT}
index 5ec07e27a17d4a8302eee260a8ca9b04187ddae6..43746092a2c4a58943343c235b1fe7bb948d7224 100644 (file)
@@ -1,4 +1,4 @@
 echo "warning: please do not consider output differing only in the amount of" >&2
-echo "warning: white space to be an error." >&2
+echo "${TAB}white space to be an error." >&2
 ${THIS_SH} ./read.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} read.right && rm -f ${BASH_TSTOUT}
index 071af6eb820bc4452aa4e2b8d0f4d83491d6d931..04da6dd106deb4239a50563f66ba5bfce1cb6827 100644 (file)
@@ -1,7 +1,7 @@
 echo "warning: the text of a system error message may vary between systems and" >&2
-echo "warning: produce diff output." >&2
+echo "${TAB}produce diff output." >&2
 echo "warning: if the text of an error message concerning \`redir1.*' not being" >&2
-echo "warning: found or messages concerning bad file descriptors produce diff" >&2
-echo "warning: output, please do not consider it a test failure" >&2
+echo "${TAB}found or messages concerning bad file descriptors produce diff" >&2
+echo "${TAB}output, please do not consider it a test failure" >&2
 ${THIS_SH} ./redir.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} redir.right && rm -f ${BASH_TSTOUT}
index e3331ed0cdd057247680eaa28cc091b50cfdef66..cfffd4328004a974788f3a0de9fc7ba0aba959d7 100644 (file)
@@ -1,6 +1,6 @@
 echo "warning: UNIX versions number signals and schedule processes differently." >&2
-echo "warning: If output differing only in line numbers is produced, please" >&2
-echo "warning: do not consider this a test failure." >&2
+echo "${TAB}If output differing only in line numbers is produced, please" >&2
+echo "${TAB}do not consider this a test failure." >&2
 
 ${THIS_SH} ./trap.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} trap.right && rm -f ${BASH_TSTOUT}
index be394cc745c5312a7d0e4e7e574e5ba3f181ef27..270deba7a75dfcb4a494527f2dac75324112cd75 100644 (file)
@@ -1,4 +1,4 @@
 echo "warning: some of these tests will fail if arrays have not" >&2
-echo "warning: been compiled into the shell" >&2
+echo "${TAB}been compiled into the shell" >&2
 ${THIS_SH} ./varenv.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT}
 diff ${BASH_TSTOUT} varenv.right && rm -f ${BASH_TSTOUT}
index 2bdc1b8389138105c7f51b4bf51c20dff23435b7..0a4d88b32388544ccc4a783950ae0a8d01898a6c 100644 (file)
@@ -1,4 +1,4 @@
 echo "warning: the text of a system error message may vary between systems and" >&2
-echo "warning: produce diff output." >&2
+echo "${TAB}produce diff output." >&2
 ${THIS_SH} ./vredir.tests > ${BASH_TSTOUT} 2>&1
 diff ${BASH_TSTOUT} vredir.right && rm -f ${BASH_TSTOUT}
index d5bce867d10474b17d75fd45c08859d61811667a..506a78cb40a1ca3b6b76308817418d20dff7a013 100644 (file)
@@ -35,6 +35,7 @@ b
 after 1
 a
 0
+       set-e1.sub
 non-posix foo
 after brace group failure: 1
 A 1
@@ -64,9 +65,11 @@ foo
 after failure 1
 after failure 2
 after failure 3
+       set-e2.sub
 true || false no exit
 false || true no exit
 false && false no exit
+       set-e3.sub
 A:
 B:
 ehB
index a0311be43fe0f5b140e59c3d66e9ae559eab55b9..ccb63e82ee29a45828651f18e828dae2bc8cd1d0 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+
 if : ; then
        set -e
        N=95
@@ -132,6 +134,6 @@ rm -f $FN
 
 set +e
 
-${THIS_SH} ./set-e1.sub
-${THIS_SH} ./set-e2.sub
-${THIS_SH} ./set-e3.sub
+test_runsub ./set-e1.sub
+test_runsub ./set-e2.sub
+test_runsub ./set-e3.sub
index 7b14626d24118a0e2e3a6f0d780fcde3991dbbd5..76f98f311a3f41110f84c9e1193fe9a0028a6f5f 100644 (file)
@@ -34,6 +34,7 @@ onetwo
 + echo onetwo
 onetwo
 + set +x
+       set-x1.sub
 ./set-x1.sub: line 18: BASH_XTRACEFD: 4: invalid value for trace file descriptor
 1
 2
@@ -63,6 +64,7 @@ TRACEFILE:
 + echo 4
 + unset BASH_XTRACEFD
 =====
+       set-x2.sub
 + metas=(\| \& \; \( \) \< \> ' ' '    ' '
 ')
 + n=($@)
index b0b2cccacfc7290ec15b8a6a41ed54bd848d61e7..70f85884499496f46f5f8a4703b3fb1f8ce1c733 100644 (file)
@@ -35,9 +35,10 @@ echo $foo
 foo=one echo $foo
 
 set +x
+. ./test-aux-functions
 
 # test BASH_XTRACEFD
-${THIS_SH} ./set-x1.sub
+test_runsub ./set-x1.sub
 
 # compound assignment printing
-${THIS_SH} ./set-x2.sub
+test_runsub ./set-x2.sub
index 869cb3046d2f44efc7fcabc1509eba8dcbdcb229..a577229d92a10c218dfe1f36d771156898aea47f 100644 (file)
@@ -17,18 +17,18 @@ test_runsub()
        scriptname=${1##*/}
        printf '\t%s\n' "${scriptname}"
 
-       ${THIS_SH} "$1"
+       ${THIS_SH} "$@"
 }
 
 # some useful locale variables
 ZH_LOCALE=$(locale -a | grep -i '^zh_TW\.big5' | sed 1q)
-ZH_DEFAULT=$(locale | grep ^LC_CTYPE | sed 's:^.*=::' | tr -d '"')
+ZH_DEFAULT=zh_TW.big5
 
 US_LOCALE=$(locale -a | grep -i '^en_US\.utf-8' | sed 1q)
 if [ -z "$US_LOCALE" ]; then
        US_LOCALE=$(locale -a | grep -i '^en_US\.utf8' | sed 1q)
 fi
-CTYPE_DEFAULT=$ZH_DEFAULT
+CTYPE_DEFAULT=$(locale | grep ^LC_CTYPE | sed 's:^.*=::' | tr -d '"')
 
 # figure out default locale; use LC_CTYPE value since that is what we use it for
 if [ -n "$LC_ALL" ]; then
index 522dd6e2c5949c5d6a2da8fb68a18e09ef200c2c..f4dd4fd25ed9a69e2ba2c3150695cf7e5868e984 100644 (file)
@@ -255,83 +255,84 @@ t -G /tmp/test.group
 t -h /tmp/test.symlink
 0
 t 4+3 -eq 7
-./test.tests: line 26: test: 4+3: integer expected
+./test.tests: line 28: test: 4+3: integer expected
 2
 b 4-5 -eq 7
-./test.tests: line 20: [: 4-5: integer expected
+./test.tests: line 22: [: 4-5: integer expected
 2
 t 9 -eq 4+5
-./test.tests: line 26: test: 4+5: integer expected
+./test.tests: line 28: test: 4+5: integer expected
 2
 b 9 -eq 4+5
-./test.tests: line 20: [: 4+5: integer expected
+./test.tests: line 22: [: 4+5: integer expected
 2
 t A -eq 7
-./test.tests: line 26: test: A: integer expected
+./test.tests: line 28: test: A: integer expected
 2
 b A -eq 7
-./test.tests: line 20: [: A: integer expected
+./test.tests: line 22: [: A: integer expected
 2
 t 9 -eq B
-./test.tests: line 26: test: B: integer expected
+./test.tests: line 28: test: B: integer expected
 2
 b 9 -eq B
-./test.tests: line 20: [: B: integer expected
+./test.tests: line 22: [: B: integer expected
 2
 t ( 1 = 2
-./test.tests: line 26: test: `)' expected
+./test.tests: line 28: test: `)' expected
 2
 b ( 1 = 2
-./test.tests: line 20: [: `)' expected, found ]
+./test.tests: line 22: [: `)' expected, found ]
 2
-./test.tests: line 26: test: a: unary operator expected
+./test.tests: line 28: test: a: unary operator expected
 2
-./test.tests: line 26: test: b: binary operator expected
+./test.tests: line 28: test: b: binary operator expected
 2
-./test.tests: line 26: test: -A: unary operator expected
+./test.tests: line 28: test: -A: unary operator expected
 2
-./test.tests: line 26: test: syntax error: `-ne' unexpected
+./test.tests: line 28: test: syntax error: `-ne' unexpected
 2
-./test.tests: line 26: test: too many arguments
+./test.tests: line 28: test: too many arguments
 2
-./test.tests: line 26: test: syntax error: `-t' unexpected
+./test.tests: line 28: test: syntax error: `-t' unexpected
 2
-./test.tests: line 26: test: argument expected
-2
-./test.tests: line 473: [: missing `]'
+./test.tests: line 28: test: argument expected
 2
 ./test.tests: line 475: [: missing `]'
 2
-./test.tests: line 26: test: (: unary operator expected
+./test.tests: line 477: [: missing `]'
+2
+./test.tests: line 28: test: (: unary operator expected
 2
 t -t a
-./test.tests: line 26: test: a: integer expected
+./test.tests: line 28: test: a: integer expected
 2
 t -t addsds
-./test.tests: line 26: test: addsds: integer expected
+./test.tests: line 28: test: addsds: integer expected
 2
 t -t 42
 1
 t -t /dev/tty
-./test.tests: line 26: test: /dev/tty: integer expected
+./test.tests: line 28: test: /dev/tty: integer expected
 2
 t -t /dev/tty4
-./test.tests: line 26: test: /dev/tty4: integer expected
+./test.tests: line 28: test: /dev/tty4: integer expected
 2
 t -t /dev/tty4444444...
-./test.tests: line 26: test: /dev/tty4444444...: integer expected
+./test.tests: line 28: test: /dev/tty4444444...: integer expected
 2
-./test.tests: line 26: test:  : integer expected
+./test.tests: line 28: test:  : integer expected
 2
 1
 0
 0
-./test.tests: line 26: test: `)' expected
+./test.tests: line 28: test: `)' expected
 2
-./test.tests: line 26: test: (: unary operator expected
+./test.tests: line 28: test: (: unary operator expected
 2
-./test.tests: line 26: test: `)' expected
+./test.tests: line 28: test: `)' expected
 2
+       test1.sub
 t -p /dev/fd/6
 1
 t -p /dev/fd/6
index 412e78347faba3862c9e59b6a9282e9e30f487df..4f21db51aaab4ab9bb1ef8f64e18689284d0dd85 100644 (file)
@@ -15,6 +15,8 @@ if (( $UID == 0 )); then
        echo "test-tests: the test suite should not be run as root" >&2
 fi
 
+. ./test-aux-functions
+
 b()
 {
        [ "$@" ]
@@ -505,4 +507,4 @@ t \( \)
 
 t 1 = 1 -a \( \) -a -n ""
 
-${THIS_SH} ./test1.sub
+test_runsub ./test1.sub
index f383e3a3f8648389feb2f2031080cbaf3f1bc931..67d8c7d9772ae8c491bd15f70b5a6067a68afdd2 100644 (file)
@@ -22,6 +22,7 @@ HOME=~
 /usr/$x/abc
 HOME=/usr/$x/abc
 /usr/$x/abc
+       tilde3.sub
 foo=/home/xyz:/home/xyz
 /home/xyz:/home/xyz
 foo=~:~
index d2415cb35f3d8c914a019ff737bc69f86bc68410..38a661652227072a86988a88fc741a40ed1eacef 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+
 HOME=/usr/xyz
 XPATH=/bin:/usr/bin:.
 
@@ -82,4 +84,4 @@ eval echo $h
 eval $h
 echo $HOME
 
-$THIS_SH ./tilde3.sub
+test_runsub ./tilde3.sub
index 83fc341481ceffe9b1c90f90bfb166362246ee79..05920d51ffcc5204140f28bf71fdbb4989b0fce8 100644 (file)
@@ -5,9 +5,9 @@ trap -- 'echo aborting' SIGINT
 trap -- 'echo aborting' SIGQUIT
 trap -- 'echo aborting' SIGABRT
 trap -- 'echo aborting' SIGTERM
-[33] debug
-debug line
 [35] debug
+debug line
+[37] debug
 trap -- 'echo exiting' EXIT
 trap -- 'echo aborting' SIGHUP
 trap -- 'echo aborting' SIGINT
@@ -15,10 +15,10 @@ trap -- 'echo aborting' SIGQUIT
 trap -- 'echo aborting' SIGABRT
 trap -- 'echo aborting' SIGTERM
 trap -- 'echo [$LINENO] debug' DEBUG
-[37] debug
-func[29] funcdebug
+[39] debug
+func[31] funcdebug
 funcdebug line
-./trap.tests[39] funcdebug
+./trap.tests[41] funcdebug
 trap -- 'echo exiting' EXIT
 trap -- 'echo aborting' SIGHUP
 trap -- 'echo aborting' SIGINT
@@ -26,14 +26,14 @@ trap -- 'echo aborting' SIGQUIT
 trap -- 'echo aborting' SIGABRT
 trap -- 'echo aborting' SIGTERM
 trap -- 'echo ${FUNCNAME:-$0}[$LINENO] funcdebug' DEBUG
-./trap.tests[41] funcdebug
-./trap.tests[46] debug
-./trap.tests[47] debug
-func2[43] debug
-func2[44] debug
-func2debug line
+./trap.tests[43] funcdebug
+./trap.tests[48] debug
 ./trap.tests[49] debug
+func2[45] debug
+func2[46] debug
+func2debug line
 ./trap.tests[51] debug
+./trap.tests[53] debug
 trap -- 'echo exiting' EXIT
 trap -- 'echo aborting' SIGHUP
 trap -- 'echo aborting' SIGINT
@@ -53,7 +53,9 @@ trap -- 'echo aborting' SIGQUIT
 trap -- 'echo aborting' SIGABRT
 trap -- 'echo aborting' SIGTERM
 0
+       trap1.sub
 trap -- '' SIGUSR2
+       trap2.sub
 ERRTRAP
 ERRTRAP
 ERRTRAP
@@ -72,6 +74,7 @@ ERRTRAP
 ERRTRAP
 ERRTRAP
 ERRTRAP
+       trap3.sub
 +[6] echo 1
 1
 +[7] echo 2
@@ -83,6 +86,7 @@ ERRTRAP
 trap: 8
 +[9] echo 4
 4
+       trap4.sub
 exit subshell 1
 current shell
 exit subshell 2
@@ -101,17 +105,21 @@ sleep 2
 wait $!
 exit
 in trap EXIT
+       trap6.sub
 fn
 after 1
 fn
 after 2
 declare -- baz=$'bar\nfoo'
+       trap7.sub
+       trap8.sub
 before
 after
 CHLD
 CHLD
 CHLD
 CHLD
+       trap9.sub
 BASH_TRAPSIG = USR1
 func=7
 222
@@ -120,6 +128,7 @@ exit=0
 A
 In trap-argument: last command preceding the trap action
 In a function call: last command in the trap action
+       trap10.sub
 ERR: 23: -func- failed
 ERR: 20: -[[ -z nonempty ]]- failed
 ERR: 27: -func- failed
@@ -130,10 +139,10 @@ caught a child death
 caught a child death
 trap -- 'echo caught a child death' SIGCHLD
 echo caught a child death
-./trap.tests: line 121: trap: cannot specify both -p and -P
-./trap.tests: line 122: trap: -P requires at least one signal name
+./trap.tests: line 125: trap: cannot specify both -p and -P
+./trap.tests: line 126: trap: -P requires at least one signal name
 trap: usage: trap [-Plp] [[action] signal_spec ...]
-./trap.tests: line 124: trap: -x: invalid option
+./trap.tests: line 128: trap: -x: invalid option
 trap: usage: trap [-Plp] [[action] signal_spec ...]
 trap -- 'echo exiting' EXIT
 trap -- 'echo aborting' SIGABRT
index 6c7706b9d326aa3fb4f708f03d84523537e6acf3..603f5af1faa9a91f162dcd78d28446fda9b7aed4 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+
 # test the trap code
 
 trap 'echo exiting' 0
@@ -73,34 +75,36 @@ echo bad
 echo $?
 
 # hmmm...should this set the handling to SIG_IGN for children, too?
+printf '\ttrap1.sub\n'
 trap '' USR2
 ./trap1.sub
 trap - USR2
 
 # test ERR trap
+printf '\ttrap2.sub\n'
 ./trap2.sub
 
-${THIS_SH} ./trap3.sub
+test_runsub ./trap3.sub
 
-${THIS_SH} ./trap4.sub
+test_runsub ./trap4.sub
 
 # This doesn't work right on all Unix versions
-#${THIS_SH} ./trap5.sub
+#test_runsub ./trap5.sub
 
 # Return trap issues
-${THIS_SH} ./trap6.sub
+test_runsub ./trap6.sub
 
 # eval and ERR trap
-${THIS_SH} ./trap7.sub
+test_runsub ./trap7.sub
 
 # SIGCHLD traps
-${THIS_SH} ./trap8.sub
+test_runsub ./trap8.sub
 
 # return without argument in trap string 
-${THIS_SH} ./trap9.sub
+test_runsub ./trap9.sub
 
 # ERR trap and functions
-${THIS_SH} ./trap10.sub
+test_runsub ./trap10.sub
 
 #
 # show that setting a trap on SIGCHLD is not disastrous.
index 957bc97d1ad3d14b91708d9d5af9cf028fc35870..09d01167140b900f364f760349ec96ed883358a0 100644 (file)
@@ -1,7 +1,7 @@
-./type.tests: line 22: type: -r: invalid option
+./type.tests: line 24: type: -r: invalid option
 type: usage: type [-afptP] name [name ...]
-./type.tests: line 25: type: notthere: not found
-./type.tests: line 29: command: notthere: not found
+./type.tests: line 27: type: notthere: not found
+./type.tests: line 31: command: notthere: not found
 function
 keyword
 builtin
@@ -25,7 +25,7 @@ func ()
 }
 while
 while is a shell keyword
-./type.tests: line 59: type: morealias: not found
+./type.tests: line 61: type: morealias: not found
 alias morealias='more'
 alias morealias='more'
 morealias is aliased to `more'
@@ -38,8 +38,8 @@ builtin
 builtin is a shell builtin
 /bin/sh
 /bin/sh is /bin/sh
-./type.tests: line 81: type: func: not found
-./type.tests: line 83: type: m: not found
+./type.tests: line 83: type: func: not found
+./type.tests: line 85: type: m: not found
 /bin/sh
 /tmp/bash
 bash is hashed (/tmp/bash)
@@ -52,6 +52,7 @@ f ()
 { 
     v='^A'
 }
+       type1.sub
 foo is a function
 foo () 
 { 
@@ -62,6 +63,7 @@ bar ()
 { 
     echo $(< x1)
 }
+       type2.sub
 foo is a function
 foo () 
 { 
@@ -81,6 +83,7 @@ qux
 
 bar
 qux
+       type3.sub
 foo is a function
 foo () 
 { 
@@ -97,6 +100,7 @@ EOF
 a:file
 b:file
 c:file
+       type4.sub
 bb is a function
 bb () 
 { 
@@ -139,6 +143,7 @@ mkcoprocs ()
 { 
     coproc cat -u - & read -u ${COPROC[0]} msg
 }
+       type5.sub
 cat is /bin/cat
 cat is aliased to `echo cat'
 /bin/cat
index 48c97d7ed5e53fcd782675116494225aba89a12a..7011e3ed10c7b9747f295750746afb0be9f755e7 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+
 set +o posix
 
 hash -r
@@ -104,8 +106,8 @@ f() {
 
 type f | cat -v
 
-${THIS_SH} type1.sub
-${THIS_SH} type2.sub
-${THIS_SH} type3.sub
-${THIS_SH} type4.sub
-${THIS_SH} type5.sub
+test_runsub type1.sub
+test_runsub type2.sub
+test_runsub type3.sub
+test_runsub type4.sub
+test_runsub type5.sub
index 4ed1e04a501b29a343c408b1f122265d8d1f486c..7bb51b6a3211261c16e04637904939c6b7d0d729 100644 (file)
@@ -34,6 +34,7 @@ hBP
 braceexpand:hashall:interactive-comments:physical
 declare -r SHELLOPTS="braceexpand:hashall:interactive-comments:physical"
 abcde
+       varenv1.sub
 20
 30
 40
@@ -41,6 +42,7 @@ abcde
 declare -x var="60"
 outside
 assignment
+       varenv2.sub
 |0|10|
 10
 |0|10|
@@ -54,9 +56,11 @@ after fff3: x=4
 |0|12|
 |y|
 |y|
+       varenv3.sub
 a:b:c:d
 a-b-c-d
 a:b:c:d
+       varenv4.sub
 g: , 
 f: , 
 FIN: asdf fdsa, asdf fdsa
@@ -66,12 +70,15 @@ FIN: v = two, w = one
 ./varenv4.sub: line 67: bbb: unique: cannot convert indexed to associative array
 ./varenv4.sub: line 67: declare: unique: cannot convert indexed to associative array
 after bbb: 1
+       varenv5.sub
 declare -Ar FOOBAR=([foo]="bar" )
 declare -Ar FOOBAR=([foo]="bar" )
 declare -ar FOOBAR2=([0]="bar")
 declare -ar FOOBAR2=([0]="bar")
+       varenv6.sub
 F OUTSIDE
 F OUTSIDE
+       varenv7.sub
 declare -ar outside=()
 declare -ir outside1="1"
 tempenv = foo
@@ -87,6 +94,7 @@ outside: outside
 local: unset1 unset2
 abc
 abc
+       varenv8.sub
 :1
 :2
 after: ----
@@ -95,6 +103,7 @@ global:2
 after: --global--
 after: ----
 x = :1:2
+       varenv9.sub
 in o1 (readonly modifying local scalars):
 declare -r i1="a b c"
 declare -r j1="1 2 3"
@@ -123,6 +132,7 @@ declare -ar i4=([0]="a" [1]="b" [2]="c")
 declare -ar j4=([0]="1" [1]="2" [2]="3")
 ./varenv9.sub: line 79: unset: i4: cannot unset: readonly variable
 ./varenv9.sub: line 79: unset: j4: cannot unset: readonly variable
+       varenv10.sub
 main: unset
 inner: res unset
 outer: res: X Y
@@ -132,6 +142,7 @@ outer: res: X Y
 main: after second call: X
 func: null or unset
 after func: x = outside
+       varenv11.sub
 ./varenv11.sub: line 17: local: qux: readonly variable
 ./varenv11.sub: line 18: qux: readonly variable
 ./varenv11.sub: line 18: local: qux: readonly variable
@@ -140,6 +151,7 @@ declare -a bar=([0]="zero" [1]="one")
 declare -A foo=([one]="one" [zero]="zero" )
 declare -a bar=([0]="zero" [1]="one")
 ./varenv11.sub: line 42: a: readonly variable
+       varenv12.sub
 foo=abc
 func1: var =
 
@@ -170,6 +182,7 @@ foo: hello world
 after foo: var=global
 bar: hello world
 after bar: var=global
+       varenv13.sub
 ./varenv13.sub: line 16: `var[0]': not a valid identifier
 ./varenv13.sub: line 16: `var[@]': not a valid identifier
 ./varenv13.sub: line 14: declare: var: not found
@@ -177,6 +190,7 @@ declare -A var=([0]="X" ["@"]="Y" )
 help
 ./varenv13.sub: line 35: `var[0]': not a valid identifier
 1
+       varenv14.sub
 declare -A var=([0]="X" )
 declare -A var=([Y]="Y" )
 declare -A var=([Y]="Y" )
@@ -197,6 +211,7 @@ declare -a v=([0]="7" [1]="1")
 declare -a array=([0]="1" [1]="2" [2]="3" [3]="list" [4]="of" [5]="four" [6]="words")
 ./varenv14.sub: line 85: declare: assoc: cannot convert associative to indexed array
 declare -A assoc=([four]="words" [two]="2" [three]="3" [one]="1" [list]="of" )
+       varenv15.sub
 f: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
 f1: after: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 done: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
@@ -227,6 +242,7 @@ after source 1: a b c d e f g h i j k l m n o p q r s t u v w x y z
 varenv15.in: before set: one two three four five six seven eight nine ten
 varenv15.in: after set: a b c d e f g h i j k l m n o p q r s t u v w x y z
 after source 2: a b c d e f g h i j k l m n o p q r s t u v w x y z
+       varenv16.sub
 foo=showfoo environment foo=showfoo
 foo=showfoo environment foo=showfoo
 foo=showfoo environment foo=showfoo
@@ -243,6 +259,7 @@ outside 2.0: foo=<unset>
 foo=foo environment foo=foo
 foo=<unset> environment foo=
 outside 2.1: foo=<unset>
+       varenv17.sub
 declare -- var="global"
 declare -- var
 declare -- var="local"
@@ -256,26 +273,31 @@ declare -- var
 declare -- var="local"
 declare -- var="f1"
 declare -- var="local"
+       varenv18.sub
 declare -a arr=([0]="zero" [1]="one" [2]="two" [3]="three" [4]="four" [5]="five")
 declare -a arr=([0]="zero" [1]="one" [2]="two")
 declare -a arr=([0]="three" [1]="four" [2]="five")
 declare -a arr=([0]="zero" [1]="one" [2]="two")
+       varenv19.sub
 ddd 0
 aaa 1 2 3
 bbb 4 5 6
 ccc 7 8 9
 declare -a x=([0]="one" [1]="two" [2]="three")
 ./varenv19.sub: line 51: declare: x: not found
+       varenv20.sub
 declare -x v="x"
 declare -x v="t"
 declare -- v
 declare -x v
+       varenv21.sub
 ignoreeof              on
 ignoreeof              off
 ignoreeof              on
 10
 local -
 match 1
+       varenv22.sub
 trap -- 'echo trap:$FUNCNAME' EXIT
 trap:f
 trap -- 'echo trap:$FUNCNAME' EXIT
@@ -284,6 +306,7 @@ trap -- 'echo trap:$FUNCNAME' EXIT
 trap:f
 trap -- 'echo trap:$FUNCNAME' EXIT
 trap:f
+       varenv23.sub
 declare -rx x="4"
 declare -rx y="5"
 f:3
@@ -310,6 +333,7 @@ f: 3
 global: declare -rx c="3"
 f1: 4
 global: declare -- b="8"
+       varenv24.sub
 f1: x = local
 f2: x = local
 after f2: x = global
@@ -328,6 +352,7 @@ after unset f1: x = local
 f1: x = local
 after unset f1: x = unset
 1009: after posix f1: x = global
+       varenv25.sub
 global initial
 declare -- string
 declare -i int
index bdc4f2fe1f473c030e883b150626fba4cce9a9f2..b622debd9274edd1183954a5f36ab71c38939148 100644 (file)
@@ -17,6 +17,8 @@
 # Test the behavior of the shell with respect to variable and environment
 # assignments
 #
+. ./test-aux-functions
+
 expect()
 {
        echo expect "$@"
@@ -210,59 +212,59 @@ printenv FOOFOO
 
 # test out export behavior of variable assignments preceding builtins and
 # functions
-$THIS_SH ./varenv1.sub
+test_runsub ./varenv1.sub
 
 # more tests; bugs in bash up to version 2.05a
-$THIS_SH ./varenv2.sub
+test_runsub ./varenv2.sub
 
 # more tests; bugs in bash IFS scoping up through version 4.2
-$THIS_SH ./varenv3.sub
+test_runsub ./varenv3.sub
 
 # scoping problems with declare -g through bash-4.2
-${THIS_SH} ./varenv4.sub
+test_runsub ./varenv4.sub
 
 # more scoping and declaration problems with -g and arrays through bash-4.2
-${THIS_SH} ./varenv5.sub
+test_runsub ./varenv5.sub
 
 # variable scoping in the presence of nameref
-${THIS_SH} ./varenv6.sub
+test_runsub ./varenv6.sub
 
 # variable declaration problems with arrays and readonly local variables
-${THIS_SH} ./varenv7.sub
+test_runsub ./varenv7.sub
 
 # variable visibility problems with process substitution subshells in
 # redirections
-${THIS_SH} ./varenv8.sub
+test_runsub ./varenv8.sub
 
 # make sure that builtins like readonly and export modify local array variables
 # if executed in shell functions, like they modify local scalar variables
-${THIS_SH} ./varenv9.sub
+test_runsub ./varenv9.sub
 
 # more tests of unset and local variables with dynamic scoping
-${THIS_SH} ./varenv10.sub
+test_runsub ./varenv10.sub
 
 # tests of compound assignments in function scope
-${THIS_SH} ./varenv11.sub
+test_runsub ./varenv11.sub
 
 # temporary environment variable propagation and scoping in posix mode
-${THIS_SH} ./varenv12.sub
+test_runsub ./varenv12.sub
 
 # temporary environment and invalid shell identifier names
-${THIS_SH} ./varenv13.sub
+test_runsub ./varenv13.sub
 
 # localvar_inherit
-${THIS_SH} ./varenv14.sub
-${THIS_SH} ./varenv15.sub
-${THIS_SH} ./varenv16.sub
-${THIS_SH} ./varenv17.sub
-${THIS_SH} ./varenv18.sub
-${THIS_SH} ./varenv19.sub
-${THIS_SH} ./varenv20.sub
-${THIS_SH} ./varenv21.sub
-${THIS_SH} ./varenv22.sub
-${THIS_SH} ./varenv23.sub
-${THIS_SH} ./varenv24.sub
-${THIS_SH} ./varenv25.sub
+test_runsub ./varenv14.sub
+test_runsub ./varenv15.sub
+test_runsub ./varenv16.sub
+test_runsub ./varenv17.sub
+test_runsub ./varenv18.sub
+test_runsub ./varenv19.sub
+test_runsub ./varenv20.sub
+test_runsub ./varenv21.sub
+test_runsub ./varenv22.sub
+test_runsub ./varenv23.sub
+test_runsub ./varenv24.sub
+test_runsub ./varenv25.sub
 
 # make sure variable scoping is done right
 tt() { typeset a=b;echo a=$a; };a=z;echo a=$a;tt;echo a=$a
index d0a76a48aa65dd4875acb17e509a255c20ae996c..5a534d1a967455a5d00a44a724d7544072f0602e 100644 (file)
@@ -8,17 +8,18 @@ bar ()
     exec {v}>> $TMPFILE;
     echo $v
 }
-./vredir.tests: line 19: v: readonly variable
-./vredir.tests: line 19: v: cannot assign fd to variable
+./vredir.tests: line 21: v: readonly variable
+./vredir.tests: line 21: v: cannot assign fd to variable
 42
-./vredir.tests: line 38: v: readonly variable
-./vredir.tests: line 38: v: cannot assign fd to variable
+./vredir.tests: line 40: v: readonly variable
+./vredir.tests: line 40: v: cannot assign fd to variable
 bar is a function
 bar () 
 { 
     exec {v}>> $TMPFILE;
     echo $v
 }
+       vredir1.sub
 10
 line 1
 line 2
@@ -49,6 +50,7 @@ EOF
 
     echo $v
 }
+       vredir2.sub
 10
 foo 1
 foo 2
@@ -76,8 +78,10 @@ iclosev ()
 /bin/sh
 /bin/tcsh
 /bin/zsh
+       vredir3.sub
 ./vredir3.sub: line 4: v: ambiguous redirect
 after
+       vredir4.sub
 10 11
 a
 a
@@ -92,6 +96,7 @@ swizzle ()
 10 11
 10 11
 ./vredir4.sub: line 51: ${output}: Bad file descriptor
+       vredir5.sub
 12 10
 a
 a
@@ -103,10 +108,12 @@ swizzle ()
     exec {stdin}<&$fd0-;
     exec {stdout}>&$fd1-
 }
+       vredir6.sub
 ok 1
 ./vredir6.sub: redirection error: cannot duplicate fd: Invalid argument
 ./vredir6.sub: line 13: /dev/null: Invalid argument
 unset
+       vredir7.sub
 12 10
 a
 a
@@ -118,6 +125,7 @@ swizzle ()
     exec {stdin}<&${fd[0]}-;
     exec {stdout}>&${fd[1]}-
 }
+       vredir8.sub
 redir 2
 ./vredir8.sub: line 33: $fd: Bad file descriptor
 ./vredir8.sub: line 38: $fd: Bad file descriptor
index f2c5e4dd4fa8b9c82b66ecf250977bc13c651dd7..7db313e2b7aa9cd437f4f08684008f50ad813ab7 100644 (file)
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+. ./test-aux-functions
+
 : ${TMPDIR:=/var/tmp}
 TMPFILE=$TMPDIR/foo
 
@@ -46,19 +48,13 @@ rm -f $TMPFILE
 
 type bar
 
-${THIS_SH} ./vredir1.sub
-
-${THIS_SH} ./vredir2.sub
-
-${THIS_SH} ./vredir3.sub
-
-${THIS_SH} ./vredir4.sub
-
-${THIS_SH} ./vredir5.sub
-
-${THIS_SH} ./vredir6.sub
-
-${THIS_SH} ./vredir7.sub
-${THIS_SH} ./vredir8.sub
+test_runsub ./vredir1.sub
+test_runsub ./vredir2.sub
+test_runsub ./vredir3.sub
+test_runsub ./vredir4.sub
+test_runsub ./vredir5.sub
+test_runsub ./vredir6.sub
+test_runsub ./vredir7.sub
+test_runsub ./vredir8.sub
 
 exit 0