3 # Tests for the sourcecode base itself.
4 # Copyright 2006 by Mike Frysinger <vapier@gentoo.org>
5 # Licensed under GPL v2, see file LICENSE for details.
7 [ -n "$srcdir" ] || srcdir=$(pwd)
12 # if we don't have the sourcecode available, let's just bail
14 [ -s "$srcdir/../Makefile" ] || exit 0
15 [ -s "$srcdir/../include/applets.h" ] || exit 0
19 # verify the applet order is correct in applets.h, otherwise
20 # applets won't be called properly.
22 sed -n -e '/^USE_[A-Z]*(APPLET(/{s:.*(::;s:,.*::;s:"::g;p}' \
23 $srcdir/../include/applets.h > applet.order.current
24 LC_ALL=C sort applet.order.current > applet.order.correct
25 testing "Applet order" "diff -u applet.order.current applet.order.correct" "" "" ""
26 rm -f applet.order.current applet.order.correct
30 # check for misc common typos
33 '(' -type d -a '(' -name .svn -o -name testsuite ')' -prune ')' \
34 -o '(' -type f -a -print0 ')' | xargs -0 \
36 -e '\<compatability\>' \
38 -e '\<fordeground\>' \
45 -e '\<reprenstative\>' \
49 | sed -e "s:^$srcdir/\.\./::g" > src.typos
50 testing "Common typos" "cat src.typos" "" "" ""
55 # don't allow obsolete functions
57 find $srcdir/.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \
58 grep -E -e '\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utimes)\>[[:space:]]*\(' \
59 | sed -e "s:^$srcdir/\.\./::g" > src.obsolete
60 testing "Obsolete function usage" "cat src.obsolete" "" "" ""