blob: 2ef87d18a172f7fc7db79fe518dfb300e92bab81 (
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
|
#!/bin/sh
# test an mst binary
if [ "$1" = "" ]; then
echo "usage: $0 ./mst.exe"
exit
fi
# all of mst's output is to stderr
echo "running: $1 2048 1 2>output"
if ! $1 2048 1 2>output; then
echo "$1 failed directly"
exit 2
fi
# mst prints sizes of its structures, which increase after boxing
if ! sed 's/size = [0-9][0-9]/size = xx/' <output | diff out.orig - >out.diff; then
if test -s out.diff; then
echo "$1 got the wrong answer. See out.diff"
exit 4
fi
fi
echo "$1 seems to work"
rm -f out.diff
|