Split shell tests into files

I am mostly interested in running all python and vim tests separately from other 
tests.
This commit is contained in:
ZyX 2014-08-29 22:22:39 +04:00
parent c5d15ac8a8
commit 4c95928c96
5 changed files with 40 additions and 22 deletions

7
tests/run_lint_tests.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
FAILED=0
if ! ${PYTHON} scripts/powerline-lint -p powerline/config_files ; then
echo "Failed powerline-lint"
FAILED=1
fi
exit $FAILED

9
tests/run_python_tests.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
FAILED=0
for file in tests/test_*.py ; do
if ! ${PYTHON} $file --verbose --catch ; then
echo "Failed test(s) from $file"
FAILED=1
fi
done
exit $FAILED

9
tests/run_shell_tests.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
FAILED=0
if ! sh tests/test_shells/test.sh --fast ; then
echo "Failed shells"
if ${PYTHON} -c 'import platform, sys; sys.exit(1 * (platform.python_implementation() == "PyPy"))' ; then
FAILED=1
fi
fi
exit $FAILED

11
tests/run_vim_tests.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
FAILED=0
for script in tests/*.vim ; do
if ! vim -u NONE -S $script || test -f message.fail ; then
echo "Failed script $script" >&2
cat message.fail >&2
rm message.fail
FAILED=1
fi
done
exit $FAILED

View File

@ -1,29 +1,11 @@
#!/bin/sh #!/bin/sh
: ${PYTHON:=python}
FAILED=0 FAILED=0
export PYTHON="${PYTHON:=python}"
export PYTHONPATH="${PYTHONPATH}:`realpath .`" export PYTHONPATH="${PYTHONPATH}:`realpath .`"
for file in tests/test_*.py ; do for script in tests/run_*_tests.sh ; do
if ! ${PYTHON} $file --verbose --catch ; then if ! sh $script ; then
echo "Failed test(s) from $file" echo "Failed $script"
FAILED=1 FAILED=1
fi fi
done done
if ! ${PYTHON} scripts/powerline-lint -p powerline/config_files ; then
echo "Failed powerline-lint"
FAILED=1
fi
for script in tests/*.vim ; do
if ! vim -u NONE -S $script || test -f message.fail ; then
echo "Failed script $script" >&2
cat message.fail >&2
rm message.fail
FAILED=1
fi
done
if ! bash tests/test_shells/test.sh --fast ; then
echo "Failed shells"
if ${PYTHON} -c 'import platform, sys; sys.exit(1 * (platform.python_implementation() == "PyPy"))' ; then
FAILED=1
fi
fi
exit $FAILED exit $FAILED