blob: f5ee529f2277c21a8fc66fbc4fafb05cf1b850b7 [file] [log] [blame]
Vicent Martic0e5ef82016-03-30 17:31:20 +02001function setup_path()
2 local str = require("debug").getinfo(2, "S").source:sub(2)
3 local cwd = str:match("(.*/)")
4 local bpf_path = cwd.."/../../src/lua/?.lua;"
5 local test_path = cwd.."/?.lua;"
6 package.path = bpf_path..test_path..package.path
7end
8
9setup_path()
10
11USE_EXPECTED_ACTUAL_IN_ASSERT_EQUALS = false
12EXPORT_ASSERT_TO_GLOBALS = true
13require("luaunit")
14
Vicent Martia8333692016-03-30 22:34:43 +020015rawset(_G, "BCC", require("bcc.init"))
16rawset(_G, "BPF", BCC.BPF)
17
Vicent Martic0e5ef82016-03-30 17:31:20 +020018log.enabled = false
Vicent Martia8333692016-03-30 22:34:43 +020019
20return function (name, f)
21 rawset(_G, name, f)
22 os.exit(LuaUnit.run())
23end