Test for go

This commit is contained in:
Ben Jackson 2019-07-31 22:46:09 +01:00
commit 29989ffbfb
6 changed files with 87 additions and 3 deletions

View file

@ -37,6 +37,9 @@ stages:
image: 'puremourning/vimspector:test'
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
steps:
- bash: go get -u github.com/go-delve/delve/cmd/dlv
displayName: 'Install Delve for Go'
- bash: python3 install_gadget.py --all
displayName: 'Install gadgets'
@ -63,6 +66,9 @@ stages:
- bash: brew install macvim
displayName: 'Install vim'
- bash: go get -u github.com/go-delve/delve/cmd/dlv
displayName: 'Install Delve for Go'
- bash: python3 install_gadget.py --all
displayName: 'Install gadgets'

View file

@ -1,18 +1,22 @@
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL C.UTF-8
RUN apt-get update && \
apt-get -y dist-upgrade && \
apt-get -y install python3-dev \
python3-pip \
ca-cacert \
locales \
language-pack-en \
libncurses5-dev libncursesw5-dev \
git \
tcl-dev \
tcllib \
gdb \
lldb && \
lldb \
curl && \
apt-get -y autoremove
RUN ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime && \
@ -36,3 +40,17 @@ RUN mkdir -p $HOME/vim && \
git checkout ${VIM_VERSION} && \
make -j 4 install
# linuxbrew (homebrew)
RUN mkdir -p /home/linuxbrew/.linuxbrew &&\
chmod -R go+rwx /home/linuxbrew && \
mkdir -p /home/linuxbrew/.linuxbrew/bin && \
git clone https://github.com/Homebrew/brew /home/linuxbrew/.linuxbrew/Homebrew && \
ln -s /home/linuxbrew/.linuxbrew/Homebrew/bin/brew /home/linuxbrew/.linuxbrew/bin && \
echo "eval \$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" \
> /etc/bash.bashrc
RUN /home/linuxbrew/.linuxbrew/bin/brew install golang
# clean up
RUN /home/linuxbrew/.linuxbrew/bin/brew cleanup && \
rm -rf ~/.cache

View file

@ -2,4 +2,10 @@
set -e
docker build --no-cache -t puremourning/vimspector:test image/
if [ "$1" = "--continue" ]; then
OPTS=""
else
OPTS="--no-cache"
fi
docker build ${OPTS} -t puremourning/vimspector:test image/

View file

@ -0,0 +1,46 @@
function! SetUp()
call vimspector#test#setup#SetUpWithMappings( v:none )
endfunction
function! ClearDown()
call vimspector#test#setup#ClearDown()
endfunction
function! SetUp_Test_Go_Simple()
let g:vimspector_enable_mappings = 'HUMAN'
endfunction
function! Test_Go_Simple()
let fn='hello-world.go'
lcd ../support/test/go/hello_world
exe 'edit ' . fn
call setpos( '.', [ 0, 4, 1 ] )
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 4, 1 )
call vimspector#test#signs#AssertSignGroupEmptyAtLine( 'VimspectorBP', 4 )
" Add the breakpoint
call feedkeys( "\<F9>", 'xt' )
call vimspector#test#signs#AssertSignGroupSingletonAtLine( 'VimspectorBP',
\ 4,
\ 'vimspectorBP' )
call setpos( '.', [ 0, 1, 1 ] )
" Here we go. Start Debugging
call feedkeys( "\<F5>", 'xt' )
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 4, 1 )
" Step
call feedkeys( "\<F10>", 'xt' )
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 5, 1 )
call WaitForAssert( {->
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 5 )
\ } )
call vimspector#test#setup#Reset()
lcd -
%bwipeout!
endfunction

View file

@ -2,4 +2,10 @@
set -e
docker build --no-cache -t puremourning/vimspector:manual image/
if [ "$1" = "--continue" ]; then
OPTS=""
else
OPTS="--no-cache"
fi
docker build ${OPTS} -t puremourning/vimspector:manual image/

View file

@ -4,6 +4,8 @@ CONTAINER=puremourning/vimspector:manual
if [ "$@" ];then
CMD="$@"
else
CMD="bash -l"
fi
docker run --cap-add=SYS_PTRACE \