Add regression test infrastructure.
[dragonfly.git] / usr.bin / make / tests / env.sh
1 #!/bin/sh
2
3 # $DragonFly: src/usr.bin/make/tests/Attic/env.sh,v 1.1 2005/02/01 07:07:14 okumoto Exp $
4
5 MAKE=/usr/bin/make
6
7 std_action() {
8         if [ -d $1 ]; then
9                 (cd $d; ./test.sh $2)
10         else
11                 echo Test directory $1 missing in `pwd`
12         fi
13 }
14
15 std_compare() {
16         if cmp -s expected.stdout stdout && \
17            cmp -s expected.stderr stderr && \
18            cmp -s expected.status status; then
19                 true
20         else
21                 echo Test failed `pwd`
22         fi
23 }
24
25 std_diff() {
26         diff -u expected.stdout stdout
27         diff -u expected.stderr stderr
28         diff -u expected.status status
29 }
30
31 std_update() {
32         $0 test
33         cp stdout expected.stdout
34         cp stderr expected.stderr
35         cp status expected.status
36 }
37
38 std_clean() {
39         rm -f Makefile
40         rm -f stdout
41         rm -f stderr
42         rm -f status
43 }
44
45 std_run() {
46         $0 test
47         $0 compare
48         $0 clean
49 }
50