Skip to content

Commit aee8654

Browse files
committed
enable tests on Travis CI.
1 parent 2fff43c commit aee8654

File tree

5 files changed

+54
-0
lines changed

5 files changed

+54
-0
lines changed

.travis.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
language: generic
2+
sudo: false
3+
git:
4+
depth: 10
5+
6+
matrix:
7+
include:
8+
- os: linux
9+
env: VIM_VERSION=v7.4
10+
- os: linux
11+
env: VIM_VERSION=v8.0.0000
12+
- os: linux
13+
env: VIM_VERSION=master
14+
- os: osx
15+
16+
addons:
17+
apt:
18+
packages:
19+
- language-pack-ja
20+
- vim
21+
22+
install:
23+
- bash scripts/install-vim.sh
24+
- export PATH=$HOME/vim/bin:$PATH
25+
26+
script:
27+
- uname -a
28+
- which -a vim
29+
- vim --cmd version --cmd quit
30+
- test/run.sh

scripts/install-vim.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -ev
4+
5+
git clone --depth 1 --branch "${VIM_VERSION}" https://github.com/vim/vim /tmp/vim
6+
cd /tmp/vim
7+
./configure --prefix="${HOME}/vim" --with-features=big --enable-fail-if-missing
8+
make -j2
9+
make install

test/run.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
@echo off
22
vim -u NONE -N --cmd "let &rtp .= ',' . getcwd()" -S test/run.vim
3+
set EXIT=%ERRORLEVEL%
4+
if exist test.log type test.log
5+
exit /b %EXIT%

test/run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
#!/bin/sh
22
vim -u NONE -N --cmd "let &rtp .= ',' . getcwd()" -S test/run.vim
3+
EXIT=$?
4+
[ -e test.log ] && cat test.log
5+
exit $EXIT

test/run.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ let s:vimlparser = vimlparser#import()
55
let s:sdir = expand('<sfile>:p:h')
66

77
function! s:run()
8+
let ng = 0
89
for vimfile in glob(s:sdir . '/test*.vim', 0, 1)
910
let okfile = fnamemodify(vimfile, ':r') . '.ok'
1011
let outfile = fnamemodify(vimfile, ':r') . '.out'
@@ -27,9 +28,17 @@ function! s:run()
2728
let line = printf('%s => ok', fnamemodify(vimfile, ':.'))
2829
else
2930
let line = printf('%s => ng', fnamemodify(vimfile, ':.'))
31+
let ng += 1
3032
endif
3133
call append(line('$'), line)
3234
endfor
35+
if $CI == 'true'
36+
call writefile(getline(1, '$'), 'test.log')
37+
if ng == 0
38+
quit!
39+
endif
40+
cquit!
41+
endif
3342
syntax enable
3443
match Error /^.* => ng$/
3544
endfunction

0 commit comments

Comments
 (0)