X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=inline;f=testsuite%2Fall_sourcecode.tests;h=071399c283a1b556c0d46e72d15080773b6a326a;hb=6dc0ace10943b9f8e004b63277dc1186594f0450;hp=e71301b063d13579b8c2b1711f639e05f1aeb09f;hpb=15545b1db95c6d2db984c4c2f4c9821bb5d729d3;p=oweals%2Fbusybox.git diff --git a/testsuite/all_sourcecode.tests b/testsuite/all_sourcecode.tests index e71301b06..071399c28 100755 --- a/testsuite/all_sourcecode.tests +++ b/testsuite/all_sourcecode.tests @@ -5,7 +5,7 @@ # Licensed under GPL v2, see file LICENSE for details. [ -n "$srcdir" ] || srcdir=$(pwd) -. testing.sh +. ./testing.sh # @@ -15,11 +15,25 @@ [ -s "$srcdir/../include/applets.h" ] || exit 0 +# +# make sure all usage strings are properly escaped. oftentimes people miss +# an escape sequence so we end up with: +# #define foo_usage \ +# " this line is ok" \ +# " as is this line" +# " but this one is broken as the \ is missing from above" +# +${CROSS_COMPILE}cpp -dD -P $srcdir/../include/usage.h \ + | sed -e '/^#define/d' -e '/^$/d' > src.usage.escaped +testing "Usage strings escaped" "cat src.usage.escaped" "" "" "" +rm -f src.usage.escaped + + # # 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}' \ +sed -n -e 's:^//::' -e '/^IF_[A-Z]*(APPLET/{s:,.*::;s:.*(::;s:"::g;p}' \ $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" "" "" "" @@ -36,10 +50,10 @@ find $srcdir/../ \ -e '\' \ -e '\' \ -e '\' \ - -e '\' \ + -e '\' -e '\' -e '\' \ -e '\' \ -e '\' \ - -e '\' \ + -e '\' \ -e '\' \ -e '\' \ -e '\' \ @@ -49,6 +63,7 @@ find $srcdir/../ \ -e '\' \ -e '\' \ -e '\' \ + -e '\' \ | sed -e "s:^$srcdir/\.\./::g" > src.typos testing "Common typos" "cat src.typos" "" "" "" rm -f src.typos @@ -58,7 +73,7 @@ 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:]]*\(' \ + grep -E -e '\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utime|sigblock|siggetmask|sigsetmask)\>[[:space:]]*\(' \ | sed -e "s:^$srcdir/\.\./::g" > src.obsolete.funcs testing "Obsolete function usage" "cat src.obsolete.funcs" "" "" "" rm -f src.obsolete.funcs @@ -68,7 +83,7 @@ rm -f src.obsolete.funcs # don't allow obsolete headers # find $srcdir/.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \ - grep -E -e '\<(malloc|memory)\.h\>' \ + grep -E -e '\<(malloc|memory|sys/(errno|fcntl|signal|stropts|termios|unistd))\.h\>' \ | sed -e "s:^$srcdir/\.\./::g" > src.obsolete.headers testing "Obsolete headers" "cat src.obsolete.headers" "" "" "" rm -f src.obsolete.headers