patch 9.1.1061: tests: test_glvs fails when unarchiver not available
Problem: tests: test_glvs fails when unarchiver not available
(Brian L. Matthews)
Solution: Check if an unarchiver is available, skip the test otherwise
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@ -50,14 +50,16 @@ func SetUp()
|
|||||||
" (instead of relying on autoload) because set up depends on shell selection
|
" (instead of relying on autoload) because set up depends on shell selection
|
||||||
runtime plugin/vimballPlugin.vim
|
runtime plugin/vimballPlugin.vim
|
||||||
runtime plugin/getscriptPlugin.vim
|
runtime plugin/getscriptPlugin.vim
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func CheckTool(tool)
|
||||||
" define tools location
|
" define tools location
|
||||||
if has('win32')
|
if has('win32')
|
||||||
|
|
||||||
if executable('git')
|
if executable('git')
|
||||||
let git_path = trim(system('powershell -Command "Split-Path (Split-Path (gcm git).Source)"'))
|
let git_path = trim(system('powershell -Command "Split-Path (Split-Path (gcm git).Source)"'))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if a:tool == 'bunzip2'
|
||||||
if executable('bunzip2')
|
if executable('bunzip2')
|
||||||
let g:GetLatestVimScripts_bunzip2= "bunzip2"
|
let g:GetLatestVimScripts_bunzip2= "bunzip2"
|
||||||
elseif executable('7z')
|
elseif executable('7z')
|
||||||
@ -65,9 +67,11 @@ func SetUp()
|
|||||||
elseif exists('git_path')
|
elseif exists('git_path')
|
||||||
let g:GetLatestVimScripts_bunzip2= $'{git_path}\usr\bin\bunzip2'
|
let g:GetLatestVimScripts_bunzip2= $'{git_path}\usr\bin\bunzip2'
|
||||||
else
|
else
|
||||||
call assert_report("Missing tool to decompress .bz2 files")
|
throw "Skipped: Missing tool to decompress .bz2 files"
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if a:tool == 'gunzip'
|
||||||
if executable('gunzip')
|
if executable('gunzip')
|
||||||
let g:GetLatestVimScripts_gunzip= "gunzip"
|
let g:GetLatestVimScripts_gunzip= "gunzip"
|
||||||
elseif executable('7z')
|
elseif executable('7z')
|
||||||
@ -75,9 +79,11 @@ func SetUp()
|
|||||||
elseif exists('git_path')
|
elseif exists('git_path')
|
||||||
let g:GetLatestVimScripts_gunzip= $'{git_path}\usr\bin\gunzip'
|
let g:GetLatestVimScripts_gunzip= $'{git_path}\usr\bin\gunzip'
|
||||||
else
|
else
|
||||||
call assert_report("Missing tool to decompress .gz files")
|
throw "Skipped: Missing tool to decompress .gz files"
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if a:tool == 'unxz'
|
||||||
if executable('unxz')
|
if executable('unxz')
|
||||||
let g:GetLatestVimScripts_unxz= "unxz"
|
let g:GetLatestVimScripts_unxz= "unxz"
|
||||||
elseif executable('7z')
|
elseif executable('7z')
|
||||||
@ -85,11 +91,35 @@ func SetUp()
|
|||||||
elseif exists('git_path')
|
elseif exists('git_path')
|
||||||
let g:GetLatestVimScripts_unxz= $'{git_path}\mingw64\bin\unxz'
|
let g:GetLatestVimScripts_unxz= $'{git_path}\mingw64\bin\unxz'
|
||||||
else
|
else
|
||||||
call assert_report("Missing tool to decompress .xz files")
|
throw "Skipped: Missing tool to decompress .xz files"
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
" Mac or Unix
|
||||||
|
if a:tool == 'bunzip2'
|
||||||
|
if executable('bunzip2')
|
||||||
|
let g:GetLatestVimScripts_bunzip2= "bunzip2"
|
||||||
|
else
|
||||||
|
throw "Skipped: Missing tool to decompress .bz2 files"
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if a:tool == 'gunzip'
|
||||||
|
if executable('gunzip')
|
||||||
|
let g:GetLatestVimScripts_gunzip= "gunzip"
|
||||||
|
else
|
||||||
|
throw "Skipped: Missing tool to decompress .bz2 files"
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if a:tool == 'unxz'
|
||||||
|
if executable('unxz')
|
||||||
|
let g:GetLatestVimScripts_unxz= "unxz"
|
||||||
|
else
|
||||||
|
throw "Skipped: Missing tool to decompress .xz files"
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" After each test remove the contents of the .vim dir and reset the script
|
" After each test remove the contents of the .vim dir and reset the script
|
||||||
@ -110,7 +140,6 @@ endfunc
|
|||||||
" Ancillary functions
|
" Ancillary functions
|
||||||
|
|
||||||
func SetShell(shell)
|
func SetShell(shell)
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
if a:shell == "default"
|
if a:shell == "default"
|
||||||
set shell& shellcmdflag& shellxquote& shellpipe& shellredir&
|
set shell& shellcmdflag& shellxquote& shellpipe& shellredir&
|
||||||
@ -138,11 +167,9 @@ func SetShell(shell)
|
|||||||
|
|
||||||
" reload script to force new shell options
|
" reload script to force new shell options
|
||||||
runtime autoload/getscript.vim
|
runtime autoload/getscript.vim
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func SelectScript(package)
|
func SelectScript(package)
|
||||||
|
|
||||||
" add the corresponding file
|
" add the corresponding file
|
||||||
exe $"split {s:scriptdir}/GetLatestVimScripts.dat"
|
exe $"split {s:scriptdir}/GetLatestVimScripts.dat"
|
||||||
let scripts =<< trim END
|
let scripts =<< trim END
|
||||||
@ -153,7 +180,6 @@ func SelectScript(package)
|
|||||||
call append(line('$'), s:packages[a:package]['spec'])
|
call append(line('$'), s:packages[a:package]['spec'])
|
||||||
w!
|
w!
|
||||||
bwipe!
|
bwipe!
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func ValidateInstall(package)
|
func ValidateInstall(package)
|
||||||
@ -176,7 +202,6 @@ endfunc
|
|||||||
" Tests
|
" Tests
|
||||||
"
|
"
|
||||||
func Test_glvs_default_vmb()
|
func Test_glvs_default_vmb()
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('default')
|
call SetShell('default')
|
||||||
|
|
||||||
@ -187,11 +212,9 @@ func Test_glvs_default_vmb()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('vmb')
|
call ValidateInstall('vmb')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_glvs_pwsh_vmb()
|
func Test_glvs_pwsh_vmb()
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('pwsh')
|
call SetShell('pwsh')
|
||||||
|
|
||||||
@ -202,11 +225,9 @@ func Test_glvs_pwsh_vmb()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('vmb')
|
call ValidateInstall('vmb')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_glvs_powershell_vmb()
|
func Test_glvs_powershell_vmb()
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('powershell')
|
call SetShell('powershell')
|
||||||
|
|
||||||
@ -217,10 +238,10 @@ func Test_glvs_powershell_vmb()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('vmb')
|
call ValidateInstall('vmb')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_glvs_default_vim_bz2()
|
func Test_glvs_default_vim_bz2()
|
||||||
|
call CheckTool('bunzip2')
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('default')
|
call SetShell('default')
|
||||||
@ -232,10 +253,10 @@ func Test_glvs_default_vim_bz2()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('vim.bz2')
|
call ValidateInstall('vim.bz2')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_glvs_powershell_vim_bz2()
|
func Test_glvs_powershell_vim_bz2()
|
||||||
|
call CheckTool('bunzip2')
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('powershell')
|
call SetShell('powershell')
|
||||||
@ -247,10 +268,10 @@ func Test_glvs_powershell_vim_bz2()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('vim.bz2')
|
call ValidateInstall('vim.bz2')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_glvs_pwsh_vim_bz2()
|
func Test_glvs_pwsh_vim_bz2()
|
||||||
|
call CheckTool('bunzip2')
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('pwsh')
|
call SetShell('pwsh')
|
||||||
@ -262,10 +283,10 @@ func Test_glvs_pwsh_vim_bz2()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('vim.bz2')
|
call ValidateInstall('vim.bz2')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_glvs_default_vba_gz()
|
func Test_glvs_default_vba_gz()
|
||||||
|
call CheckTool('gunzip')
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('default')
|
call SetShell('default')
|
||||||
@ -277,10 +298,10 @@ func Test_glvs_default_vba_gz()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('vba.gz')
|
call ValidateInstall('vba.gz')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_glvs_powershell_vba_gz()
|
func Test_glvs_powershell_vba_gz()
|
||||||
|
call CheckTool('gunzip')
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('powershell')
|
call SetShell('powershell')
|
||||||
@ -292,10 +313,10 @@ func Test_glvs_powershell_vba_gz()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('vba.gz')
|
call ValidateInstall('vba.gz')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_glvs_pwsh_vba_gz()
|
func Test_glvs_pwsh_vba_gz()
|
||||||
|
call CheckTool('gunzip')
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('pwsh')
|
call SetShell('pwsh')
|
||||||
@ -307,10 +328,10 @@ func Test_glvs_pwsh_vba_gz()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('vba.gz')
|
call ValidateInstall('vba.gz')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_glvs_default_tar_xz()
|
func Test_glvs_default_tar_xz()
|
||||||
|
call CheckTool('unxz')
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('default')
|
call SetShell('default')
|
||||||
@ -322,10 +343,10 @@ func Test_glvs_default_tar_xz()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('tar.xz')
|
call ValidateInstall('tar.xz')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_glvs_powershell_tar_xz()
|
func Test_glvs_powershell_tar_xz()
|
||||||
|
call CheckTool('unxz')
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('powershell')
|
call SetShell('powershell')
|
||||||
@ -337,10 +358,10 @@ func Test_glvs_powershell_tar_xz()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('tar.xz')
|
call ValidateInstall('tar.xz')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_glvs_pwsh_tar_xz()
|
func Test_glvs_pwsh_tar_xz()
|
||||||
|
call CheckTool('unxz')
|
||||||
|
|
||||||
" select different shells
|
" select different shells
|
||||||
call SetShell('pwsh')
|
call SetShell('pwsh')
|
||||||
@ -352,5 +373,6 @@ func Test_glvs_pwsh_tar_xz()
|
|||||||
GLVS
|
GLVS
|
||||||
|
|
||||||
call ValidateInstall('tar.xz')
|
call ValidateInstall('tar.xz')
|
||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" vim: set sw=4 ts=4 et:
|
||||||
|
|||||||
@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1061,
|
||||||
/**/
|
/**/
|
||||||
1060,
|
1060,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user