Basics of test case framework

This commit is contained in:
Angus Gratton 2016-02-08 14:15:12 +11:00
parent 9dec5dd628
commit 97a46e8c1a
7 changed files with 162 additions and 0 deletions

13
tests/Makefile Normal file
View file

@ -0,0 +1,13 @@
PROGRAM=tests
EXTRA_LINKER_SCRIPTS = $(PROGRAM_DIR)ld/tests.ld
PROGRAM_SRC_DIR = $(PROGRAM_DIR) $(PROGRAM_DIR)cases
# append -u <basename_test_entry to the linker arguments for
# each source file in the 'cases' directory, so the test case
# entries get added to the compiled binary
TESTCASE_SRC_FILES = $(wildcard $(PROGRAM_DIR)cases/*.c)
TESTCASE_ENTRIES = $(sort $(patsubst %.c,%,$(TESTCASE_SRC_FILES)))
EXTRA_LDFLAGS = $(foreach entry,$(TESTCASE_ENTRIES),-u testcase_$(notdir $(entry)))
include ../common.mk