Skip to content

Commit 3e29c10

Browse files
committed
fixup! tests/libc_newlib: add test for newlib-nano inclusion
1 parent 0fe90d9 commit 3e29c10

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

tests/libc_newlib/Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,33 @@ USEMODULE += embunit
55

66
include $(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+
836
test:
937
tests/01-run.py

0 commit comments

Comments
 (0)