Skip to content

Commit ca90752

Browse files
committed
Update Aspectator and add one more test case
1 parent 76a326b commit ca90752

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed

aspectator

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
info: expand($(..)) {
2+
$fprintf<"work/info.txt","%s %s %s\n",$path,$macro_name,$actual_args>
3+
}

tests/input/macro_actual_args.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#define NOARG
2+
#define ONE_ARG(x) (x)
3+
#define TWO_ARGS(x, y) (x + y)
4+
#define THREE_ARGS(x, y, z) (x + y + z)
5+
6+
int func(void)
7+
{
8+
return NOARG + ONE_ARG(1) + TWO_ARGS(2, 3) + THREE_ARGS(4, 5, 6);
9+
}

tests/output/macro_actual_args.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
input/macro_actual_args.c ONE_ARG actual_arg1=1
2+
input/macro_actual_args.c TWO_ARGS actual_arg1=2, actual_arg2= 3
3+
input/macro_actual_args.c THREE_ARGS actual_arg1=4, actual_arg2= 5, actual_arg3= 6

tests/test_info_expand.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ def test_simple_info_expand_all(self):
88
self.skip_os_specific_defines('work/info.txt')
99
self.compare(output='work/info.txt', expected='output/simple_call_info_expand_all.txt')
1010

11+
def test_macro_actual_args(self):
12+
self.cif.run(cif_input='input/macro_actual_args.c', aspect='aspect/macro_actual_args.aspect', stage='instrumentation')
13+
self.skip_os_specific_defines('work/info.txt')
14+
self.compare(output='work/info.txt', expected='output/macro_actual_args.txt')
15+
1116

1217
if __name__ == '__main__':
1318
unittest.main()

0 commit comments

Comments
 (0)