File: test.ia-c--learn

package info (click to toggle)
shellia 5.10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 792 kB
  • sloc: sh: 7,840; makefile: 34
file content (57 lines) | stat: -rwxr-xr-x 1,381 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
# vim: set filetype=sh :
#        file: test.ia-c-learn
#   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-learn

# The following tests are included:
# (1) Run this script without options
# (2) check logfile
# (3) Run this script without options, show only stdout

. ./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--learn
bug913718_cmd
ia_logfile="$(mktemp)"
export ia_logfile

rm -f $ia_logfile
check "(1) Run this script without options" "$@" "$cmd -a" \
"--- output to LEARN from <example.ia-c--learn> running <sub> ---
l:three stdout
l:three stderr
two stdout
two stderr"

check "(2) check logfile" "$@" "cat $ia_logfile" \
"|example.ia-c--learn
|i:one stdout
|i:one stderr
|s:two stdout
|s:two stderr
|--- output to LEARN from <example.ia-c--learn> running <sub> ---
|l:three stdout
|l:three stderr"

check "(3) Run this script without options, show only stdout" "$@" "$cmd -a 2>/dev/null" \
"two stdout
two stderr"

rm -f $ia_logfile