File: run-test.sh

package info (click to toggle)
libtelnet 0.21-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,772 kB
  • ctags: 733
  • sloc: sh: 11,036; ansic: 2,390; makefile: 83
file content (27 lines) | stat: -rwxr-xr-x 461 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
DIR=$(dirname "$0")
RS=0

while [ "x$1" != "x" ] ; do
	echo -ne "TEST $1\t\t\t"

	RUNTMP="$(basename "$1").run.tmp"
	OUTTMP="$(basename "$1").out.tmp"

	"../util/telnet-test" "$1" > "$RUNTMP"
	sed -n '/%%/,$p' < "$1" | tail -n+2 > "$OUTTMP"
	if cmp -s "$OUTTMP" "$RUNTMP" ; then
		echo "OK"
	else
		echo "FAIL"
		echo "EXPECTED:"
		sed 's/^/\t/' < "$OUTTMP"
		echo "GOT:"
		sed 's/^/\t/' < "$RUNTMP"
		RS=1
	fi
	rm -f "$RUNTMP" "$OUTTMP"

	shift
done

exit $RS