Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
micropython/ports/qemu-riscv/Makefile.test
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
31 lines (21 sloc)
1.29 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LIB_SRC_C = shared/upytesthelper/upytesthelper.c | |
include Makefile | |
CFLAGS += -DTEST | |
.PHONY: $(BUILD)/genhdr/tests.h | |
TESTS_PROFILE = $(dir $(abspath $(firstword $(MAKEFILE_LIST))))/tests_profile.txt | |
$(BUILD)/test_main.o: $(BUILD)/genhdr/tests.h | |
$(BUILD)/genhdr/tests.h: | |
(cd $(TOP)/tests; ./run-tests.py --target=qemu-riscv --write-exp) | |
$(Q)echo "Generating $@";(cd $(TOP)/tests; ../tools/tinytest-codegen.py --profile $(TESTS_PROFILE) $(addprefix --exclude ,$(TESTS_EXCLUDE))) > $@ | |
$(BUILD)/lib/tinytest/tinytest.o: CFLAGS += -DNO_FORKING | |
$(BUILD)/firmware-test.elf: $(LDSCRIPT) $(ALL_OBJ_TEST) | |
$(Q)$(LD) $(LDFLAGS) -o $@ $(ALL_OBJ_TEST) $(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 | |
timeout --foreground -k 5s 60s qemu-system-riscv32 -machine $(BOARD) -bios none $(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" | |
# `make debugtest` will block QEMU until a debugger is connected to port 1234. | |
debugtest: $(BUILD)/firmware-test.elf | |
qemu-system-riscv32 -machine $(BOARD) -bios none $(QEMU_EXTRA) -nographic -monitor null -semihosting -serial mon:stdio -S -s -kernel $< |