aboutsummaryrefslogtreecommitdiff
path: root/ports/qemu-arm/Makefile.test
diff options
context:
space:
mode:
authorJim Mussared2019-08-19 10:59:27 +1000
committerDamien George2019-08-20 15:14:08 +1000
commit0bd1eb80ff49dd0d4ad0c369a83a5aadea995944 (patch)
tree49befa6047dd9e86e28b78675800f0678aa85cc6 /ports/qemu-arm/Makefile.test
parent4ab5156c01bfd4a6304e26b1dc2d34163b8637c0 (diff)
qemu-arm: Add testing of frozen native modules.
- Split 'qemu-arm' from 'unix' for generating tests. - Add frozen module to the qemu-arm test build. - Add test that reproduces the requirement to half-word align native function data.
Diffstat (limited to 'ports/qemu-arm/Makefile.test')
-rw-r--r--ports/qemu-arm/Makefile.test7
1 files changed, 5 insertions, 2 deletions
diff --git a/ports/qemu-arm/Makefile.test b/ports/qemu-arm/Makefile.test
index 347c2fefd..32ec95a4f 100644
--- a/ports/qemu-arm/Makefile.test
+++ b/ports/qemu-arm/Makefile.test
@@ -1,5 +1,7 @@
LIB_SRC_C = lib/upytesthelper/upytesthelper.c
+FROZEN_MPY_DIR ?= test-frzmpy
+
include Makefile
CFLAGS += -DTEST
@@ -8,7 +10,7 @@ CFLAGS += -DTEST
$(BUILD)/test_main.o: $(BUILD)/genhdr/tests.h
$(BUILD)/genhdr/tests.h:
- (cd $(TOP)/tests; ./run-tests --write-exp)
+ (cd $(TOP)/tests; ./run-tests --target=qemu-arm --write-exp)
$(Q)echo "Generating $@";(cd $(TOP)/tests; ../tools/tinytest-codegen.py) > $@
$(BUILD)/tinytest.o:
@@ -18,7 +20,8 @@ $(BUILD)/firmware-test.elf: $(OBJ_COMMON) $(OBJ_TEST)
$(Q)$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
$(Q)$(SIZE) $@
+# Note: Using timeout(1) to handle cases where qemu hangs (e.g. this can happen with alignment errors).
test: $(BUILD)/firmware-test.elf
- qemu-system-arm -machine $(BOARD) $(QEMU_EXTRA) -nographic -monitor null -semihosting -kernel $< > $(BUILD)/console.out
+ timeout --foreground -k 5s 30s qemu-system-arm -machine $(BOARD) $(QEMU_EXTRA) -nographic -monitor null -semihosting -kernel $< > $(BUILD)/console.out
$(Q)tail -n2 $(BUILD)/console.out
$(Q)tail -n1 $(BUILD)/console.out | grep -q "status: 0"