monkeypatch ffi.cdef to avoid redefine errors
This commit is contained in:
parent
f5963f2d80
commit
b32809eae2
1 changed files with 13 additions and 0 deletions
13
build/busted
13
build/busted
|
@ -1,3 +1,16 @@
|
|||
#!/usr/bin/env resty
|
||||
|
||||
local ffi = require("ffi")
|
||||
|
||||
-- without this we get errors such as "attempt to redefine XXX"
|
||||
local old_cdef = ffi.cdef
|
||||
local exists = {}
|
||||
ffi.cdef = function(def)
|
||||
if exists[def] then
|
||||
return
|
||||
end
|
||||
exists[def] = true
|
||||
return old_cdef(def)
|
||||
end
|
||||
|
||||
require "busted.runner"({ standalone = false })
|
||||
|
|
Loading…
Reference in a new issue