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/all_sourcecode.tests | |
| parent | 1a54030445c802b79491c286988ee4d25fdb9665 (diff) | |
| download | busybox-w32-dbd8c3b2954f22b4d5221aa157153fec6f68ee57.tar.gz busybox-w32-dbd8c3b2954f22b4d5221aa157153fec6f68ee57.tar.bz2 busybox-w32-dbd8c3b2954f22b4d5221aa157153fec6f68ee57.zip | |
add some tests for common typos and for obsolete functions
Diffstat (limited to 'testsuite/all_sourcecode.tests')
| -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 @@ | |||
| 7 | [ -n "$srcdir" ] || srcdir=$(pwd) | 7 | [ -n "$srcdir" ] || srcdir=$(pwd) |
| 8 | . testing.sh | 8 | . testing.sh |
| 9 | 9 | ||
| 10 | |||
| 11 | # | ||
| 12 | # if we don't have the sourcecode available, let's just bail | ||
| 13 | # | ||
| 14 | [ -s "$srcdir/../Makefile" ] || exit 0 | ||
| 15 | [ -s "$srcdir/../include/applets.h" ] || exit 0 | ||
| 16 | |||
| 17 | |||
| 18 | # | ||
| 10 | # verify the applet order is correct in applets.h, otherwise | 19 | # verify the applet order is correct in applets.h, otherwise |
| 11 | # applets won't be called properly. | 20 | # applets won't be called properly. |
| 21 | # | ||
| 12 | sed -n -e '/^USE_[A-Z]*(APPLET(/{s:.*(::;s:,.*::;s:"::g;p}' \ | 22 | sed -n -e '/^USE_[A-Z]*(APPLET(/{s:.*(::;s:,.*::;s:"::g;p}' \ |
| 13 | $srcdir/../include/applets.h > applet.order.current 2> /dev/null | 23 | $srcdir/../include/applets.h > applet.order.current |
| 14 | LC_ALL=C sort applet.order.current > applet.order.correct | 24 | LC_ALL=C sort applet.order.current > applet.order.correct |
| 15 | testing "Applet order" "diff -u applet.order.current applet.order.correct" "" "" "" | 25 | testing "Applet order" "diff -u applet.order.current applet.order.correct" "" "" "" |
| 16 | rm -f applet.order.current applet.order.correct | 26 | rm -f applet.order.current applet.order.correct |
| 17 | 27 | ||
| 28 | |||
| 29 | # | ||
| 30 | # check for misc common typos | ||
| 31 | # | ||
| 32 | find $srcdir/../ \ | ||
| 33 | '(' -type d -a '(' -name .svn -o -name testsuite ')' -prune ')' \ | ||
| 34 | -o '(' -type f -a -print0 ')' | xargs -0 \ | ||
| 35 | grep -I \ | ||
| 36 | -e '\<compatability\>' \ | ||
| 37 | -e '\<compatable\>' \ | ||
| 38 | -e '\<fordeground\>' \ | ||
| 39 | -e '\<depency\>' \ | ||
| 40 | -e '\<defalt\>' \ | ||
| 41 | -e '\<remaing\>' \ | ||
| 42 | -e '\<queuing\>' \ | ||
| 43 | -e '\<detatch\>' \ | ||
| 44 | -e '\<sempahore\>' \ | ||
| 45 | -e '\<reprenstative\>' \ | ||
| 46 | -e '\<overriden\>' \ | ||
| 47 | -e '\<readed\>' \ | ||
| 48 | -e '\<formated\>' \ | ||
| 49 | | sed -e "s:^$srcdir/\.\./::g" > src.typos | ||
| 50 | testing "Common typos" "cat src.typos" "" "" "" | ||
| 51 | rm -f src.typos | ||
| 52 | |||
| 53 | |||
| 54 | # | ||
| 55 | # don't allow obsolete functions | ||
| 56 | # | ||
| 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" "" "" "" | ||
| 61 | rm -f src.obsolete | ||
| 62 | |||
| 63 | |||
| 18 | exit $FAILCOUNT | 64 | exit $FAILCOUNT |
