From 3d21dbe888ae54b9d099c1f49dd4b09cb288780b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 5 Oct 2017 00:47:29 +0200 Subject: [PATCH 01/16] Makefile: add test_coverage --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 30e38f308..fe935dea1 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,13 @@ test: build/vader | build vim -Nu test/vimrc -c 'Vader! test/**' +test_coverage: build/covimerage build/vader | build + build/covimerage/bin/covimerage run vim -Nu test/vimrc -c 'Vader! test/**' + +build/covimerage: + virtualenv $@ + . $@/bin/activate && pip install https://github.com/Vimjas/covimerage/archive/develop.zip + build/vader: git clone --depth 1 https://github.com/junegunn/vader.vim.git $@ From b7936b900e066495327fa59ee05cc79cad7c4f72 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 5 Oct 2017 00:50:06 +0200 Subject: [PATCH 02/16] Travis: use test_coverage and upload to codecov --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 22aaa8cae..2bec8a1fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,5 +58,8 @@ script: elif [ "$LINT" = "vint-errors" ]; then vint --error . elif [ "$LINT" = "vader" ]; then - make test + make test_coverage + build/covimerage/bin/covimerage xml + pip install codecov + codecov -X search gcov pycov -f coverage.xml fi From a39ac0895c7cdd0f3fdf5925e235324cdec1ba05 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 6 Oct 2017 00:32:57 +0200 Subject: [PATCH 03/16] Makefile: build/covimerage: no cache dir for pip --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fe935dea1..c482d367d 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ test_coverage: build/covimerage build/vader | build build/covimerage: virtualenv $@ - . $@/bin/activate && pip install https://github.com/Vimjas/covimerage/archive/develop.zip + . $@/bin/activate && pip install --no-cache-dir https://github.com/Vimjas/covimerage/archive/develop.zip build/vader: git clone --depth 1 https://github.com/junegunn/vader.vim.git $@ From 0ba2bf1f2e5b5103e0352402e53a13bf8cb3999b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 7 Oct 2017 18:43:03 +0200 Subject: [PATCH 04/16] fixup! Travis: use test_coverage and upload to codecov --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2bec8a1fa..650e91d60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,8 +58,9 @@ script: elif [ "$LINT" = "vint-errors" ]; then vint --error . elif [ "$LINT" = "vader" ]; then + pip install --no-cache-dir https://github.com/Vimjas/covimerage/archive/develop.zip make test_coverage - build/covimerage/bin/covimerage xml + covimerage xml pip install codecov codecov -X search gcov pycov -f coverage.xml fi From 13934b803db7a409d8a0f3c1d5c68acabb6d181b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 7 Oct 2017 18:43:32 +0200 Subject: [PATCH 05/16] squash! Makefile: build/covimerage: no cache dir for pip Squash with "Makefile: add test_coverage". --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c482d367d..4e0e2f81b 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,15 @@ test: build/vader | build vim -Nu test/vimrc -c 'Vader! test/**' -test_coverage: build/covimerage build/vader | build - build/covimerage/bin/covimerage run vim -Nu test/vimrc -c 'Vader! test/**' +COVIMERAGE=$(shell command -v ccovimerage 2>/dev/null || echo build/covimerage/bin/covimerage) + +test_coverage: $(COVIMERAGE) build/vader | build + $(COVIMERAGE) run vim -Nu test/vimrc -c 'Vader! test/**' build/covimerage: virtualenv $@ - . $@/bin/activate && pip install --no-cache-dir https://github.com/Vimjas/covimerage/archive/develop.zip +build/covimerage/bin/covimerage: | build/covimerage + . build/covimerage/bin/activate && pip install covimerage build/vader: git clone --depth 1 https://github.com/junegunn/vader.vim.git $@ From a05ce619e3383fdd32b68b52fce53500ef940c51 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 8 Oct 2017 22:25:37 +0200 Subject: [PATCH 06/16] covimerage -vv xml --omit 'build/*' --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 650e91d60..257e5871c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,7 +60,7 @@ script: elif [ "$LINT" = "vader" ]; then pip install --no-cache-dir https://github.com/Vimjas/covimerage/archive/develop.zip make test_coverage - covimerage xml + covimerage -vv xml --omit 'build/*' pip install codecov codecov -X search gcov pycov -f coverage.xml fi From e1c4cac000a462828b8345f316803feb5ac842a8 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 8 Oct 2017 22:59:48 +0200 Subject: [PATCH 07/16] rebuild From bd32a694e065528be107252b9a46d3cfff16890c Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 9 Oct 2017 23:14:53 +0800 Subject: [PATCH 08/16] Add appveyor badges --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5c1a3e382..eef1fb67c 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ [中文文档](http://spacevim.org/README_zh_cn/) [![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim) +[![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/dev?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/dev) [![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/master/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim) ![Version](https://img.shields.io/badge/version-0.5.0--dev-FF00CC.svg) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) From 68a49b057f3422412229deb1804b2eea49ed1cae Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 10 Oct 2017 19:34:54 +0800 Subject: [PATCH 09/16] Update project layout --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 5c1a3e382..3974a309f 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,17 @@ for more info about the install script, please check: curl -sLf https://spacevim.org/install.sh | bash -s -- -h ``` +### Project layout + +``` +autoload/SpaceVim/api SpaceVim APIs +autoload/SpaceVim/layers SpaceVim layers +autoload/SpaceVim/plugins SpaceVim plugins +autoload/SpaceVim/mapping SpaceVim mapping guide +doc/SpaceVim.txt SpaceVim help +docs/ website of SpaceVim +``` + ### Features - **Great documentation:** access documentation in Vim with :h SpaceVim. From 8c63dec59ccd119fb05404d5d743efd06cdb1806 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 10 Oct 2017 19:46:33 +0800 Subject: [PATCH 10/16] Update project layout --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3974a309f..19784a6d9 100644 --- a/README.md +++ b/README.md @@ -46,12 +46,13 @@ curl -sLf https://spacevim.org/install.sh | bash -s -- -h ### Project layout ``` -autoload/SpaceVim/api SpaceVim APIs -autoload/SpaceVim/layers SpaceVim layers -autoload/SpaceVim/plugins SpaceVim plugins -autoload/SpaceVim/mapping SpaceVim mapping guide -doc/SpaceVim.txt SpaceVim help -docs/ website of SpaceVim +├─ autoload/SpaceVim/api/ SpaceVim APIs +├─ autoload/SpaceVim/layers/ SpaceVim layers +├─ autoload/SpaceVim/plugins/ SpaceVim plugins +├─ autoload/SpaceVim/mapping/ SpaceVim mapping guide +├─ doc/SpaceVim.txt SpaceVim help +├─ docs/ website of SpaceVim +└─ test/ tests ``` ### Features From 4e024c0270044632f43412c8a5e1330381635f80 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 10 Oct 2017 20:03:05 +0800 Subject: [PATCH 11/16] Add test --- appveyor.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..81e4fb215 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,9 @@ +version: 1.0.{build} +pull_requests: + do_not_increment_build_number: true +skip_tags: true +clone_depth: 1 +test_script: +- ps: make test +build: off +deploy: off From e975410af6871e050851253abad87ec97f893173 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 10 Oct 2017 20:29:21 +0800 Subject: [PATCH 12/16] Use dev branch --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1cf4367b8..f1e5c10ea 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim) [![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/dev?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/dev) -[![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/master/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim) +[![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev) ![Version](https://img.shields.io/badge/version-0.5.0--dev-FF00CC.svg) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg)](doc/SpaceVim.txt) From 764a7b399b402b69efe31ffc60dd6a80511cb58d Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 10 Oct 2017 20:57:09 +0800 Subject: [PATCH 13/16] test main vimrc --- config/main.vim | 1 - test/init.vader | 3 +++ test/test.vader | 21 --------------------- 3 files changed, 3 insertions(+), 22 deletions(-) create mode 100644 test/init.vader delete mode 100644 test/test.vader diff --git a/config/main.vim b/config/main.vim index 947589258..ad14c4f6c 100644 --- a/config/main.vim +++ b/config/main.vim @@ -64,5 +64,4 @@ endif call zvim#util#source_rc('commands.vim') filetype plugin indent on syntax on - " vim:set et sw=2 cc=80: diff --git a/test/init.vader b/test/init.vader new file mode 100644 index 000000000..e189b2340 --- /dev/null +++ b/test/init.vader @@ -0,0 +1,3 @@ +Execute ( SpaceVim api: vim#buffer open ): + source init.vim + AssertEqual fnamemodify(g:Config_Main_Home, ':.'), 'config' diff --git a/test/test.vader b/test/test.vader deleted file mode 100644 index 740bcfa67..000000000 --- a/test/test.vader +++ /dev/null @@ -1,21 +0,0 @@ -Execute (Clear search history): - for _ in range(&history) - call histdel('/', -1) - endfor - -Given (Search and destroy): - I'm a street walking cheetah with a heart full of napalm - I'm a runaway son of the nuclear A-bomb - I'm a world's forgotten boy - The one who searches and destroys - -Do (Searches): - /street\ - /walking\ - /cheetah\ - /runaway\ - /search\ - -Execute (Assertions): - Log string(map(range(1, &history), 'histget("/", - v:val)')) - AssertEqual 'search', histget('/', -1) From 15828967c81c14af3becae9654718cd2fcfb072d Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 10 Oct 2017 21:14:46 +0800 Subject: [PATCH 14/16] Test changed vim script only --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 257e5871c..75756a32a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,12 +44,12 @@ script: - | set -ex if [ "$LINT" = "vimlint" ]; then - for file in $(find . -name "*.vim"); + for file in $(git diff --name-only HEAD dev | grep .vim$); do sh /tmp/vimlint/bin/vimlint.sh -l /tmp/vimlint -p /tmp/vimlparser $file; done elif [ "$LINT" = "vimlint-errors" ]; then - for file in $(find . -name "*.vim"); + for file in $(git diff --name-only HEAD dev | grep .vim$); do sh /tmp/vimlint/bin/vimlint.sh -E -l /tmp/vimlint -p /tmp/vimlparser $file; done From e02a54575f23035203516b39ae8f61e88fe85ea2 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 10 Oct 2017 21:28:04 +0800 Subject: [PATCH 15/16] Clone dein when test vader --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 257e5871c..0fe5e03cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,7 @@ install: elif [ "${LINT#vint}" != "$LINT" ]; then virtualenv /tmp/vint && source /tmp/vint/bin/activate && pip install vim-vint elif [ "${LINT#vader}" != "$LINT" ]; then + git clone --depth=1 https://github.com/Shougo/dein.vim.git ~/.cache/vimfiles/repos/github.com/Shougo/dein.vim C_OPTS="--prefix=$DEPS --with-features=huge --disable-gui --enable-pythoninterp" (git clone --depth 1 https://github.com/vim/vim /tmp/vim && cd /tmp/vim && From 6ac7bf1ab28fa618c1c10c5b76e34658e6c8c3a1 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 10 Oct 2017 22:09:51 +0800 Subject: [PATCH 16/16] Add codecov --- codecov.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..d05a32202 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,9 @@ +coverage: + range: 50..70 + round: down + precision: 2 +comment: + layout: "header, diff, changes, uncovered" + behavior: default # update if exists else create new +codecov: + branch: dev