Add a test for csharp, run in CI
This commit is contained in:
parent
b4195eee93
commit
f389d65a24
6 changed files with 100 additions and 4 deletions
5
.github/workflows/build.yaml
vendored
5
.github/workflows/build.yaml
vendored
|
|
@ -111,6 +111,11 @@ jobs:
|
||||||
path: gadgets/macos/download
|
path: gadgets/macos/download
|
||||||
name: Cache gadgets
|
name: Cache gadgets
|
||||||
|
|
||||||
|
- name: 'Install .NET Core SDK 3.1'
|
||||||
|
uses: actions/setup-dotnet@v1.7.2
|
||||||
|
with:
|
||||||
|
dotnet-version: 3.1
|
||||||
|
|
||||||
- run: vim --version
|
- run: vim --version
|
||||||
name: 'Print vim version information'
|
name: 'Print vim version information'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,8 @@ if [ "$INSTALL" = "1" ] || [ "$INSTALL" = "script" ]; then
|
||||||
if ! python3 $(dirname $0)/install_gadget.py \
|
if ! python3 $(dirname $0)/install_gadget.py \
|
||||||
--basedir ${BASEDIR} \
|
--basedir ${BASEDIR} \
|
||||||
${INSTALLER_ARGS} \
|
${INSTALLER_ARGS} \
|
||||||
--all; then
|
--all \
|
||||||
|
--force-enable-csharp; then
|
||||||
echo "Script installation reported errors" >&2
|
echo "Script installation reported errors" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -102,7 +103,7 @@ if [ "$INSTALL" = "1" ] || [ "$INSTALL" = "vim" ]; then
|
||||||
--cmd "${BASEDIR_CMD}" \
|
--cmd "${BASEDIR_CMD}" \
|
||||||
-c 'autocmd User VimspectorInstallSuccess qa!' \
|
-c 'autocmd User VimspectorInstallSuccess qa!' \
|
||||||
-c 'autocmd User VimspectorInstallFailed cquit!' \
|
-c 'autocmd User VimspectorInstallFailed cquit!' \
|
||||||
-c "VimspectorInstall --all"; then
|
-c "VimspectorInstall --all netcoredbg"; then
|
||||||
echo "Vim installation reported errors" >&2
|
echo "Vim installation reported errors" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -144,6 +145,9 @@ set -e
|
||||||
pushd tests/testdata/cpp/simple
|
pushd tests/testdata/cpp/simple
|
||||||
make clean all
|
make clean all
|
||||||
popd
|
popd
|
||||||
|
pushd support/test/csharp
|
||||||
|
dotnet build
|
||||||
|
popd
|
||||||
set +e
|
set +e
|
||||||
echo "%DONE - built test programs"
|
echo "%DONE - built test programs"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceRoot}/bin/Debug/netcoreapp3.1/csharp.dll",
|
"program": "${workspaceRoot}/bin/Debug/netcoreapp3.1/csharp.dll",
|
||||||
"args": [],
|
"args": [],
|
||||||
"stopAtEntry": true
|
"stopAtEntry": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"launch - netcoredbg - with debug log": {
|
"launch - netcoredbg - with debug log": {
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceRoot}/bin/Debug/netcoreapp3.1/csharp.dll",
|
"program": "${workspaceRoot}/bin/Debug/netcoreapp3.1/csharp.dll",
|
||||||
"args": [],
|
"args": [],
|
||||||
"stopAtEntry": true
|
"stopAtEntry": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"launch - mono": {
|
"launch - mono": {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 15
|
# Visual Studio 15
|
||||||
VisualStudioVersion = 15.0.26124.0
|
VisualStudioVersion = 15.0.26124.0
|
||||||
MinimumVisualStudioVersion = 15.0.26124.0
|
MinimumVisualStudioVersion = 15.0.26124.0
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "csharp", "csharp.csproj", "{91DB205F-E422-430B-BBB8-955110C7B3B6}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
|
@ -15,4 +17,18 @@ Global
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,12 @@ RUN mkdir -p /home/linuxbrew/.linuxbrew &&\
|
||||||
|
|
||||||
RUN /home/linuxbrew/.linuxbrew/bin/brew install golang
|
RUN /home/linuxbrew/.linuxbrew/bin/brew install golang
|
||||||
|
|
||||||
|
# dotnet
|
||||||
|
RUN curl -sSL https://dot.net/v1/dotnet-install.sh \
|
||||||
|
| bash /dev/stdin --channel LTS --install-dir /usr/share/dotnet && \
|
||||||
|
update-alternatives --install /usr/bin/dotnet dotnet \
|
||||||
|
/usr/share/dotnet/dotnet 1
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
RUN /home/linuxbrew/.linuxbrew/bin/brew cleanup && \
|
RUN /home/linuxbrew/.linuxbrew/bin/brew cleanup && \
|
||||||
rm -rf ~/.cache && \
|
rm -rf ~/.cache && \
|
||||||
|
|
|
||||||
65
tests/language_csharp.test.vim
Normal file
65
tests/language_csharp.test.vim
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
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_CSharp_Simple()
|
||||||
|
let fn='Program.cs'
|
||||||
|
lcd ../support/test/csharp
|
||||||
|
exe 'edit ' . fn
|
||||||
|
|
||||||
|
call vimspector#SetLineBreakpoint( fn, 31 )
|
||||||
|
call vimspector#LaunchWithSettings( {
|
||||||
|
\ 'configuration': 'launch - netcoredbg'
|
||||||
|
\ } )
|
||||||
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 31, 7 )
|
||||||
|
call WaitForAssert( {->
|
||||||
|
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 31 )
|
||||||
|
\ } )
|
||||||
|
|
||||||
|
call vimspector#StepOver()
|
||||||
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 32, 12 )
|
||||||
|
call WaitForAssert( {->
|
||||||
|
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 32 )
|
||||||
|
\ } )
|
||||||
|
|
||||||
|
call vimspector#test#setup#Reset()
|
||||||
|
|
||||||
|
lcd -
|
||||||
|
%bwipeout!
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! Test_Run_To_Cursor()
|
||||||
|
let fn='Program.cs'
|
||||||
|
lcd ../support/test/csharp
|
||||||
|
exe 'edit ' . fn
|
||||||
|
|
||||||
|
call vimspector#SetLineBreakpoint( fn, 31 )
|
||||||
|
call vimspector#LaunchWithSettings( {
|
||||||
|
\ 'configuration': 'launch - netcoredbg'
|
||||||
|
\ } )
|
||||||
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 31, 7 )
|
||||||
|
call WaitForAssert( {->
|
||||||
|
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 31 )
|
||||||
|
\ } )
|
||||||
|
|
||||||
|
call cursor( 33, 1 )
|
||||||
|
call vimspector#RunToCursor()
|
||||||
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 33, 1 )
|
||||||
|
call WaitForAssert( {->
|
||||||
|
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 33 )
|
||||||
|
\ } )
|
||||||
|
|
||||||
|
call vimspector#test#setup#Reset()
|
||||||
|
lcd -
|
||||||
|
%bwipeout!
|
||||||
|
endfunction
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue