diff --git a/.travis.yml b/.travis.yml index e33c09c..55ece2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ sudo: false +language: generic services: - docker diff --git a/Makefile b/Makefile index cc4cb31..44bf3ed 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ -.PHONY: build push test - TAG:=11 build: @@ -14,6 +12,9 @@ update_latest: # test: build the base image and example image on top, running tests therein. DOCKER_BASE_IMAGE:=vim-testbed-base -test: + +test test_quick: docker build -t "$(DOCKER_BASE_IMAGE)" . - make -C example test + make -C example $@ + +.PHONY: build push test test_quick diff --git a/example/Dockerfile b/example/Dockerfile index 2160252..fb32318 100644 --- a/example/Dockerfile +++ b/example/Dockerfile @@ -1,7 +1,6 @@ FROM testbed/vim -RUN install_vim -tag v7.1 -name vim71 -prebuild_script 'echo "#define FEAT_PROFILE" >> src/feature.h' -build \ - -tag v7.3.429 -name vim73 -py -build \ +RUN install_vim -tag v7.3.429 -name vim73 -py -build \ -tag v7.4.052 -name vim74-trusty -build \ -tag master -py2 -py3 -ruby -lua -build \ -tag neovim:v0.2.0 -py2 -py3 -ruby -build \ diff --git a/example/Dockerfile.quicktests b/example/Dockerfile.quicktests new file mode 100644 index 0000000..6cfdcde --- /dev/null +++ b/example/Dockerfile.quicktests @@ -0,0 +1,5 @@ +# Dockerfile for quick tests. +FROM vim-testbed-base + +RUN install_vim -tag v7.1 -name vim71 \ + -prebuild_script 'echo "#define FEAT_PROFILE" >> src/feature.h' -build diff --git a/example/Makefile b/example/Makefile index 5f7d092..9811feb 100644 --- a/example/Makefile +++ b/example/Makefile @@ -7,13 +7,22 @@ WRITABLE_HOME:=$(shell tmpdir=$$(mktemp -d --dry-run); \ cd $(CURDIR)/test; \ cp -a vimrc *.vader $${tmpdir}/; \ echo $${tmpdir}) -DOCKER = docker run -a stderr --rm \ +DOCKER = docker run -ti --rm \ -v $(CURDIR):/testplugin \ -v $(WRITABLE_HOME):/home/vimtest \ -v $(CURDIR)/$(PLUGINS):/home/vimtest/plugins "$(IMAGE)" -test: build $(PLUGINS)/vader.vim -test: test_vim71_with_profiling_enabled +test_quick: $(PLUGINS)/vader.vim +test_quick: + docker build -f Dockerfile.quicktests -t "$(IMAGE)" . + docker run --rm "$(IMAGE)" vim71 -es -u NORC -c "exe has('profile') ? 'q' : 'cq'" || { \ + echo "vim71 should have FEAT_PROFILE enabled."; \ + docker run --rm "$(IMAGE)" vim71 --version; \ + exit 1; } + $(DOCKER) vim71 '+Vader! test/*' + +test: test_quick +test: Dockerfile.tests $(PLUGINS)/vader.vim test: set -ex; \ vims="$$(docker run --rm $(IMAGE) ls /vim-build/bin | grep vim)"; \ @@ -69,12 +78,6 @@ test: exit 1; \ fi -test_vim71_with_profiling_enabled: - docker run --rm "$(IMAGE)" vim71 -es -u NORC -c "exe has('profile') ? 'q' : 'cq'" || { \ - echo "vim71 should have FEAT_PROFILE enabled."; \ - docker run --rm "$(IMAGE)" vim71 --version; \ - exit 1; } - build: Dockerfile.tests docker build -f Dockerfile.tests -t "$(IMAGE)" . @@ -87,4 +90,4 @@ $(PLUGINS)/vader.vim: mkdir -p $(PLUGINS) cd $(PLUGINS) && git clone https://github.com/junegunn/vader.vim.git -.PHONY: test-setup test +.PHONY: test