Add run_tests.sh script with pep8 command execution

Add pep8 command execution
usage:
./run_tests.sh -p

Change-Id: I558f7618a2e8533a35e63d4bdc001a8109f7fcf5
This commit is contained in:
Tatyana Leontovich 2013-10-31 22:32:14 +02:00
parent a181e99dcf
commit a6a196699e
1 changed files with 42 additions and 0 deletions

42
run_tests.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
function usage {
echo "Usage: $0 [OPTION]..."
echo ""
echo " -p, --pep8 Just run pep8"
echo " -h, --help Print this usage message"
echo ""
exit
}
function process_option {
case "$1" in
-h|--help) usage;;
-p|--pep8) just_pep8=1;;
esac
}
just_pep8=0
for arg in "$@"; do
process_option $arg
done
function run_pep8 {
echo "Running pep8 ..."
# Opt-out files from pep8
ignore_scripts="*.pyc,*.pyo,*.sh,*.swp,*.rst"
ignore_files="*eventlet-patch:*pip-requires"
ignore_dirs=".venv,.tox,dist,doc,vendor,*egg"
GLOBIGNORE="$ignore_scripts:$ignore_files:$ignore_dirs"
ignore="$ignore_scripts,$ignore_dirs"
srcfiles="."
${wrapper} pep8 --repeat $FLAGS --show-source \
--exclude=${ignore} ${srcfiles} | tee pep8.txt
}
if [ $just_pep8 -eq 1 ]; then
run_pep8
exit
fi