source: branches/2.2.5/mindi-busybox/testsuite/all_sourcecode.tests @ 2142

Last change on this file since 2142 was 1765, checked in by Bruno Cornec, 13 years ago

Update to busybox 1.7.2

  • Property svn:executable set to *
File size: 2.1 KB
RevLine 
[821]1#!/bin/sh
2
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.
6
7[ -n "$srcdir" ] || srcdir=$(pwd)
8. testing.sh
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#
19# verify the applet order is correct in applets.h, otherwise
20# applets won't be called properly.
21#
[1765]22sed -n -e '/^USE_[A-Z]*(APPLET/{s:,.*::;s:.*(::;s:"::g;p}' \
[821]23    $srcdir/../include/applets.h > applet.order.current
24LC_ALL=C sort applet.order.current > applet.order.correct
25testing "Applet order" "diff -u applet.order.current applet.order.correct" "" "" ""
26rm -f applet.order.current applet.order.correct
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\>' -e '\<dependancy\>' -e '\<dependancies\>' \
40        -e '\<defalt\>' \
41        -e '\<remaing\>' \
42        -e '\<queueing\>' \
43        -e '\<detatch\>' \
44        -e '\<sempahore\>' \
45        -e '\<reprenstative\>' \
46        -e '\<overriden\>' \
47        -e '\<readed\>' \
48        -e '\<formated\>' \
49        -e '\<algorithic\>' \
50        -e '\<deamon\>' \
51        -e '\<derefernce\>' \
[1765]52        -e '\<acomadate\>' \
[821]53        | sed -e "s:^$srcdir/\.\./::g" > src.typos
54testing "Common typos" "cat src.typos" "" "" ""
55rm -f src.typos
56
57
58#
59# don't allow obsolete functions
60#
61find $srcdir/.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \
62    grep -E -e '\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utimes)\>[[:space:]]*\(' \
63    | sed -e "s:^$srcdir/\.\./::g" > src.obsolete.funcs
64testing "Obsolete function usage" "cat src.obsolete.funcs" "" "" ""
65rm -f src.obsolete.funcs
66
67
68#
69# don't allow obsolete headers
70#
71find $srcdir/.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \
72    grep -E -e '\<(malloc|memory|sys/(errno|fcntl|signal|stropts|termios|unistd))\.h\>' \
73    | sed -e "s:^$srcdir/\.\./::g" > src.obsolete.headers
74testing "Obsolete headers" "cat src.obsolete.headers" "" "" ""
75rm -f src.obsolete.headers
76
77
78exit $FAILCOUNT
Note: See TracBrowser for help on using the repository browser.