File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,9 +91,27 @@ all: run
9191run : $(BUILD ) /firmware.elf
9292 qemu-system-arm -machine integratorcp -cpu cortex-m3 -nographic -monitor null -serial null -semihosting -kernel $(BUILD ) /firmware.elf
9393
94+ test : $(BUILD ) /firmware-test.elf
95+ qemu-system-arm -machine integratorcp -cpu cortex-m3 -nographic -monitor null -serial null -semihosting -kernel $(BUILD ) /firmware-test.elf > $(BUILD ) /console.out
96+ $(Q ) tail -n2 $(BUILD ) /console.out
97+ $(Q ) tail -n1 $(BUILD ) /console.out | grep -q " status: 0"
98+
99+ .PHONY : $(BUILD ) /genhdr/tests.h
100+
101+ $(BUILD ) /test_main.o : $(BUILD ) /genhdr/tests.h
102+ $(BUILD ) /genhdr/tests.h :
103+ $(Q ) echo " Generating $@ " ; (cd $( TOP) /tests; ../tools/tinytest-codegen.py) > $@
104+
105+ $(BUILD ) /tinytest.o :
106+ $(Q )$(CC ) $(CFLAGS ) -DNO_FORKING -o $@ -c $(TOP ) /tools/tinytest/tinytest.c
107+
94108# # `$(LD)` doesn't seem to like `--specs` for some reason, but we can just use `$(CC)` here.
95109$(BUILD ) /firmware.elf : $(OBJ_COMMON ) $(OBJ_RUN )
96110 $(Q )$(CC ) $(CFLAGS ) $(LDFLAGS ) -o $@ $^ $(LIBS )
97111 $(Q )$(SIZE ) $@
98112
113+ $(BUILD ) /firmware-test.elf : $(OBJ_COMMON ) $(OBJ_TEST )
114+ $(Q )$(CC ) $(CFLAGS ) $(LDFLAGS ) -o $@ $^ $(LIBS )
115+ $(Q )$(SIZE ) $@
116+
99117include $(TOP ) /py/mkrules.mk
You can’t perform that action at this time.
0 commit comments