File: runtest.sh

package info (click to toggle)
tlswrapper 0~20241101-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,796 kB
  • sloc: ansic: 7,099; sh: 2,342; makefile: 234
file content (29 lines) | stat: -rw-r--r-- 399 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

LANG=C
export LANG

[ x"$1" = x ] && exit 100
script="$1"
[ x"$2" = x ] && exit 100
outfile="$2"
[ x"$3" = x ] && exit 100
expfile="$3"

# run test
sh "${script}" > "${outfile}"

# compare
if cmp "${expfile}" "${outfile}"; then
  exit 0
fi

# try to print diff
if [ x"`which diff`" != x ]; then
  diff -u "${expfile}" "${outfile}"
  exit 1
fi

# print output file
cat "${outfile}"
exit 1