mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 9.0.0564: a few tests keep failing on MacOS M1
Problem: A few tests keep failing on MacOS M1. Solution: Add a test check CheckNotMacM1. Fix timer tests.
This commit is contained in:
@@ -111,6 +111,14 @@ func CheckNotBSD()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Command to check for not running on a MacOS M1 system.
|
||||||
|
command CheckNotMacM1 call CheckNotMacM1()
|
||||||
|
func CheckNotMacM1()
|
||||||
|
if has('mac') && system('uname -a') =~ '\<arm64\>'
|
||||||
|
throw 'Skipped: does not work on MacOS M1'
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Command to check that making screendumps is supported.
|
" Command to check that making screendumps is supported.
|
||||||
" Caller must source screendump.vim
|
" Caller must source screendump.vim
|
||||||
command CheckScreendump call CheckScreendump()
|
command CheckScreendump call CheckScreendump()
|
||||||
|
@@ -2998,6 +2998,8 @@ endfunc
|
|||||||
" Tests for SigUSR1 autocmd event, which is only available on posix systems.
|
" Tests for SigUSR1 autocmd event, which is only available on posix systems.
|
||||||
func Test_autocmd_sigusr1()
|
func Test_autocmd_sigusr1()
|
||||||
CheckUnix
|
CheckUnix
|
||||||
|
" FIXME: should this work on MacOS M1?
|
||||||
|
CheckNotMacM1
|
||||||
CheckExecutable /bin/kill
|
CheckExecutable /bin/kill
|
||||||
|
|
||||||
let g:sigusr1_passed = 0
|
let g:sigusr1_passed = 0
|
||||||
|
@@ -129,7 +129,8 @@ func Test_timer_stopall()
|
|||||||
let id1 = timer_start(1000, 'MyHandler')
|
let id1 = timer_start(1000, 'MyHandler')
|
||||||
let id2 = timer_start(2000, 'MyHandler')
|
let id2 = timer_start(2000, 'MyHandler')
|
||||||
let info = timer_info()
|
let info = timer_info()
|
||||||
call assert_equal(2, len(info))
|
" count one for the TestTimeout() timer
|
||||||
|
call assert_equal(3, len(info))
|
||||||
|
|
||||||
call timer_stopall()
|
call timer_stopall()
|
||||||
let info = timer_info()
|
let info = timer_info()
|
||||||
@@ -198,18 +199,22 @@ endfunc
|
|||||||
|
|
||||||
func Test_timer_stop_in_callback()
|
func Test_timer_stop_in_callback()
|
||||||
let g:test_is_flaky = 1
|
let g:test_is_flaky = 1
|
||||||
call assert_equal(0, len(timer_info()))
|
call assert_equal(1, len(timer_info()))
|
||||||
let g:timer1 = timer_start(10, 'StopTimer1')
|
let g:timer1 = timer_start(10, 'StopTimer1')
|
||||||
let slept = 0
|
let slept = 0
|
||||||
for i in range(10)
|
for i in range(10)
|
||||||
if len(timer_info()) == 0
|
if len(timer_info()) == 1
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
sleep 10m
|
sleep 10m
|
||||||
let slept += 10
|
let slept += 10
|
||||||
endfor
|
endfor
|
||||||
" This should take only 30 msec, but on Mac it's often longer
|
if slept == 100
|
||||||
call assert_inrange(0, 50, slept)
|
call assert_equal(1, len(timer_info()))
|
||||||
|
else
|
||||||
|
" This should take only 30 msec, but on Mac it's often longer
|
||||||
|
call assert_inrange(0, 50, slept)
|
||||||
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func StopTimerAll(timer)
|
func StopTimerAll(timer)
|
||||||
@@ -218,9 +223,10 @@ endfunc
|
|||||||
|
|
||||||
func Test_timer_stop_all_in_callback()
|
func Test_timer_stop_all_in_callback()
|
||||||
let g:test_is_flaky = 1
|
let g:test_is_flaky = 1
|
||||||
call assert_equal(0, len(timer_info()))
|
" One timer is for TestTimeout()
|
||||||
call timer_start(10, 'StopTimerAll')
|
|
||||||
call assert_equal(1, len(timer_info()))
|
call assert_equal(1, len(timer_info()))
|
||||||
|
call timer_start(10, 'StopTimerAll')
|
||||||
|
call assert_equal(2, len(timer_info()))
|
||||||
let slept = 0
|
let slept = 0
|
||||||
for i in range(10)
|
for i in range(10)
|
||||||
if len(timer_info()) == 0
|
if len(timer_info()) == 0
|
||||||
@@ -229,7 +235,11 @@ func Test_timer_stop_all_in_callback()
|
|||||||
sleep 10m
|
sleep 10m
|
||||||
let slept += 10
|
let slept += 10
|
||||||
endfor
|
endfor
|
||||||
call assert_inrange(0, 30, slept)
|
if slept == 100
|
||||||
|
call assert_equal(0, len(timer_info()))
|
||||||
|
else
|
||||||
|
call assert_inrange(0, 30, slept)
|
||||||
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func FeedkeysCb(timer)
|
func FeedkeysCb(timer)
|
||||||
@@ -370,6 +380,9 @@ endfunc
|
|||||||
" Test that the garbage collector isn't triggered if a timer callback invokes
|
" Test that the garbage collector isn't triggered if a timer callback invokes
|
||||||
" vgetc().
|
" vgetc().
|
||||||
func Test_nocatch_timer_garbage_collect()
|
func Test_nocatch_timer_garbage_collect()
|
||||||
|
" FIXME: why does this fail only on MacOS M1?
|
||||||
|
CheckNotMacM1
|
||||||
|
|
||||||
" 'uptimetime. must be bigger than the timer timeout
|
" 'uptimetime. must be bigger than the timer timeout
|
||||||
set ut=200
|
set ut=200
|
||||||
call test_garbagecollect_soon()
|
call test_garbagecollect_soon()
|
||||||
|
@@ -699,6 +699,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 */
|
||||||
|
/**/
|
||||||
|
564,
|
||||||
/**/
|
/**/
|
||||||
563,
|
563,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user