Skip to content

Commit

Permalink
fixup! tests/libc_newlib: add test for newlib-nano inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
cladmi committed Jul 24, 2018
1 parent 0fe90d9 commit 3e29c10
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/libc_newlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,33 @@ USEMODULE += embunit

include $(RIOTBASE)/Makefile.include

# Compile time tests
.PHONY: compile-test test-newlib-nano
all: compile-test

ifneq (,$(filter newlib,$(USEMODULE)))
COMPILE_TESTS += test-newlib
ifneq (,$(filter newlib_nano,$(USEMODULE)))
CMP_OP = =
else
CMP_OP = !=
endif
endif

test-newlib: $(ELFFILE)
$(Q)\
PRINTF_ADDR=$$($(NM) $^ | sed -n '/ printf$$/ s/ .*//p');\
IPRINTF_ADDR=$$($(NM) $^ | sed -n '/ iprintf$$/ s/ .*//p');\
echo "Test: comparing addresses of 'printf' and 'iprintf' symbols";\
if test "$${PRINTF_ADDR}" $(CMP_OP) "$${IPRINTF_ADDR}" ; then \
echo "[SUCCESS] '$${PRINTF_ADDR}' $(CMP_OP) '$${IPRINTF_ADDR}' is True"; \
else \
echo "[FAILED] '$${PRINTF_ADDR}' $(CMP_OP) '$${IPRINTF_ADDR}' is False"; \
exit 1; \
fi

compile-test: $(COMPILE_TESTS)


test:
tests/01-run.py

0 comments on commit 3e29c10

Please sign in to comment.