Started to test py2 and py3 on travis now.
I also learned that Vim 7.3 does not seem to be working at all anymore. Fixes a bug that only happens with python3.
This commit is contained in:
parent
01a17a1a41
commit
99eede1bf6
18
.travis.yml
18
.travis.yml
@ -1,17 +1,15 @@
|
||||
language: python
|
||||
|
||||
python:
|
||||
# TOOD: add support for one python3 version. The problem here is Vim: we need to install a version of vim that
|
||||
# has py3, but not py2. I could not figure this out so far.
|
||||
- 2.7
|
||||
- 3.3
|
||||
- 3.4
|
||||
env:
|
||||
- VIM_VERSION="74"
|
||||
|
||||
install: sudo ./install_vim.sh "${VIM_VERSION}" "$(python --version 2>&1)"
|
||||
|
||||
before_script:
|
||||
# Clone the dependent plugins we want to use.
|
||||
- ./test_all.py --clone-plugins
|
||||
# Install tmux (> 1.8) and vim.
|
||||
- sudo add-apt-repository ppa:kalakris/tmux -y
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq -y tmux vim-gnome
|
||||
# Start the testing session.
|
||||
- tmux new -d -s vim
|
||||
- vim --version
|
||||
|
||||
script: ./test_all.py -v --plugins --interface tmux --session vim
|
||||
|
@ -11,7 +11,7 @@ function! UltiSnips#bootstrap#Bootstrap()
|
||||
if !has("python3")
|
||||
if !has("python")
|
||||
if !exists("g:UltiSnipsNoPythonWarning")
|
||||
echo "UltiSnips requires py >= 2.6 or any py3"
|
||||
echo "UltiSnips requires py >= 2.7 or any py3"
|
||||
endif
|
||||
unlet g:_uspy
|
||||
return
|
||||
|
@ -74,12 +74,11 @@ http://www.sirver.net/blog/2012/03/31/fourth-episode-of-ultisnips-screencast/
|
||||
1.1 Requirements *UltiSnips-requirements*
|
||||
----------------
|
||||
|
||||
This plugin works with Vim version 7.0 or later. It only works if the
|
||||
This plugin works with Vim version 7.4 or later. It only works if the
|
||||
'compatible' setting is not set.
|
||||
|
||||
This plugin requires python >= 2.6. It has been specifically tested using
|
||||
python 2.7 and python 3.2 but should theoretically work on all versions of
|
||||
python >= 2.6.
|
||||
This plugin is tested against Python 2.7, 3.3 or 3.4. All other versions are
|
||||
unsupported, but might work.
|
||||
|
||||
The Python 2.x or Python 3.x interface must be available. In other words, Vim
|
||||
must be compiled with either the |+python| feature or the |+python3| feature.
|
||||
|
61
install_vim.sh
Normal file
61
install_vim.sh
Normal file
@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Installs a known version of vim in the travis test runner.
|
||||
set -ex
|
||||
|
||||
VIM_VERSION=$1; shift
|
||||
PYTHON_VERSION=$1; shift
|
||||
|
||||
build_vanilla_vim () {
|
||||
URL=$1; shift;
|
||||
|
||||
mkdir vim_build
|
||||
pushd vim_build
|
||||
|
||||
curl $URL -o vim.tar.bz2
|
||||
tar xjf vim.tar.bz2
|
||||
cd vim${VIM_VERSION}
|
||||
|
||||
PYTHON_BUILD_CONFIG=""
|
||||
if [[ $PYTHON_VERSION =~ "Python 2." ]]; then
|
||||
PYTHON_BUILD_CONFIG="--enable-pythoninterp"
|
||||
else
|
||||
PYTHON_BUILD_CONFIG="--enable-python3interp"
|
||||
fi
|
||||
./configure \
|
||||
--prefix=${HOME} \
|
||||
--disable-nls \
|
||||
--disable-sysmouse \
|
||||
--disable-gpm \
|
||||
--enable-gui=no \
|
||||
--enable-multibyte \
|
||||
--with-features=huge \
|
||||
--with-tlib=ncurses \
|
||||
--without-x \
|
||||
${PYTHON_BUILD_CONFIG}
|
||||
|
||||
make install
|
||||
popd
|
||||
|
||||
rm -rf vim_build
|
||||
}
|
||||
|
||||
# Clone the dependent plugins we want to use.
|
||||
./test_all.py --clone-plugins
|
||||
|
||||
# Install tmux (> 1.8) and vim.
|
||||
add-apt-repository ppa:kalakris/tmux -y
|
||||
apt-get update -qq
|
||||
apt-get install -qq -y tmux
|
||||
|
||||
if [[ $VIM_VERSION == "74" ]]; then
|
||||
build_vanilla_vim ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
|
||||
else
|
||||
echo "Unknown VIM_VERSION: $VIM_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dirty hack, since PATH seems to be ignored.
|
||||
ln -sf /home/travis/bin/vim /usr/bin/vim
|
||||
|
||||
vim --version
|
@ -11,7 +11,7 @@ class SnippetDictionary(object):
|
||||
def __init__(self):
|
||||
self._snippets = []
|
||||
self._cleared = {}
|
||||
self._clear_priority = None
|
||||
self._clear_priority = float("-inf")
|
||||
|
||||
def add_snippet(self, snippet):
|
||||
"""Add 'snippet' to this dictionary."""
|
||||
|
@ -32,6 +32,7 @@ class VimTestCase(unittest.TestCase, TempFileManager):
|
||||
# Skip this test for the given reason or None for not skipping it.
|
||||
skip_if = lambda self: None
|
||||
version = None # Will be set to vim --version output
|
||||
maxDiff = None # Show all diff output, always.
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
unittest.TestCase.__init__(self, *args, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user