OXYGENHUB
# a673804c781c x16-emulator / .flow / jobs / conformance.sh
1.3 KiB · Bourne Again Shell (bash) · last changed ci: build and test x16emu natively on narvi-1, OxygenHub's RISC-V runner 17 days ago source blame history raw
a673804c Andy McCall 1
# The retro-remote-debug-controller conformance suite against the x16emu the
2
# build job made on narvi-1, as .github/workflows/conformance.yml runs it on
3
# x86: headless (SDL's dummy drivers), -warp, on a loopback port, with a
4
# zero-filled ROM, since the suite exercises the control API, not the ROM.
5
# pytest's JUnit XML goes to the hub's Tests tab, kept when the job fails too.
6
set -eu
7
chmod +x x16emu
8
truncate -s 262144 dummy-rom.bin
9
export RRDC_PORT=8080
10
export RRDC_BOOT_TIMEOUT=60
11
export RRDC_EMU_CMD="SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy $PWD/x16emu -rom $PWD/dummy-rom.bin -warp -controlport {port}"
12
status=0
13
(cd src/extern/retro-remote-debug-controller/conformance &&
14
	python3 -m pytest -v -rs -p no:cacheprovider --junitxml=/src/junit.xml) || status=$?
15
# A suite that skipped every test never reached the emulator: that is a
16
# failure here, where one is always there to reach.
17
python3 - <<'PY'
18
import sys
19
import xml.etree.ElementTree as ET
20
root = ET.parse("/src/junit.xml").getroot()
21
suites = [root] if root.tag == "testsuite" else list(root)
22
tests = sum(int(s.get("tests", 0)) for s in suites)
23
skipped = sum(int(s.get("skipped", 0)) for s in suites)
24
print(f"conformance: {tests} tests, {skipped} skipped")
25
if tests == 0 or skipped == tests:
26
    sys.exit("conformance: every test skipped: the emulator did not answer on its control port")
27
PY
28
exit $status