Files
glacier-ng/tests/run_all.lua
T
2026-10-29 09:15:34 -04:00

42 lines
1.2 KiB
Lua

-- run_all.lua
--
-- Runs every test file as its own `luajit` process rather than
-- require()ing them all into one VM. This matters here specifically
-- because test_lock_crash_recovery.lua calls fork() — keeping each test
-- in its own process means a fork() gone wrong in one test can't corrupt
-- state for the others.
--
-- Usage:
-- GLACIER_TEST_CONFIRM=yes LIBGLACIER_SO=./build/libglacier-ng.so \
-- luajit run_all.lua
local tests = {
"test_lock_contention.lua",
"test_lock_crash_recovery.lua",
"test_exdev.lua",
"test_relink_symlinks.lua",
"test_remove_live_pkg_via_stage.lua",
"test_package_symlinks.lua",
"test_fs_tree.lua",
"test_config_files.lua",
"test_index_abort.lua",
"test_live_remove_foreign.lua",
"test_abort_unlocked.lua",
}
local failed = {}
for _, t in ipairs(tests) do
io.write("==== " .. t .. " ====\n")
local ok = os.execute("luajit " .. t)
local success = (ok == true) or (ok == 0)
if not success then failed[#failed + 1] = t end
io.write("\n")
end
if #failed > 0 then
io.write("FAILED: " .. table.concat(failed, ", ") .. "\n")
os.exit(1)
end
io.write("all test files passed\n")