File: test.prefix_change

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 (45 lines) | stat: -rwxr-xr-x 1,030 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
#!/bin/sh
# vim: set filetype=sh :
#        file: test.prefix_change
#   copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2007-2020)
#     license: GNU General Public License, version 3
# description: test a script that changes ia_prefix and dbg_prefix
#    see also: example.prefix_change

# The following tests are included:
# (1) Run this script with debug
# (2) check the 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

bug913718_unify UNIFY_posh
[ "$shell" = "posh" ] && set -- "$@" -u "$UNIFY_posh"
[ "$shell" ] && set -- "$@" -s "$shell"
cmd=$(dirname $0)/example.prefix_change
bug913718_cmd

iiaa_logfile="$(mktemp)"
export iiaa_logfile

rm -f $iiaa_logfile
check "(1) Run this script with debug" "$@" "$cmd -d 9" \
"DEBUG program started
hello"

check "(2) check the logfile" "$@" "cat $iiaa_logfile" \
"|DEBUG program started
|example.prefix_change
|s:hello"

rm -f $iiaa_logfile