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, ['']])
|
||||
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()
|
||||
let argc = +$NVIM_TEST_ARGC
|
||||
let args = []
|
||||
@ -26,9 +33,8 @@ function Main()
|
||||
\'join(map(v:val[1], '.
|
||||
\ '''substitute(v:val, '.
|
||||
\ '"\\v\\C(\\p@!.|\\<)", '.
|
||||
\ '"\\=printf(\"<%x>\", '.
|
||||
\ 'char2nr(submatch(0)))", '.
|
||||
\ '"")''), '.
|
||||
\ '"\\=s:escape_non_printable(submatch(0))", '.
|
||||
\ '"g")''), '.
|
||||
\ '''\n'')')
|
||||
call setline(1, [
|
||||
\ 'Job exited with code ' . results[0],
|
||||
|
@ -445,6 +445,8 @@ function module.new_argv(...)
|
||||
for _, k in ipairs({
|
||||
'HOME',
|
||||
'ASAN_OPTIONS',
|
||||
'TSAN_OPTIONS',
|
||||
'MSAN_OPTIONS',
|
||||
'LD_LIBRARY_PATH',
|
||||
'PATH',
|
||||
'NVIM_LOG_FILE',
|
||||
|
Loading…
Reference in New Issue
Block a user