mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #10821 from blueyed/asan
tests: improve escaping of special chars, forward all sanitizer options
This commit is contained in:
commit
0e8ee37efd
@ -7,6 +7,13 @@ function s:logger.on_exit(id, data, event)
|
|||||||
call add(self.d_events, [a:event, ['']])
|
call add(self.d_events, [a:event, ['']])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Replace non-printable chars by special sequence, or "<%x>".
|
||||||
|
let s:escaped_char = {"\n": '\n', "\r": '\r', "\t": '\t'}
|
||||||
|
function! s:escape_non_printable(char) abort
|
||||||
|
let r = get(s:escaped_char, a:char)
|
||||||
|
return r is 0 ? printf('<%x>', char2nr(a:char)) : r
|
||||||
|
endfunction
|
||||||
|
|
||||||
function Main()
|
function Main()
|
||||||
let argc = +$NVIM_TEST_ARGC
|
let argc = +$NVIM_TEST_ARGC
|
||||||
let args = []
|
let args = []
|
||||||
@ -26,9 +33,8 @@ function Main()
|
|||||||
\'join(map(v:val[1], '.
|
\'join(map(v:val[1], '.
|
||||||
\ '''substitute(v:val, '.
|
\ '''substitute(v:val, '.
|
||||||
\ '"\\v\\C(\\p@!.|\\<)", '.
|
\ '"\\v\\C(\\p@!.|\\<)", '.
|
||||||
\ '"\\=printf(\"<%x>\", '.
|
\ '"\\=s:escape_non_printable(submatch(0))", '.
|
||||||
\ 'char2nr(submatch(0)))", '.
|
\ '"g")''), '.
|
||||||
\ '"")''), '.
|
|
||||||
\ '''\n'')')
|
\ '''\n'')')
|
||||||
call setline(1, [
|
call setline(1, [
|
||||||
\ 'Job exited with code ' . results[0],
|
\ 'Job exited with code ' . results[0],
|
||||||
|
@ -445,6 +445,8 @@ function module.new_argv(...)
|
|||||||
for _, k in ipairs({
|
for _, k in ipairs({
|
||||||
'HOME',
|
'HOME',
|
||||||
'ASAN_OPTIONS',
|
'ASAN_OPTIONS',
|
||||||
|
'TSAN_OPTIONS',
|
||||||
|
'MSAN_OPTIONS',
|
||||||
'LD_LIBRARY_PATH',
|
'LD_LIBRARY_PATH',
|
||||||
'PATH',
|
'PATH',
|
||||||
'NVIM_LOG_FILE',
|
'NVIM_LOG_FILE',
|
||||||
|
Loading…
Reference in New Issue
Block a user