Run all Lua versions in LuaJIT if no luajit.lua is present
@@ -90,18 +90,21 @@ local function benchmark(test_dir)
-- run luajit against *.lua if there is no luajit.lua
local luajit_run = false
- local lua_file = nil
+ local lua_files = {}
for _, file_name in ipairs(file_names) do
local name, ext = util.split_ext(file_name)
if name == "luajit" then
luajit_run = true
elseif ext == "lua" then
- lua_file = name
+ table.insert(lua_files, name)
end
end
- if not luajit_run and lua_file then
- local result = measure("luajit", test_dir, lua_file)
- table.insert(results, {name = "luajit", result = result})
+ if not luajit_run and #lua_files ~= 0 then
+ for _, f in ipairs(lua_files) do
+ local result = measure("luajit", test_dir, f)
+ local name = f .. " luajit"
+ table.insert(results, {name = name, result = result})
+ end
end
local worst = 0
