diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-04-16 06:09:46 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-04-16 06:09:46 +0000 |
commit | dbd8c3b2954f22b4d5221aa157153fec6f68ee57 (patch) | |
tree | 4dc97bcd2ade0b2e2e54306a7932a5d3935d5985 /testsuite | |
parent | 1a54030445c802b79491c286988ee4d25fdb9665 (diff) | |
download | busybox-dbd8c3b2954f22b4d5221aa157153fec6f68ee57.tar.gz |
add some tests for common typos and for obsolete functions
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/all_sourcecode.tests | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/testsuite/all_sourcecode.tests b/testsuite/all_sourcecode.tests index 75a01e6d7..23b8aec88 100755 --- a/testsuite/all_sourcecode.tests +++ b/testsuite/all_sourcecode.tests @@ -7,12 +7,58 @@ [ -n "$srcdir" ] || srcdir=$(pwd) . testing.sh + +# +# if we don't have the sourcecode available, let's just bail +# +[ -s "$srcdir/../Makefile" ] || exit 0 +[ -s "$srcdir/../include/applets.h" ] || exit 0 + + +# # verify the applet order is correct in applets.h, otherwise # applets won't be called properly. +# sed -n -e '/^USE_[A-Z]*(APPLET(/{s:.*(::;s:,.*::;s:"::g;p}' \ - $srcdir/../include/applets.h > applet.order.current 2> /dev/null + $srcdir/../include/applets.h > applet.order.current 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 + +# +# 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\>' \ + -e '\<depency\>' \ + -e '\<defalt\>' \ + -e '\<remaing\>' \ + -e '\<queuing\>' \ + -e '\<detatch\>' \ + -e '\<sempahore\>' \ + -e '\<reprenstative\>' \ + -e '\<overriden\>' \ + -e '\<readed\>' \ + -e '\<formated\>' \ + | 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:]]*\(' \ + | sed -e "s:^$srcdir/\.\./::g" > src.obsolete +testing "Obsolete function usage" "cat src.obsolete" "" "" "" +rm -f src.obsolete + + exit $FAILCOUNT |