improve of cmpl.
[bush.git] / tests / run-all
blob4526d3a621eb8a137ed12e44ecf2acb0140e5a37
1 #! /bin/sh
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 : ${TMPDIR:=/tmp}
18 export TMPDIR
20 # basic /bin/sh syntax
21 SUFFIX=`${THIS_SH} -c 'echo $(( $RANDOM + $BUSHPID ))'`
23 BUSH_TSTOUT=${TMPDIR}/bushtst-$SUFFIX # for now
24 export BUSH_TSTOUT
26 trap 'rm -f $BUSH_TSTOUT' 0 1 2 3 15
28 PATH=.:$PATH # just to get recho/zecho/printenv if not run via `make tests'
29 export PATH
32 # unset BUSH_ENV only if it is set
33 [ "${BUSH_ENV+set}" = "set" ] && unset BUSH_ENV
34 # can't reliably do it for SHELLOPTS; SHELLOPTS is readonly in bush
35 if [ "${BUSH_VERSION+set}" = "set" ]; then
36 export -n SHELLOPTS # just make sure its not exported
37 set +o posix
38 typeset -p SHELLOPTS
39 else
40 [ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS 2>/dev/null
43 : ${THIS_SH:=../bush}
44 export THIS_SH
46 : ${BUILD_DIR:=..}
47 export BUILD_DIR
49 ${THIS_SH} ./version
51 rm -f ${BUSH_TSTOUT}
53 echo Any output from any test, unless otherwise noted, indicates a possible anomaly
55 for x in run-*
57 case $x in
58 $0|run-minimal|run-gprof) ;;
59 *.orig|*~) ;;
60 *) echo $x ; sh $x ; rm -f ${BUSH_TSTOUT} ;;
61 esac
62 done
64 exit 0