From 3382cefc69a1d99208685ffbd5e6ded665788bae Mon Sep 17 00:00:00 2001 From: Stefan Liebl Date: Mon, 4 May 2020 09:49:21 +0200 Subject: [PATCH] + Ctest --- vimfiles.stefan/plugin/toptica.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vimfiles.stefan/plugin/toptica.vim b/vimfiles.stefan/plugin/toptica.vim index bed72c7..b79a481 100644 --- a/vimfiles.stefan/plugin/toptica.vim +++ b/vimfiles.stefan/plugin/toptica.vim @@ -174,6 +174,7 @@ function s:ProjectSet(project_type, project_base_dir) let g:Elffile = g:ProjectBuildDir.s:Elffile command! -complete=custom,GetAllMakeCompletions -nargs=* Make call s:Make('', 0) command! MakeTestBuild call s:MakeTestBuild() + command! Ctest call s:Ctest() " cmake command! -nargs=1 -complete=custom,CmakeBuildTypes Cmake call s:Cmake('', 0) @@ -278,6 +279,13 @@ function s:Cmake(build_type, async_mode) execute 'AsyncRun -mode='.a:async_mode.' -save=2 -cwd='.g:ProjectBuildDir.' @ cmake '.args endfunction +function s:Ctest() +" let cmd = 'ctest --build-and-test ./src unit-tests --build-generator "Unix Makefiles" --build-target unit_tests --test-command ctest --nocompress-output -T Test' + let cmd = 'ctest --build-and-test ./src unit-tests --build-generator "Unix Makefiles" --build-target unit_tests --nocompress-output -T Test --build-options -DCMAKE_BUILD_TYPE=Debug --test-command ctest' + call asyncrun#quickfix_toggle(10, 0) + execute 'AsyncRun -mode=1 -save=2 -cwd='.s:ProjectBaseDir.' @ ' . cmd +endfunction + function s:Call_and_log(cmd) echom a:cmd let r = system(a:cmd)