-
Notifications
You must be signed in to change notification settings - Fork 13
/
fastcheck.sh
executable file
·76 lines (65 loc) · 1.31 KB
/
fastcheck.sh
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
#! /bin/sh
if test "x$1" = x ; then
echo "usage: make fastcheck (yeah, this is supposed to run under make)"
exit 2
fi
srcdir="$1"
if test $srcdir = . ; then
srcdir=`pwd`
fi
if test $srcdir = .. ; then
srcdir=`pwd`/..
fi
objdir="$2"
if test $objdir = . ; then
objdir=`pwd`
fi
testdir=$objdir/fastcheck.lrzsz
SZ="$objdir/src/lsz"
RZ="$objdir/src/lrz"
echo checking with srcdir = $1 and objdir = $2
z_test_files=""
for i in $srcdir/src/l?z.c ; do
z_test_files="$z_test_files $i"
done
for i in $objdir/src/l?z ; do
z_test_files="$z_test_files $i"
done
# change to tmp dir
if test "x$TMPDIR" = x ; then
if test "x$TMP" = x ; then
cd /tmp
else
cd $TMP || cd /tmp
fi
else
cd $TMPDIR || cd /tmp
fi
rm -rf $testdir
mkdir $testdir
exec 5>$testdir/error.log
(mkfifo $testdir/pipe || mknod $testdir/pipe p) 2>&5
mkdir $testdir/zmodem
failed=0
($SZ -q $z_test_files ) <$testdir/pipe | \
(cd $testdir/zmodem ; exec $RZ $QUIET >>../pipe )
for i in $z_test_files ; do
bn=`basename $i`
cmp $i $testdir/zmodem/$bn
if test $? -eq 0 ; then
rm -f $testdir/zmodem/$bn
else
failed=1
fi
done
rm -rf $testdir
if test "x$failed" = x0 ; then
:
else
echo "the test failed." >&2
echo "use 'make check' or 'make vcheck' for a more detailed test" >&2
touch $objdir/fastcheck.failed
exit 1
fi
touch $objdir/fastcheck.ok
exit 0