mirror of https://github.com/rspamd/rspamd.git
Rapid spam filtering system
https://rspamd.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
611 B
22 lines
611 B
-- Run all unit tests in 'unit' directory
|
|
|
|
local telescope = require "telescope"
|
|
|
|
local contexts = {}
|
|
|
|
for _,t in ipairs(tests_list) do
|
|
telescope.load_contexts(t, contexts)
|
|
end
|
|
local buffer = {}
|
|
local results = telescope.run(contexts, callbacks, test_pattern)
|
|
local summary, data = telescope.summary_report(contexts, results)
|
|
table.insert(buffer, telescope.test_report(contexts, results))
|
|
|
|
if #buffer > 0 then print(table.concat(buffer, "\n")) end
|
|
|
|
for _, v in pairs(results) do
|
|
if v.status_code == telescope.status_codes.err or
|
|
v.status_code == telescope.status_codes.fail then
|
|
os.exit(1)
|
|
end
|
|
end
|