Skip to content

Commit 7ea497f

Browse files
committed
fixup! ci(hexagon): add spec test workflow under qemu-hexagon user-mode
Fix three issues in the spec test harness for qemu-hexagon user-mode: - runtest.py: handle None return from invoke() on timeout instead of crashing with TypeError, and fix undefined variable r.buf -> runner.buf - all.py: only pass --qemu/--qemu-firmware to runtest.py when firmware is set (user-mode QEMU has no firmware); always increase timeouts to 120s when qemu_flag is active - test_wamr.sh: always pass --qemu to all.py when -Q is set, not only when -F (firmware) is also provided
1 parent 0b0dd17 commit 7ea497f

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

tests/wamr-test-suites/spec-test-script/all.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,15 @@ def test_case(
234234
CMD.append("--eh")
235235

236236
if qemu_flag:
237-
CMD.append("--qemu")
238-
CMD.append("--qemu-firmware")
239-
CMD.append(qemu_firmware)
237+
if qemu_firmware:
238+
CMD.append("--qemu")
239+
CMD.append("--qemu-firmware")
240+
CMD.append(qemu_firmware)
241+
# Increase timeouts for QEMU emulation (default: 30s start, 20s test)
242+
CMD.append("--start-timeout")
243+
CMD.append("120")
244+
CMD.append("--test-timeout")
245+
CMD.append("120")
240246

241247
if not clean_up_flag:
242248
CMD.append("--no_cleanup")

tests/wamr-test-suites/spec-test-script/runtest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def assert_prompt(runner, prompts, timeout, is_need_execute_result):
268268
log("Started with:\n%s" % header)
269269
else:
270270
log("Did not one of following prompt(s): %s" % repr(prompts))
271-
log(" Got : %s" % repr(r.buf))
271+
log(" Got : %s" % repr(runner.buf))
272272
raise Exception("Did not one of following prompt(s)")
273273

274274

@@ -781,6 +781,8 @@ def is_result_match_expected(out, expected):
781781
def test_assert(r, opts, mode, cmd, expected):
782782
log("Testing(%s) %s = %s" % (mode, cmd, expected))
783783
out = invoke(r, opts, cmd)
784+
if out is None:
785+
raise Exception("Timed out waiting for response to: %s" % cmd)
784786
if '\n' in out or ' ' in out:
785787
outs = [''] + out.split('\n')[1:]
786788
out = outs[-1]

tests/wamr-test-suites/test_wamr.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,11 @@ function spec_test()
632632
fi
633633
fi
634634

635-
if [[ ${ENABLE_QEMU} == 1 ]] && [[ -n ${QEMU_FIRMWARE} ]]; then
635+
if [[ ${ENABLE_QEMU} == 1 ]]; then
636636
ARGS_FOR_SPEC_TEST+="--qemu "
637-
ARGS_FOR_SPEC_TEST+="--qemu-firmware ${QEMU_FIRMWARE} "
637+
if [[ -n ${QEMU_FIRMWARE} ]]; then
638+
ARGS_FOR_SPEC_TEST+="--qemu-firmware ${QEMU_FIRMWARE} "
639+
fi
638640
fi
639641

640642
if [[ ${PLATFORM} == "windows" ]]; then

0 commit comments

Comments
 (0)