summaryrefslogtreecommitdiffstats
path: root/general/runtests.wrk
blob: f55f9d30588a18f880b83e1ad6132494db1953e2 (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/sh
#
#       @(#)runtests.wrk	1.9 2003/12/30 Connectathon Testsuite
#	1.4 Lachman ONC Test Suite source
#
#  This script is intended to be invoked from 'runtests'
#  Don't run it manually

case x$1 in
    xFROM_RUNTESTS)
	;;
    *)
	echo "$0 must be run from 'runtests' - Don't run manually"
	exit 1
	;;
esac

errexit='cat $FILE; exit 1'

TIME=time
# if the default time command doesn't return the right format,
# you may have to use the following lines
case `uname` in
[lL]inux*)
	TIME=/usr/bin/time
	;;
*)
	TIME=/bin/time
	;;
esac
if [ ! -f $TIME ]
then
	TIME=/usr/bin/time
	if [ ! -f $TIME ]
	then
		echo "Where is the time command?"
		exit 1
	fi
fi

chmod 777 large4.sh mkdummy rmdummy
umask 0

# Newer compilers tend to produce warning messages for the source code
# that is used for the general tests.  This confuses "stat".  There
# are a couple ways we could fix this (e.g., make "stat" ignore
# compiler warnings).  But since the general tests as a whole probably
# should be replaced by something that is less Unix-centric, we'll
# just hack around the problem by supressing compiler warnings.
CFLAGS="$CFLAGS -w"
export CFLAGS

echo ""
echo "Small Compile"
rm -f smcomp.time
FILE=smcomp.time
$TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
$TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
$TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
$TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
$TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
ls  smcomp.time
./stat smcomp.time

echo ""
echo "Tbl"
rm -f tbl.time
$TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time
$TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time
$TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time
$TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time
$TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time
# Filter excessive noise from GNU tbl.  Should be harmless for other
# versions of tbl.
egrep -v '^tbl:.*$' <tbl.time >tbl.new
mv -f tbl.new tbl.time
./stat tbl.time

echo ""
echo "Nroff"
rm -f nroff.time
$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
rm nroff.out nroff.tbl
./stat nroff.time

echo ""
echo "Large Compile"
rm -f lrgcomp.time
FILE=lrgcomp.time
$TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
$TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
$TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
$TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
$TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
rm large
./stat lrgcomp.time

echo ""
echo "Four simultaneous large compiles"
rm -f 4lrg.time
FILE=4lrg.time
$TIME ./large4.sh 2>> 4lrg.time || eval $errexit
$TIME ./large4.sh 2>> 4lrg.time || eval $errexit
$TIME ./large4.sh 2>> 4lrg.time || eval $errexit
$TIME ./large4.sh 2>> 4lrg.time || eval $errexit
$TIME ./large4.sh 2>> 4lrg.time || eval $errexit
./stat 4lrg.time

echo ""
echo "Makefile"
mkdummy
rm -f makefile.time
FILE=makefile.time
$TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit
$TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit
$TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit
$TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit
$TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit
rmdummy
# Remove warnings (e.g., due to clock skew) that might confuse "stat".
grep -iv warning: makefile.time | grep -v 'make: ' > makefile.time2
mv makefile.time2 makefile.time
./stat makefile.time

echo ""
echo "General tests complete"

exit 0