2006-04-01 01:36:32 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Tests for the sourcecode base itself.
|
|
|
|
# Copyright 2006 by Mike Frysinger <vapier@gentoo.org>
|
|
|
|
# Licensed under GPL v2, see file LICENSE for details.
|
|
|
|
|
2006-04-01 20:38:22 +00:00
|
|
|
[ -n "$srcdir" ] || srcdir=$(pwd)
|
2006-04-01 01:36:32 +00:00
|
|
|
. testing.sh
|
|
|
|
|
2006-04-16 06:09:46 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# if we don't have the sourcecode available, let's just bail
|
|
|
|
#
|
|
|
|
[ -s "$srcdir/../Makefile" ] || exit 0
|
|
|
|
[ -s "$srcdir/../include/applets.h" ] || exit 0
|
|
|
|
|
|
|
|
|
|
|
|
#
|
2006-04-01 01:36:32 +00:00
|
|
|
# verify the applet order is correct in applets.h, otherwise
|
|
|
|
# applets won't be called properly.
|
2006-04-16 06:09:46 +00:00
|
|
|
#
|
2006-04-01 01:36:32 +00:00
|
|
|
sed -n -e '/^USE_[A-Z]*(APPLET(/{s:.*(::;s:,.*::;s:"::g;p}' \
|
2006-04-16 06:09:46 +00:00
|
|
|
$srcdir/../include/applets.h > applet.order.current
|
2006-04-01 01:36:32 +00:00
|
|
|
LC_ALL=C sort applet.order.current > applet.order.correct
|
|
|
|
testing "Applet order" "diff -u applet.order.current applet.order.correct" "" "" ""
|
|
|
|
rm -f applet.order.current applet.order.correct
|
|
|
|
|
2006-04-16 06:09:46 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# check for misc common typos
|
|
|
|
#
|
|
|
|
find $srcdir/../ \
|
|
|
|
'(' -type d -a '(' -name .svn -o -name testsuite ')' -prune ')' \
|
|
|
|
-o '(' -type f -a -print0 ')' | xargs -0 \
|
|
|
|
grep -I \
|
|
|
|
-e '\<compatability\>' \
|
|
|
|
-e '\<compatable\>' \
|
|
|
|
-e '\<fordeground\>' \
|
2006-05-26 01:41:04 +00:00
|
|
|
-e '\<depency\>' -e '\<dependancy\>' -e '\<dependancies\>' \
|
2006-04-16 06:09:46 +00:00
|
|
|
-e '\<defalt\>' \
|
|
|
|
-e '\<remaing\>' \
|
2006-05-26 01:41:04 +00:00
|
|
|
-e '\<queueing\>' \
|
2006-04-16 06:09:46 +00:00
|
|
|
-e '\<detatch\>' \
|
|
|
|
-e '\<sempahore\>' \
|
|
|
|
-e '\<reprenstative\>' \
|
|
|
|
-e '\<overriden\>' \
|
|
|
|
-e '\<readed\>' \
|
|
|
|
-e '\<formated\>' \
|
2006-04-18 08:44:19 +00:00
|
|
|
-e '\<algorithic\>' \
|
2006-04-18 11:15:19 +00:00
|
|
|
-e '\<deamon\>' \
|
2006-04-18 14:17:49 +00:00
|
|
|
-e '\<derefernce\>' \
|
2006-08-28 23:31:54 +00:00
|
|
|
-e '\<acomadate\>' \
|
2006-04-16 06:09:46 +00:00
|
|
|
| sed -e "s:^$srcdir/\.\./::g" > src.typos
|
|
|
|
testing "Common typos" "cat src.typos" "" "" ""
|
|
|
|
rm -f src.typos
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# don't allow obsolete functions
|
|
|
|
#
|
|
|
|
find $srcdir/.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \
|
|
|
|
grep -E -e '\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utimes)\>[[:space:]]*\(' \
|
2006-04-16 21:14:59 +00:00
|
|
|
| sed -e "s:^$srcdir/\.\./::g" > src.obsolete.funcs
|
|
|
|
testing "Obsolete function usage" "cat src.obsolete.funcs" "" "" ""
|
|
|
|
rm -f src.obsolete.funcs
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# don't allow obsolete headers
|
|
|
|
#
|
|
|
|
find $srcdir/.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \
|
2006-04-29 04:44:08 +00:00
|
|
|
grep -E -e '\<(malloc|memory|sys/(errno|fcntl|signal|stropts|termios|unistd))\.h\>' \
|
2006-04-16 21:14:59 +00:00
|
|
|
| sed -e "s:^$srcdir/\.\./::g" > src.obsolete.headers
|
2006-04-28 19:53:48 +00:00
|
|
|
testing "Obsolete headers" "cat src.obsolete.headers" "" "" ""
|
2006-04-16 21:14:59 +00:00
|
|
|
rm -f src.obsolete.headers
|
2006-04-16 06:09:46 +00:00
|
|
|
|
|
|
|
|
2006-04-01 01:36:32 +00:00
|
|
|
exit $FAILCOUNT
|