Skip to content

Commit bfbb5cd

Browse files
committed
put back test in qemu-arm build
1 parent a5068ea commit bfbb5cd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ports/qemu-arm/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,27 @@ all: run
9191
run: $(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+
99117
include $(TOP)/py/mkrules.mk

0 commit comments

Comments
 (0)