diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-05-14 21:32:37 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-05-14 21:32:37 +0000 |
commit | ba68240b63574c90911365a02301fcf6bdfc1b2d (patch) | |
tree | 9cb2151e1483c04f5cb7d8c513f6a6e2d6a9661d | |
parent | define each arch in the arch list enum as q_arch to avoid conflicts with any ... (diff) | |
download | portage-utils-ba68240b63574c90911365a02301fcf6bdfc1b2d.tar.gz portage-utils-ba68240b63574c90911365a02301fcf6bdfc1b2d.tar.bz2 portage-utils-ba68240b63574c90911365a02301fcf6bdfc1b2d.zip |
test for checking the source code
-rw-r--r-- | tests/Makefile | 2 | ||||
-rw-r--r-- | tests/source/Makefile | 6 | ||||
-rwxr-xr-x | tests/source/dotest | 63 |
3 files changed, 70 insertions, 1 deletions
diff --git a/tests/Makefile b/tests/Makefile index 51ab231a..e86fdef3 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,4 +1,4 @@ -TESTS = reinitialize atom_compare atom_explode qfile quse install +TESTS = reinitialize atom_compare atom_explode qfile quse install source all: check diff --git a/tests/source/Makefile b/tests/source/Makefile new file mode 100644 index 00000000..639b60fd --- /dev/null +++ b/tests/source/Makefile @@ -0,0 +1,6 @@ +all: check + +test check: + ./dotest + +clean: diff --git a/tests/source/dotest b/tests/source/dotest new file mode 100755 index 00000000..39656001 --- /dev/null +++ b/tests/source/dotest @@ -0,0 +1,63 @@ +#!/bin/bash + +testit() { + if [ -s $1 ] ; then + echo FAIL: $1 + cat $1 + rm -f $1 + exit 1 + fi + rm -f $1 + echo PASS: $1 +} + + +# +# check for misc common typos +# +find ../.. \ + '(' -type d -a '(' -name CVS -o -name tests ')' -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\>' \ + -e '\<algorithic\>' \ + -e '\<deamon\>' \ + -e '\<derefernce\>' \ + | sed -e "s:^\.\./\.\./::g" > src.typos +testit src.typos + + + +# +# don't allow obsolete functions +# +find ../.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \ + grep -E -e '\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utimes)\>[[:space:]]*\(' \ + | sed -e "s:^\.\./\.\./::g" > src.obsolete.funcs +testit src.obsolete.funcs + + + +# +# don't allow obsolete headers +# +find ../.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \ + grep -E -e '\<(malloc|memory|sys/(errno|fcntl|signal|stropts|termios|unistd))\.h\>' \ + | sed -e "s:^\.\./\.\./::g" > src.obsolete.headers +testit src.obsolete.headers + + + +exit 0 |