Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test_quick #45

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sudo: false
language: generic

services:
- docker
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.PHONY: build push test

TAG:=11

build:
Expand All @@ -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
3 changes: 1 addition & 2 deletions example/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
5 changes: 5 additions & 0 deletions example/Dockerfile.quicktests
Original file line number Diff line number Diff line change
@@ -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
23 changes: 13 additions & 10 deletions example/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)"; \
Expand Down Expand Up @@ -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)" .

Expand All @@ -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