32 lines
532 B
Bash
32 lines
532 B
Bash
#!/bin/sh -
|
|
#
|
|
# Look for trailing commas in declarations. Some compilers can't handle:
|
|
# enum {
|
|
# foo,
|
|
# bar,
|
|
# };
|
|
|
|
# Top-level directory.
|
|
d=../..
|
|
|
|
# Path names are from a top-level directory.
|
|
[ -f $d/README ] || {
|
|
echo 'FAIL: cannot find source distribution directory.'
|
|
exit 1
|
|
}
|
|
|
|
if cc -g -Wall -I.. t.c -o t; then
|
|
:
|
|
else
|
|
echo "FAIL: unable to compile test program t.c"
|
|
exit 1
|
|
fi
|
|
|
|
if ./t `find $d -name '*.[ch]' -o -name '*.in'` ; then
|
|
:
|
|
else
|
|
echo "FAIL: test program failed, it found trailing commas"
|
|
exit 1
|
|
fi
|
|
|
|
exit 0
|