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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
#!/bin/sh
# vim: set filetype=sh :
# file: test.ia-c-expr
# copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2007-2020)
# license: GNU General Public License, version 3
# description: test using check normally but disable it for some functions
# see also: example.ia-c-expr
# The following tests are included:
# (1) Run this script without options
# (2) check logfile
# (3) Use ia_ignore intead of ia_stdout
# (4) check logfile
. ./tstlib
shell=""
while [ $# -ne 0 ]; do
if [ "$1" = "-s" ]; then
shell="$2"
shift 2
else
echo "ERROR $0: unknown option <$1>" >&2
exit 1
fi
done
[ "$shell" ] && set -- "$@" -s "$shell"
[ "$shell" = "posh" ] && set -- "$@" -u "$(bug913718_unify)"
cmd=$(dirname $0)/example.ia-c-expr
bug913718_cmd
ia_logfile="$(mktemp)"
export ia_logfile
rm -f $ia_logfile
check "(1) Run this script without options" "$@" "$cmd" \
"AC\"DC
AC
ACDC
ACDC\$
ACDC\$
ACDC\$
AC\DC
AC\DC
AC\DC
AC\DC
1a
1c
3a
4a
5a
6a
7a
AC/DC
AC//DC"
check "(2) check logfile" "$@" "cat $ia_logfile" \
"|example.ia-c-expr
||example.ia-c-expr/sub
||s:AC\"DC
||s:AC
||s:ACDC
||s:ACDC\$
||s:ACDC\$
||s:ACDC\$
||s:AC\DC
||s:AC\DC
||s:AC\DC
||s:AC\DC
||s:1a
||i:1b
||s:1c
||i:2a
||s:3a
||s:4a
||s:5a
||s:6a
||s:7a
||s:AC/DC
||s:AC//DC"
cmd=$(dirname $0)/example.ia-c-expr.tmp.ignore
cat $(dirname $0)/example.ia-c-expr | sed "s/ia_stdout/ia_ignore/g" > $cmd
chmod 755 $cmd
bug913718_cmd
rm -f $ia_logfile
check "(3) Use ia_ignore intead of ia_stdout" "$@" "$cmd" ""
check "(4) check logfile" \
"$@" "cat $ia_logfile" \
"|example.ia-c-expr.tmp.ignore
||example.ia-c-expr.tmp.ignore/sub
||i:AC\"DC
||i:AC
||i:ACDC
||i:ACDC\$
||i:ACDC\$
||i:ACDC\$
||i:AC\DC
||i:AC\DC
||i:AC\DC
||i:AC\DC
||i:1a
||i:1b
||i:1c
||i:2a
||i:3a
||i:4a
||i:5a
||i:6a
||i:7a
||i:AC/DC
||i:AC//DC"
rm -f $ia_logfile
|