summaryrefslogtreecommitdiffstats
path: root/tests/config
diff options
context:
space:
mode:
authorPetr Špaček <petr.spacek@nic.cz>2020-07-08 14:44:59 +0200
committerTomas Krizek <tomas.krizek@nic.cz>2020-12-08 18:15:02 +0100
commite1353dc2f89ae08a7bb67d3fa0e969dec5f568c5 (patch)
treec810ea40f7b09ba291b48e96de62c7c90355d5ed /tests/config
parenttests: print stack traces from check_answer callback function (diff)
downloadknot-resolver-e1353dc2f89ae08a7bb67d3fa0e969dec5f568c5.tar.xz
knot-resolver-e1353dc2f89ae08a7bb67d3fa0e969dec5f568c5.zip
tests: verbose stack traces from config tests
Diffstat (limited to 'tests/config')
-rw-r--r--tests/config/test_utils.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/config/test_utils.lua b/tests/config/test_utils.lua
index 15a14520..5a7f3111 100644
--- a/tests/config/test_utils.lua
+++ b/tests/config/test_utils.lua
@@ -2,10 +2,9 @@
local M = {}
function M.test(f, ...)
- local res, exception = pcall(f, ...)
+ local res, exception = xpcall(f, debug.traceback, ...)
if not res then
- local trace = debug.getinfo(2)
- io.stderr:write(string.format('%s:%d %s\n', trace.source, trace.currentline, exception))
+ io.stderr:write(string.format('%s\n', exception))
os.exit(2)
end
return res