diff --git a/test/old/testdir/shared.vim b/test/old/testdir/shared.vim index 205847fc0e..258b113f8c 100644 --- a/test/old/testdir/shared.vim +++ b/test/old/testdir/shared.vim @@ -253,17 +253,21 @@ endfunc " Get $VIMPROG to run the Vim executable. " The Makefile writes it as the first line in the "vimcmd" file. +" Falls back to the Vim executable in the src directory. " Nvim: uses $NVIM_TEST_ARG0. func GetVimProg() - if empty($NVIM_TEST_ARG0) - " Assume the script was sourced instead of running "make". - return v:progpath - endif - if has('win32') - return substitute($NVIM_TEST_ARG0, '/', '\\', 'g') - else - return $NVIM_TEST_ARG0 + if !empty($NVIM_TEST_ARG0) + if has('win32') + return substitute($NVIM_TEST_ARG0, '/', '\\', 'g') + else + return $NVIM_TEST_ARG0 + endif endif + " echo 'Cannot read the "vimcmd" file, falling back to ../vim.' + + " Probably the script was sourced instead of running "make". + " We assume Vim was just build in the src directory then. + return v:progpath endfunc let g:valgrind_cnt = 1