Skip to content

Commit

Permalink
test: support number value of tag in LuaJIT-tests
Browse files Browse the repository at this point in the history
The LuaJIT-tests suite lacks the ability to specify tags with custom
values. This patch adds the ability to specify number tags in the format
`+tag=number`. It is useful for version specification of system
libraries (like libc).

Required for the next patch.

Reviewed-by: Maxim Kokryashkin <[email protected]>
Reviewed-by: Sergey Bronnikov <[email protected]>
Signed-off-by: Sergey Kaplun <[email protected]>
(cherry picked from commit acb704c)
  • Loading branch information
Buristan committed Dec 12, 2024
1 parent 625c89b commit a1e596e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/LuaJIT-tests/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ local function parse_args(t)
error(arg .." does not expect an argument")
end
elseif arg:find"^[-+]" then
opts.tags[arg:sub(2)] = (arg:sub(1, 1) == "+")
local tagval = arg:find"="
if tagval then
opts.tags[arg:sub(2, tagval - 1)] = tonumber(arg:sub(tagval + 1))
else
opts.tags[arg:sub(2)] = (arg:sub(1, 1) == "+")
end
elseif arg:find"^%d+$" then
if not opts.numbers_to_run then
opts.numbers_to_run = {}
Expand Down

0 comments on commit a1e596e

Please sign in to comment.