Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
a833369b
Commit
a833369b
authored
Mar 30, 2016
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua: Fix tests to work in strict mode
parent
818eac98
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
13 deletions
+18
-13
tests/lua/test_clang.lua
tests/lua/test_clang.lua
+3
-4
tests/lua/test_dump.lua
tests/lua/test_dump.lua
+4
-3
tests/lua/test_helper.lua
tests/lua/test_helper.lua
+8
-2
tests/lua/test_uprobes.lua
tests/lua/test_uprobes.lua
+3
-4
No files found.
tests/lua/test_clang.lua
View file @
a833369b
require
(
"test_helper"
)
TestClang
=
{}
local
suite
=
require
(
"test_helper"
)
local
TestClang
=
{}
function
TestClang
:
test_probe_read1
()
local
text
=
[[
...
...
@@ -329,4 +328,4 @@ function TestClang:test_syntax_error()
BPF
,
{
text
=
[[int failure(void *ctx) { if (); return 0; }]]
})
end
os.exit
(
LuaUnit
.
run
()
)
suite
(
"TestClang"
,
TestClang
)
tests/lua/test_dump.lua
View file @
a833369b
require
(
"test_helper"
)
local
suite
=
require
(
"test_helper"
)
local
TestDump
=
{}
function
test_dump_func
()
function
TestDump
:
test_dump_func
()
local
raw
=
"\xb7\x00\x00\x00\x01\x00\x00\x00\x95\x00\x00\x00\x00\x00\x00\x00"
local
b
=
BPF
:
new
{
text
=
[[int entry(void) { return 1; }]]
}
assert_equals
(
b
:
dump_func
(
"entry"
),
raw
)
end
os.exit
(
LuaUnit
.
run
()
)
suite
(
"TestDump"
,
TestDump
)
tests/lua/test_helper.lua
View file @
a833369b
...
...
@@ -12,6 +12,12 @@ USE_EXPECTED_ACTUAL_IN_ASSERT_EQUALS = false
EXPORT_ASSERT_TO_GLOBALS
=
true
require
(
"luaunit"
)
BCC
=
require
(
"bcc.init"
)
BPF
=
BCC
.
BPF
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
tests/lua/test_uprobes.lua
View file @
a833369b
require
(
"test_helper"
)
local
suite
=
require
(
"test_helper"
)
local
ffi
=
require
(
"ffi"
)
local
TestUprobes
=
{}
ffi
.
cdef
[[
int getpid(void);
void malloc_stats(void);
]]
TestUprobes
=
{}
function
TestUprobes
:
test_simple_library
()
local
text
=
[[
#include <uapi/linux/ptrace.h>
...
...
@@ -68,4 +67,4 @@ function TestUprobes:teardown()
BPF
.
cleanup_probes
()
end
os.exit
(
LuaUnit
.
run
()
)
suite
(
"TestUprobes"
,
TestUprobes
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment