| @ -1,2 +1,3 @@ | |||||
| doc/tags | doc/tags | ||||
| .netrwhist | .netrwhist | ||||
| *.swp | |||||
| @ -0,0 +1 @@ | |||||
| .vim | |||||
| @ -0,0 +1,10 @@ | |||||
| # End To End Tests | |||||
| #### What is this?!? | |||||
| These are end to end tests written in bash. They need bash, vim and git to be run. | |||||
| They use real internet connection to download plugins from github, so you cannot run them without it. | |||||
| #### To run a specific test: | |||||
| ```bash | |||||
| $ bash test/end2end/nameOfTest.sh | |||||
| ``` | |||||
| @ -0,0 +1,36 @@ | |||||
| #!/bin/bash | |||||
| SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |||||
| source "${SCRIPT_DIR}/testUtils.sh" | |||||
| cd $SCRIPT_DIR | |||||
| # SOME CONSTANTS TO CONSTANTLY BE UPDATED | |||||
| VIM_FUGITIVE_CURRENT_VERSION="v2.2-71-gaac85a2" | |||||
| VIM_SURROUND_CURRENT_VERSION="v2.1-9-ge49d6c2" | |||||
| # 0. CLEAN | |||||
| clean | |||||
| # 1. INSTALL VUNDLE LOCALLY | |||||
| deployThisVundle | |||||
| # 2.1 INSTALL BUNDLES FROM FIRST LOCAL vimrc | |||||
| bundlesInstallUsing ${SCRIPT_DIR}/vimrc1 | |||||
| # 2.2 CHECK PLUGINS | |||||
| checkPluginPresenceAndVersion "vim-surround" "v2.1" # custom specified tag | |||||
| checkPluginPresenceAndVersion "vim-fugitive" $VIM_FUGITIVE_CURRENT_VERSION # actual master version | |||||
| checkPluginPresenceAndVersion "customFolderName" "1.79" # custom name and specified tag | |||||
| checkPluginPresenceAndVersion "vim-javascript" "v0.9.0" # another custom specified tag | |||||
| # 3.1. INSTALL BUNDLES FROM SECOND LOCAL vimrc | |||||
| bundlesInstallUsing ${SCRIPT_DIR}/vimrc2 | |||||
| # 3.2 CHECK PLUGINS | |||||
| checkPluginPresenceAndVersion "vim-surround" $VIM_SURROUND_CURRENT_VERSION # removed specified version | |||||
| checkPluginPresenceAndVersion "vim-fugitive" "v1.2" # added custom specified version | |||||
| checkPluginPresenceAndVersion "ctrlp.vim" "1.78" # removed custom name and changed tag version | |||||
| checkPluginPresenceAndVersion "vim-javascript" "v0.9.0" # nothing changed here | |||||
| # 4 GREEN BAR AND CLEAN | |||||
| successPrintAndClean | |||||
| @ -0,0 +1,48 @@ | |||||
| NC='\033[0m' # No Color | |||||
| BUNDLES_FOLDER="${SCRIPT_DIR}/.vim/bundle/" | |||||
| function successPrintAndClean { | |||||
| GREEN='\033[42m' | |||||
| printf "${GREEN} Green bar!! :-) ${NC}\n" | |||||
| clean | |||||
| } | |||||
| function errorPrintAndClean { | |||||
| RED='\033[41m' | |||||
| printf "${RED} $1 :-( ${NC}\n" | |||||
| clean | |||||
| } | |||||
| function clean { | |||||
| rm -rf ${SCRIPT_DIR}/.vim | |||||
| } | |||||
| function deployThisVundle { | |||||
| mkdir -p ${SCRIPT_DIR}/.vim/bundle/vundle | |||||
| cp -r ${SCRIPT_DIR}/../../* ./.vim/bundle/vundle/ 2> /dev/null | |||||
| } | |||||
| function bundlesInstallUsing { | |||||
| vim -u $1 +BundleInstall! +qall | |||||
| } | |||||
| function checkPluginPresenceAndVersion { | |||||
| name=$1 | |||||
| expectedVersion=$2 | |||||
| pluginFolder=${BUNDLES_FOLDER}${name} | |||||
| if [ ! -d $pluginFolder ]; then | |||||
| errorPrintAndClean "No plugin folder for ${name}!!" | |||||
| exit | |||||
| fi | |||||
| cd $pluginFolder | |||||
| gitDescribe=$(git describe --tags) | |||||
| if [ "$gitDescribe" != "$expectedVersion" ]; then | |||||
| errorPrintAndClean "Wrong plugin version for ${name} (${gitDescribe})!" | |||||
| exit | |||||
| fi | |||||
| cd $SCRIPT_DIR | |||||
| } | |||||
| @ -0,0 +1,14 @@ | |||||
| set nocompatible | |||||
| filetype off | |||||
| set rtp=./.vim/ | |||||
| set rtp+=./.vim/bundle/vundle/ | |||||
| call vundle#begin('./.vim/bundle') | |||||
| Plugin 'tpope/vim-fugitive' | |||||
| Plugin 'tpope/vim-surround', {'version': 'v2.1'} | |||||
| Plugin 'kien/ctrlp.vim', {'name': 'customFolderName', 'version': '1.79'} | |||||
| Plugin 'pangloss/vim-javascript', {'version': 'v0.9.0'} | |||||
| call vundle#end() | |||||
| @ -0,0 +1,13 @@ | |||||
| set nocompatible | |||||
| filetype off | |||||
| set rtp=./.vim/ | |||||
| set rtp+=./.vim/bundle/vundle/ | |||||
| call vundle#begin('./.vim/bundle') | |||||
| Plugin 'tpope/vim-fugitive', {'version': 'v1.2'} | |||||
| Plugin 'tpope/vim-surround' | |||||
| Plugin 'kien/ctrlp.vim', {'version': '1.78'} | |||||
| Plugin 'pangloss/vim-javascript', {'version': 'v0.9.0'} | |||||
| call vundle#end() | |||||