test/helpers: Run $SYMBOLIZER to decode sanitizer logs, if it is set

This commit is contained in:
James McCoy 2020-09-06 12:09:36 -04:00
parent 33bf6f9ada
commit 83a7b1b5db
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -200,14 +200,25 @@ function module.check_logs()
end end
end end
fd:close() fd:close()
os.remove(file)
if #lines > 0 then if #lines > 0 then
local status, f
local out = io.stdout local out = io.stdout
if os.getenv('SYMBOLIZER') then
status, f = pcall(module.popen_r, os.getenv('SYMBOLIZER'), '-l', file)
end
out:write(start_msg .. '\n') out:write(start_msg .. '\n')
out:write('= ' .. table.concat(lines, '\n= ') .. '\n') if status then
for line in f:lines() do
out:write('= '..line..'\n')
end
f:close()
else
out:write('= ' .. table.concat(lines, '\n= ') .. '\n')
end
out:write(select(1, start_msg:gsub('.', '=')) .. '\n') out:write(select(1, start_msg:gsub('.', '=')) .. '\n')
table.insert(runtime_errors, file) table.insert(runtime_errors, file)
end end
os.remove(file)
end end
end end
end end