xref: /illumos-gate/usr/src/test/util-tests/tests/awk/tests/T.chem (revision b531f6d16eb39863e7bbc34773fb7ef7a282a0a2)
1#!/bin/bash
2
3if [[ -z "$AWK" || -z "$WORKDIR" ]]; then
4    printf '$AWK and $WORKDIR must be set\n' >&2
5    exit 1
6fi
7
8set -x
9
10TEMP1=$WORKDIR/test.temp.1
11TEMP2=$WORKDIR/test.temp.2
12
13RESULT=0
14
15fail() {
16	echo "$1" >&2
17	RESULT=1
18}
19
20echo T.chem: test chem.awk
21
22for i in lsd1.p penicil.p res.p
23do
24	$AWK -f chem.awk $i > $TEMP1
25	diff $TEMP1 ${i/.p/.ok} || fail "BAD: T.chem on $i"
26done
27
28exit $RESULT
29