File: rspamd_test_helper.lua

package info (click to toggle)
rspamd 1.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 23,572 kB
  • sloc: ansic: 348,610; asm: 12,457; perl: 2,869; pascal: 1,532; cpp: 738; python: 653; java: 433; sh: 331; sql: 312; xml: 116; makefile: 111
file content (18 lines) | stat: -rw-r--r-- 392 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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