local function check_path()
local modules = { "say", "pl", "pl.stringx" }
for _, module in ipairs(modules) do
if not pcall(require, module) then return false end
end
return true
end
local function check_cpath()
local modules = { "cjson", "socket" }
for _, module in ipairs(modules) do
if not pcall(require, module) then return false end
end
return true
end
local tests = {
{ check_path, "Checking LUA_PATH configuration" },
{ check_cpath, "Checking LUA_CPATH configuration" }
}
print("Lua4z installation verification procedure (IVP)\n")
local passed = 0
for _, test in ipairs(tests) do
local pass = test[1]()
if pass then passed = passed + 1 end
print(test[2] .. ": " .. (pass and "passed" or "failed"))
end
local failed = #tests - passed
print([[
Test results:
]]..passed..[[ passed
]]..failed..[[ failed
]])
if failed == 0 then
print "Success: all tests passed.\n"
end
return failed