tests/test-check-code
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 16 Mar 2010 19:52:55 +0100
changeset 10715 83dce0f817f4
child 10722 c4fb2103e734
permissions -rwxr-xr-x
add a small test for contrib/check-code.py This changeset adds a test file for contrib/check-code.py. This test runs check-code.py against two small files. The first file should not raise any check-code.py error while the second should. A line contains multiple errors to verify the check-code.py behaviour: In the case of multiple errors at the same line, the context line should only be displayed once.

#!/bin/sh
#cd `dirname $0`
cat > correct.py <<EOF
def toto(arg1, arg2):
    del arg2
    return (5 + 6, 9)
EOF

cat > wrong.py <<EOF
def toto( arg1, arg2):
    del(arg2)
    return ( 5+6, 9)
EOF

check_code=`dirname $0`/../contrib/check-code.py
${check_code} ./wrong.py ./correct.py