Do not execute all tests in travis

This commit is contained in:
ZyX 2014-08-23 15:16:30 +04:00
parent 0232d3215b
commit 9b7052bf3e
2 changed files with 31 additions and 4 deletions

View File

@ -20,7 +20,7 @@ for script in tests/*.vim ; do
FAILED=1 FAILED=1
fi fi
done done
if ! bash tests/test_shells/test.sh ; then if ! bash tests/test_shells/test.sh --fast ; then
echo "Failed shells" echo "Failed shells"
if ${PYTHON} -c 'import platform, sys; sys.exit(1 * (platform.python_implementation() == "PyPy"))' ; then if ${PYTHON} -c 'import platform, sys; sys.exit(1 * (platform.python_implementation() == "PyPy"))' ; then
FAILED=1 FAILED=1

View File

@ -1,10 +1,18 @@
#!/bin/bash #!/bin/bash
: ${PYTHON:=python} : ${PYTHON:=python}
FAILED=0 FAILED=0
if test "x$1" = "x--fast" ; then
FAST=1
shift
fi
ONLY_SHELL="$1" ONLY_SHELL="$1"
ONLY_TEST_TYPE="$2" ONLY_TEST_TYPE="$2"
COMMAND_PATTERN="$3" COMMAND_PATTERN="$3"
if ! test -z "$ONLY_SHELL$ONLY_TEST_TYPE$COMMAND_PATTERN" ; then
FAST=
fi
export PYTHON export PYTHON
if test "x$ONLY_SHELL" = "x--help" ; then if test "x$ONLY_SHELL" = "x--help" ; then
@ -222,6 +230,16 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te
scripts/powerline-config shell command scripts/powerline-config shell command
for TEST_TYPE in "daemon" "nodaemon" ; do for TEST_TYPE in "daemon" "nodaemon" ; do
if test x$FAST = x1 ; then
if test $TEST_TYPE = daemon ; then
VARIANTS=3
else
VARIANTS=4
fi
EXETEST="$(( ${RANDOM:-`date +%N | sed s/^0*//`} % $VARIANTS ))"
echo "Execute tests: $EXETEST"
fi
if test $TEST_TYPE = daemon ; then if test $TEST_TYPE = daemon ; then
sh -c ' sh -c '
echo $$ > tests/shell/daemon_pid echo $$ > tests/shell/daemon_pid
@ -232,6 +250,7 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te
continue continue
fi fi
echo "> Testing $TEST_TYPE" echo "> Testing $TEST_TYPE"
I=-1
for POWERLINE_COMMAND in \ for POWERLINE_COMMAND in \
$PWD/scripts/powerline \ $PWD/scripts/powerline \
$PWD/scripts/powerline-render \ $PWD/scripts/powerline-render \
@ -244,6 +263,10 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te
*powerline.py) TEST_CLIENT=python ;; *powerline.py) TEST_CLIENT=python ;;
*powerline.sh) TEST_CLIENT=shell ;; *powerline.sh) TEST_CLIENT=shell ;;
esac esac
if test "$TEST_CLIENT" = render && test "$TEST_TYPE" = daemon ; then
continue
fi
I="$(( I + 1 ))"
if test "$TEST_CLIENT" = "C" && ! test -x scripts/powerline ; then if test "$TEST_CLIENT" = "C" && ! test -x scripts/powerline ; then
if which powerline >/dev/null ; then if which powerline >/dev/null ; then
POWERLINE_COMMAND=powerline POWERLINE_COMMAND=powerline
@ -254,9 +277,6 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te
if test "$TEST_CLIENT" = "shell" && ! which socat >/dev/null ; then if test "$TEST_CLIENT" = "shell" && ! which socat >/dev/null ; then
continue continue
fi fi
if test "$TEST_CLIENT" = render && test "$TEST_TYPE" = daemon ; then
continue
fi
if test "x$COMMAND_PATTERN" != "x" && ! ( if test "x$COMMAND_PATTERN" != "x" && ! (
echo "$POWERLINE_COMMAND" | grep -e"$COMMAND_PATTERN" &>/dev/null) echo "$POWERLINE_COMMAND" | grep -e"$COMMAND_PATTERN" &>/dev/null)
then then
@ -265,6 +285,7 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te
POWERLINE_COMMAND="$POWERLINE_COMMAND --socket $ADDRESS" POWERLINE_COMMAND="$POWERLINE_COMMAND --socket $ADDRESS"
export POWERLINE_COMMAND export POWERLINE_COMMAND
echo ">> powerline command is ${POWERLINE_COMMAND:-empty}" echo ">> powerline command is ${POWERLINE_COMMAND:-empty}"
J=-1
for TEST_COMMAND in \ for TEST_COMMAND in \
"bash --norc --noprofile -i" \ "bash --norc --noprofile -i" \
"zsh -f -i" \ "zsh -f -i" \
@ -274,6 +295,12 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te
"mksh -i" \ "mksh -i" \
"dash -i" "dash -i"
do do
J="$(( J + 1 ))"
if test x$FAST = x1 ; then
if test $(( (I + J) % $VARIANTS )) -ne $EXETEST ; then
continue
fi
fi
SH="${TEST_COMMAND%% *}" SH="${TEST_COMMAND%% *}"
if test "x$ONLY_SHELL" != "x" && test "x$ONLY_SHELL" != "x$SH" ; then if test "x$ONLY_SHELL" != "x" && test "x$ONLY_SHELL" != "x$SH" ; then
continue continue