]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests: verbose stack traces from config tests
authorPetr Špaček <petr.spacek@nic.cz>
Wed, 8 Jul 2020 12:44:59 +0000 (14:44 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 8 Dec 2020 17:15:02 +0000 (18:15 +0100)
tests/config/test_utils.lua

index 15a14520f3704dd1ad1f1a4daa355fe5b6b544c4..5a7f3111b101e358b5f96b6dbcd714553af60fdb 100644 (file)
@@ -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