aboutsummaryrefslogtreecommitdiff
path: root/testsuite/all_sourcecode.tests
diff options
context:
space:
mode:
authorvapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-04-16 06:09:46 +0000
committervapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-04-16 06:09:46 +0000
commite6aa0a8b3ba147e219515baf935612bc5fd41228 (patch)
tree4dc97bcd2ade0b2e2e54306a7932a5d3935d5985 /testsuite/all_sourcecode.tests
parentf139eafe73838805465a0a4e22149421427f7e1d (diff)
downloadbusybox-w32-e6aa0a8b3ba147e219515baf935612bc5fd41228.tar.gz
busybox-w32-e6aa0a8b3ba147e219515baf935612bc5fd41228.tar.bz2
busybox-w32-e6aa0a8b3ba147e219515baf935612bc5fd41228.zip
add some tests for common typos and for obsolete functions
git-svn-id: svn://busybox.net/trunk/busybox@14888 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'testsuite/all_sourcecode.tests')
-rwxr-xr-xtestsuite/all_sourcecode.tests48
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#
12sed -n -e '/^USE_[A-Z]*(APPLET(/{s:.*(::;s:,.*::;s:"::g;p}' \ 22sed -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
14LC_ALL=C sort applet.order.current > applet.order.correct 24LC_ALL=C sort applet.order.current > applet.order.correct
15testing "Applet order" "diff -u applet.order.current applet.order.correct" "" "" "" 25testing "Applet order" "diff -u applet.order.current applet.order.correct" "" "" ""
16rm -f applet.order.current applet.order.correct 26rm -f applet.order.current applet.order.correct
17 27
28
29#
30# check for misc common typos
31#
32find $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
50testing "Common typos" "cat src.typos" "" "" ""
51rm -f src.typos
52
53
54#
55# don't allow obsolete functions
56#
57find $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
60testing "Obsolete function usage" "cat src.obsolete" "" "" ""
61rm -f src.obsolete
62
63
18exit $FAILCOUNT 64exit $FAILCOUNT