OXYGENHUB
◆ main retro-remote-debug-controller / .flow / jobs / test.sh
1.0 KiB · Bourne Again Shell (bash) · last changed ci: OxygenFlow pipeline, and Git's own files ignored 25 days ago source blame history raw
1
# The conformance suite against the reference emulator: the RRDC fork of
2
# x16emu in the image, launched headless by the suite on a loopback port.
3
set -eu
4
export RRDC_PORT=8391
5
export RRDC_BOOT_TIMEOUT=60
6
export RRDC_EMU_CMD="SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy /opt/x16emu/x16emu -rom /opt/x16emu/rom.bin -warp -controlport {port}"
7
status=0
8
python3 -m pytest -v -rs --junitxml=/src/junit.xml conformance || status=$?
9
# A suite that skipped every test never reached the emulator: that is a
10
# failure here, where one is always there to reach.
11
python3 - <<'PY'
12
import sys
13
import xml.etree.ElementTree as ET
14
root = ET.parse("/src/junit.xml").getroot()
15
suites = [root] if root.tag == "testsuite" else list(root)
16
tests = sum(int(s.get("tests", 0)) for s in suites)
17
skipped = sum(int(s.get("skipped", 0)) for s in suites)
18
print(f"conformance: {tests} tests, {skipped} skipped")
19
if tests == 0 or skipped == tests:
20
    sys.exit("conformance: every test skipped: the emulator did not answer on its control port")
21
PY
22
exit $status