瀏覽代碼

[Test] Added test helper module

tags/1.8.0
Mikhail Galanin 5 年之前
父節點
當前提交
0b0cad929f
共有 1 個文件被更改,包括 18 次插入0 次删除
  1. 18
    0
      test/lua/rspamd_test_helper.lua

+ 18
- 0
test/lua/rspamd_test_helper.lua 查看文件

@@ -0,0 +1,18 @@
local ffi = require "ffi"
local cfg = rspamd_config

ffi.cdef[[
void rspamd_url_init (const char *tld_file);
]]
local exports = {}

function exports.init_url_parser(file)
if not file then
local test_dir = string.gsub(debug.getinfo(1).source, "^@(.+/)[^/]+$", "%1")
file = string.format('%s/unit/%s', test_dir, "test_tld.dat")
end

ffi.C.rspamd_url_init(file)
end

return exports

Loading…
取消
儲存