Skip to content

Commit cf5e808

Browse files
committed
Add regtests for plugins.
1 parent baea8ee commit cf5e808

5 files changed

Lines changed: 35 additions & 0 deletions

File tree

test/regtest/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ all:
1111
../../e9compile.sh patch.cpp -std=c++11 -I ../../examples/ -D NO_GLIBC
1212
../../e9compile.sh dl.c -I ../../examples/
1313
../../e9compile.sh init.c -I ../../examples/ -D NO_GLIBC
14+
g++ -std=c++11 -fPIC -shared -o example.so -O2 \
15+
../../examples/plugins/example.cpp -I ../../src/e9tool/
1416
g++ -std=c++11 -pie -fPIC -o regtest regtest.cpp -O2
1517

1618
clean:

test/regtest/plugin.exp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
jnz 0xa0002ae
2+
js 0xa000106
3+
jz 0xa000122
4+
jns 0xa000128
5+
jnl 0xa00012f
6+
jle 0xa000133
7+
jnle 0xa00013a
8+
jle 0xa0002ae
9+
jnz 0xa000159
10+
jnle 0xa00015d
11+
jrcxz 0xa000161
12+
jmp 0xa000163
13+
call 0xa000168
14+
jmp 0xa00016d
15+
jmp 0xa000177
16+
jmpq *0x777f(%rsp,%rcx,1)
17+
call 0xa0001b5
18+
call *%rdx
19+
jz 0xa0001fb
20+
jnz 0xa0001fb
21+
jz 0xa000232
22+
jz 0xa000243
23+
jz 0xa00025c
24+
jecxz 0xa0002ae
25+
jrcxz 0xa0002ae
26+
jnz 0xa0002ae
27+
PASSED

test/regtest/plugin.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./test.pie -M 'plugin(example).match()' -P print -P 'plugin(example).patch()'

test/regtest/plugin_2.exp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
call 0xa000168
2+
call 0xa0001b5
3+
call *%rdx
4+
PASSED

test/regtest/plugin_2.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./test.pie -M 'plugin(example).match() == 3' -P print -P 'plugin(example).patch()'

0 commit comments

Comments
 (0)