diff options
author | Daniel Hahler <git@thequod.de> | 2019-08-21 03:21:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-21 03:21:50 +0200 |
commit | 0e8ee37efdc97fd6c7226ec3563caf93e89e71eb (patch) | |
tree | 36467a73ed59d6d6efb3efdbc31cecf814f865e8 | |
parent | 47e27a4f5b2b2ae20e20a51a6cf0f76078c28698 (diff) | |
parent | e5b2423fa180d0951ec6eb5bfcdf3fedb2a7c161 (diff) | |
download | rneovim-0e8ee37efdc97fd6c7226ec3563caf93e89e71eb.tar.gz rneovim-0e8ee37efdc97fd6c7226ec3563caf93e89e71eb.tar.bz2 rneovim-0e8ee37efdc97fd6c7226ec3563caf93e89e71eb.zip |
Merge pull request #10821 from blueyed/asan
tests: improve escaping of special chars, forward all sanitizer options
-rw-r--r-- | src/nvim/testdir/runnvim.vim | 12 | ||||
-rw-r--r-- | test/functional/helpers.lua | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/nvim/testdir/runnvim.vim b/src/nvim/testdir/runnvim.vim index 52e05cfbeb..a46e2d3fc0 100644 --- a/src/nvim/testdir/runnvim.vim +++ b/src/nvim/testdir/runnvim.vim @@ -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], diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index d4ace3030c..d040ff5f8c 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -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', |