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.

rspamd_test_helper.lua 392B

123456789101112131415161718
  1. local ffi = require "ffi"
  2. local cfg = rspamd_config
  3. ffi.cdef[[
  4. void rspamd_url_init (const char *tld_file);
  5. ]]
  6. local exports = {}
  7. function exports.init_url_parser(file)
  8. if not file then
  9. local test_dir = string.gsub(debug.getinfo(1).source, "^@(.+/)[^/]+$", "%1")
  10. file = string.format('%s/unit/%s', test_dir, "test_tld.dat")
  11. end
  12. ffi.C.rspamd_url_init(file)
  13. end
  14. return exports