Skip to content
Snippets Groups Projects
Commit 4a2e8b18 authored by Jerome Reybert's avatar Jerome Reybert
Browse files

travis: move some complexity out of travis description (less parallel, but simpler)

parent e9c93e5b
No related branches found
No related tags found
No related merge requests found
......@@ -10,31 +10,21 @@ os:
- osx
env:
- VIM_VERSION=normal TEST_SUB_PATH=./
- VIM_VERSION=normal TEST_SUB_PATH=books/templates/
- VIM_VERSION=last TEST_SUB_PATH=./
- VIM_VERSION=last TEST_SUB_PATH=books/templates/
- VIM_VERSION=neovim TEST_SUB_PATH=./
- VIM_VERSION=neovim TEST_SUB_PATH=books/templates/
- VIM_VERSION=macvim TEST_SUB_PATH=./
- VIM_VERSION=macvim TEST_SUB_PATH=books/templates/
- VIM_VERSION=normal
- VIM_VERSION=last
- VIM_VERSION=neovim
- VIM_VERSION=macvim
matrix:
exclude:
- os: osx
env: VIM_VERSION=last TEST_SUB_PATH=./
- os: osx
env: VIM_VERSION=last TEST_SUB_PATH=books/templates/
env: VIM_VERSION=last
# neovim build fails with homebrew
# Error: undefined method `desc' for Neovim:Class
- os: osx
env: VIM_VERSION=neovim TEST_SUB_PATH=./
- os: osx
env: VIM_VERSION=neovim TEST_SUB_PATH=books/templates/
- os: linux
env: VIM_VERSION=macvim TEST_SUB_PATH=./
env: VIM_VERSION=neovim
- os: linux
env: VIM_VERSION=macvim TEST_SUB_PATH=books/templates/
env: VIM_VERSION=macvim
install:
- if [ "$TRAVIS_OS_NAME" = 'osx' ]; then
......
......@@ -12,11 +12,10 @@ python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])
export VIMAGIT_PATH=$(prealpath $1)
export VADER_PATH=$(prealpath $2)
export TEST_PATH=$(prealpath $3)
export TEST_SUB_PATH=$(prealpath $TEST_PATH/$TEST_SUB_PATH)
export VIM_VERSION=$4
if [[ ! ( -d $VIMAGIT_PATH && -d $VADER_PATH && -d $TEST_PATH && -d $TEST_SUB_PATH) ]]; then
echo "can't access to one of them '$VIMAGIT_PATH' '$VADER_PATH' '$TEST_PATH' '$TEST_SUB_PATH'"
if [[ ! ( -d $VIMAGIT_PATH && -d $VADER_PATH && -d $TEST_PATH ) ]]; then
echo "can't access to one of them '$VIMAGIT_PATH' '$VADER_PATH' '$TEST_PATH'"
exit 1
fi
......@@ -37,20 +36,19 @@ fi
echo 'Vim version'
$VIM --version
for line in $(cat "$VIMAGIT_PATH/test/test.run"); do
source $VIMAGIT_PATH/test/test.config
IFS=':' read -a arr <<< "$line"
script_filename=${arr[0]}
IFS=',' read -a test_files <<< "${arr[1]}"
for script in ${!test_scripts[@]}; do
for filename in ${test_files[@]}; do
echo "Test $script_filename with $filename"
for filename in ${test_scripts[$script]}; do
for test_path in ${test_paths[@]}; do
export TEST_SUB_PATH=$(prealpath $TEST_PATH/$test_path)
export VIMAGIT_TEST_FILENAME=$filename
for i in 1 0; do
export VIMAGIT_TEST_FROM_EOL=$i
echo "Test commands from $([ $i -eq 1 ] && echo "end" || echo "start") of line"
echo "Test $script with $filename from path $TEST_SUB_PATH and from $([ $i -eq 1 ] && echo "end" || echo "start") of line"
$VIM -Nu <(cat << EOF
filetype off
......@@ -60,9 +58,9 @@ for line in $(cat "$VIMAGIT_PATH/test/test.run"); do
set rtp+=$VADER_PATH
filetype plugin indent on
syntax enable
EOF) -c "Vader! $VIMAGIT_PATH/test/$script_filename"
EOF) -c "Vader! $VIMAGIT_PATH/test/$script"
done
done
done
done
declare -a test_paths=(./ ./books/templates/)
declare -A test_scripts=( [addFile.vader]='bootstrap books/models.py' [ignoreFile.vader]='bootstrap' )
addFile.vader:bootstrap,books/models.py
ignoreFile.vader:bootstrap
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment