File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,5 +5,33 @@ USEMODULE += embunit
55
66include $(RIOTBASE ) /Makefile.include
77
8+ # Compile time tests
9+ .PHONY : compile-test test-newlib-nano
10+ all : compile-test
11+
12+ ifneq (,$(filter newlib,$(USEMODULE ) ) )
13+ COMPILE_TESTS += test-newlib
14+ ifneq (,$(filter newlib_nano,$(USEMODULE)))
15+ CMP_OP = =
16+ else
17+ CMP_OP = !=
18+ endif
19+ endif
20+
21+ test-newlib : $(ELFFILE )
22+ $(Q ) \
23+ PRINTF_ADDR=$$($(NM ) $^ | sed -n '/ printf$$/ s/ .*//p') ; \
24+ IPRINTF_ADDR=$$($(NM ) $^ | sed -n '/ iprintf$$/ s/ .*//p') ; \
25+ echo " Test: comparing addresses of 'printf' and 'iprintf' symbols" ; \
26+ if test " $$ {PRINTF_ADDR}" $( CMP_OP) " $$ {IPRINTF_ADDR}" ; then \
27+ echo " [SUCCESS] '$$ {PRINTF_ADDR}' $( CMP_OP) '$$ {IPRINTF_ADDR}' is True" ; \
28+ else \
29+ echo " [FAILED] '$$ {PRINTF_ADDR}' $( CMP_OP) '$$ {IPRINTF_ADDR}' is False" ; \
30+ exit 1; \
31+ fi
32+
33+ compile-test : $(COMPILE_TESTS )
34+
35+
836test :
937 tests/01-run.py
You can’t perform that action at this time.
0 commit comments