forked from iovisor/bcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_helper.lua
More file actions
23 lines (18 loc) · 531 Bytes
/
Copy pathtest_helper.lua
File metadata and controls
23 lines (18 loc) · 531 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function setup_path()
local str = require("debug").getinfo(2, "S").source:sub(2)
local cwd = str:match("(.*/)")
local bpf_path = cwd.."/../../src/lua/?.lua;"
local test_path = cwd.."/?.lua;"
package.path = bpf_path..test_path..package.path
end
setup_path()
USE_EXPECTED_ACTUAL_IN_ASSERT_EQUALS = false
EXPORT_ASSERT_TO_GLOBALS = true
require("luaunit")
rawset(_G, "BCC", require("bcc.init"))
rawset(_G, "BPF", BCC.BPF)
log.enabled = false
return function (name, f)
rawset(_G, name, f)
os.exit(LuaUnit.run())
end