xonsh/scripts/run_tests.sh
Kurtis Rader 333468d719 Ensure lexer/parser table module is current
Ensure lexer/parser table module is current before running any tests.
2015-11-12 17:51:06 -08:00

25 lines
686 B
Bash
Executable file

#!/bin/sh
#
# Run all the nosetests or just the ones relevant for the edited files.
#
make build-tables # ensure lexer/parser table module is up to date
if [[ $1 == "-e" ]]; then
tmp_file=$(mktemp /tmp/nose_tests_XXXXXX)
git status -s |
awk '/\.py$/ { print $2 }' |
while read f; do
if [[ $f == xonsh/* ]]; then
f="tests/test_$(basename $f)"
if [[ -f $f ]]; then
echo $f
fi
else
echo $f
fi
done |
sort -u > $tmp_file
XONSHRC=/dev/null nosetests -v $(< $tmp_file)
rm $tmp_file
else
XONSHRC=/dev/null nosetests
fi