Vicent Marti | c0e5ef8 | 2016-03-30 17:31:20 +0200 | [diff] [blame] | 1 | function 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 |
| 7 | end |
| 8 | |
| 9 | setup_path() |
| 10 | |
| 11 | USE_EXPECTED_ACTUAL_IN_ASSERT_EQUALS = false |
| 12 | EXPORT_ASSERT_TO_GLOBALS = true |
| 13 | require("luaunit") |
| 14 | |
Vicent Marti | a833369 | 2016-03-30 22:34:43 +0200 | [diff] [blame] | 15 | rawset(_G, "BCC", require("bcc.init")) |
| 16 | rawset(_G, "BPF", BCC.BPF) |
| 17 | |
Vicent Marti | c0e5ef8 | 2016-03-30 17:31:20 +0200 | [diff] [blame] | 18 | log.enabled = false |
Vicent Marti | a833369 | 2016-03-30 22:34:43 +0200 | [diff] [blame] | 19 | |
| 20 | return function (name, f) |
| 21 | rawset(_G, name, f) |
| 22 | os.exit(LuaUnit.run()) |
| 23 | end |