Mercurial > pub > dyncall > dyncall
diff test/callback_suite/mk-cases.lua @ 514:01f928eb9584
- more test code generator code sharing
author | Tassilo Philipp |
---|---|
date | Sun, 10 Apr 2022 16:18:28 +0200 |
parents | 95f6f43178ed |
children | 1a813b706de4 |
line wrap: on
line diff
--- a/test/callback_suite/mk-cases.lua Sun Apr 10 16:10:10 2022 +0200 +++ b/test/callback_suite/mk-cases.lua Sun Apr 10 16:18:28 2022 +0200 @@ -1,7 +1,12 @@ require "config" -function trim(l) return l:gsub("^%s+",""):gsub("%s+$","") end +-- use shared helpers to generate cases +package.path = '../common/?.lua;' .. package.path +require"mk-cases" + + function mkcase(id,sig) + local sig = trim(sig) local rtype = string.sub(sig, -1) local i = 1 local args = { rtype } @@ -20,11 +25,6 @@ return "F" .. (#args-1) .. "(f" .. id .. "," .. table.concat(args,',') .. ")\n" end --- use shared helpers to generate cases -package.path = '../common/?.lua;' .. package.path -require"mk-cases" - - function mkall() -- force minargs for ordered mode if mode == "ordered" then