Skip to content

Commit

Permalink
Skip failing tests on qemu archs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbra committed Sep 10, 2023
1 parent 6ef6f59 commit 39d4550
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 3 deletions.
13 changes: 13 additions & 0 deletions src/testdir/check.vim
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ func CheckNotMacM1()
endif
endfunc

" Command to check for Architecture
command -nargs=1 CheckArch call CheckArch(<q-args>, v:true)

func CheckArch(arch, fail)
if has('unix') && system('arch') =~ a:arch
if a:fail
throw 'Skipped: does not work on Arch ' .. a:arch
else
return v:true
endif
endif
endfunc

" Command to check that making screendumps is supported.
" Caller must source screendump.vim
command CheckScreendump call CheckScreendump()
Expand Down
2 changes: 1 addition & 1 deletion src/testdir/test_buffer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ func Test_buflist_alloc_failure()

" test for :checktime loading the buffer
call writefile(['one'], 'XallocFail5', 'D')
if has('unix')
if has('unix') && !CheckArch('s390x', v:false)
edit XallocFail5
" sleep for some time to make sure the timestamp is different
sleep 200m
Expand Down
3 changes: 3 additions & 0 deletions src/testdir/test_crypt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ endfunc

func Test_uncrypt_xchacha20v2_custom()
CheckFeature sodium
CheckArch s390x
" Test, reading xchacha20v2 with custom encryption parameters
let hex =<< trim END
00000000: 5669 6d43 7279 7074 7e30 3521 934b f288 VimCrypt~05!.K..
Expand All @@ -199,6 +200,7 @@ endfunc

func Test_uncrypt_xchacha20v2()
CheckFeature sodium
CheckArch s390x
" Test, reading xchacha20v2
let hex =<< trim END
00000000: 5669 6d43 7279 7074 7e30 3521 9f20 4e14 VimCrypt~05!. N.
Expand Down Expand Up @@ -272,6 +274,7 @@ endfunc

func Test_uncrypt_xchacha20v2_2()
CheckFeature sodium
CheckArch s390x

sp Xcrypt_sodium_v2.txt
" Create a larger file, so that Vim will write in several blocks
Expand Down
3 changes: 3 additions & 0 deletions src/testdir/test_excmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ endfunc
func Test_confirm_write_ro()
CheckNotGui
CheckRunVimInTerminal
for arch in ['s390x', 'aarch64', 'riscv64']
exe "CheckArch " .. arch
endfor

call writefile(['foo'], 'Xconfirm_write_ro', 'D')
let lines =<< trim END
Expand Down
10 changes: 8 additions & 2 deletions src/testdir/test_functions.vim
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,11 @@ func Test_strftime()
" are, a tzset(3) call may have failed somewhere
call assert_equal(strlen(est), 2)
call assert_equal(strlen(utc), 2)
" TODO: this fails on MS-Windows
if has('unix')
" TODO: this fails on MS-Windows and Qemu Archs
if has('unix') &&
\ !CheckArch('riscv64', v:false) &&
\ !CheckArch('s390x', v:false) &&
\ !CheckArch('aarch64', v:false)
call assert_notequal(est, utc)
endif

Expand Down Expand Up @@ -2743,6 +2746,9 @@ func Test_readdir_sort()
endfunc

func Test_delete_rf()
for arch in ['s390x', 'aarch64', 'riscv64']
exe "CheckArch " .. arch
endfor
call mkdir('Xrfdir')
call writefile([], 'Xrfdir/foo.txt')
call writefile([], 'Xrfdir/bar.txt')
Expand Down
4 changes: 4 additions & 0 deletions src/testdir/test_man.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
" Test specifically for the Man filetype plugin.
source check.vim

runtime ftplugin/man.vim

Expand Down Expand Up @@ -134,6 +135,9 @@ endfunc

" Check that underlying shell command arguments are escaped.
func Test_Man_uses_shellescape()
for arch in ['s390x', 'aarch64', 'riscv64']
exe "CheckArch " .. arch
endfor
Man `touch\ Xbar` `touch\ Xfoo`

redir => msg
Expand Down
3 changes: 3 additions & 0 deletions src/testdir/test_startup.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,9 @@ func Test_redirect_Ctrl_C()
CheckUnix
CheckNotGui
CheckRunVimInTerminal
for arch in ['s390x', 'aarch64']
exe "CheckArch " .. arch
endfor

let buf = Run_shell_in_terminal({})
" Wait for the shell to display a prompt
Expand Down
1 change: 1 addition & 0 deletions src/testdir/test_stat.vim
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ endfunc

func Test_autoread_fast()
CheckFeature nanotime
CheckArch s390x

" this is timing sensitive
let g:test_is_flaky = 1
Expand Down

0 comments on commit 39d4550

Please sign in to comment.