Skip to content

Commit 609d952

Browse files
committed
tests/instr-cov/c_metaprog: avoid dependency to printf
Modify the test to avoid using printf as it does not compile on some cross targets (e.g. arm-elf with a light-stm32f4 RTS).
1 parent a51c1c4 commit 609d952

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

testsuite/tests/instr-cov/c_metaprog/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ int
22
main ()
33
{
44
int a = 0;
5-
#define DECISION a
6-
#include "meta_print_msg.h"
5+
#define DECISION 1
6+
#include "meta_inc.h"
77
return 0;
88
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#ifdef DECISION
2+
if (DECISION)
3+
a++;
4+
#endif

testsuite/tests/instr-cov/c_metaprog/meta_print_msg.h

Lines changed: 0 additions & 6 deletions
This file was deleted.

testsuite/tests/instr-cov/c_metaprog/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
gprsw=GPRswitches(root_project=gprfor(srcdirs=[".."], mains=["main.c"])),
1818
covlevel="stmt+decision",
1919
mains=["main"],
20-
extra_instr_args=["--ignore-source-files=meta_print_msg.h"],
20+
extra_instr_args=["--ignore-source-files=meta_inc.h"],
2121
extra_coverage_args=["-axcov"],
2222
trace_mode="src",
2323
)

0 commit comments

Comments
 (0)