File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,27 @@ all: run
91
91
run : $(BUILD ) /firmware.elf
92
92
qemu-system-arm -machine integratorcp -cpu cortex-m3 -nographic -monitor null -serial null -semihosting -kernel $(BUILD ) /firmware.elf
93
93
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
+
94
108
# # `$(LD)` doesn't seem to like `--specs` for some reason, but we can just use `$(CC)` here.
95
109
$(BUILD ) /firmware.elf : $(OBJ_COMMON ) $(OBJ_RUN )
96
110
$(Q )$(CC ) $(CFLAGS ) $(LDFLAGS ) -o $@ $^ $(LIBS )
97
111
$(Q )$(SIZE ) $@
98
112
113
+ $(BUILD ) /firmware-test.elf : $(OBJ_COMMON ) $(OBJ_TEST )
114
+ $(Q )$(CC ) $(CFLAGS ) $(LDFLAGS ) -o $@ $^ $(LIBS )
115
+ $(Q )$(SIZE ) $@
116
+
99
117
include $(TOP ) /py/mkrules.mk
You can’t perform that action at this time.
0 commit comments