Port the standalone SDL frontend, and give the sink a line editor
An AKGL build of `basic` was a terminal program with unused SDL linked into it. It now opens the reference's 800x600 window, draws BASIC output in the Commodore font, pumps events, lets you type at it, and still mirrors every byte to stdout. The stdout mirror is a composing sink rather than a second write inside the interpreter, and lives in the core library where it needs no SDL. The line editor waits for a typed line by borrowing one frame at a time from the host, so nothing blocks and nothing owns an event loop it should not. The whole golden corpus now runs through the SDL binary as well as the stdio one, byte for byte. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -174,8 +174,8 @@ jobs:
|
||||
sudo apt-get install -y cmake gcc g++ pkg-config \
|
||||
libfreetype-dev libharfbuzz-dev
|
||||
# The akgl-backed half: the text sink and the graphics, audio and input
|
||||
# backends, plus the akgl_backends suite that drives them against a real
|
||||
# software renderer and reads the pixels back.
|
||||
# backends, the standalone SDL frontend, and the two suites that drive
|
||||
# them against a real software renderer and read the pixels back.
|
||||
#
|
||||
# It is a separate job rather than a flag on cmake_build because
|
||||
# AKBASIC_WITH_AKGL is off by default and that default is the point: the
|
||||
@@ -191,19 +191,30 @@ jobs:
|
||||
run: |
|
||||
cmake -S . -B build-akgl -DAKBASIC_WITH_AKGL=ON
|
||||
cmake --build build-akgl --parallel
|
||||
# Dummy video and audio drivers: the suite creates a 128x128 software
|
||||
# renderer and reads it back with SDL_RenderReadPixels, so it needs no
|
||||
# display, no sound card and no offscreen harness. Same approach
|
||||
# Dummy video and audio drivers, set per test by CMakeLists rather than in
|
||||
# this job's environment, because an AKGL build of `basic` is now an SDL
|
||||
# program and the golden cases run *it*: forty-one real windows is not what
|
||||
# anybody running the suite wanted. The suites create software renderers
|
||||
# and read them back with SDL_RenderReadPixels, so none of this needs a
|
||||
# display, a sound card or an offscreen harness -- the same approach
|
||||
# deps/libakgl/tests/draw.c takes.
|
||||
#
|
||||
# 71 cases: the 70 the default build runs, plus akgl_backends. The other
|
||||
# 70 are run here too on purpose -- they are the ones that must keep
|
||||
# passing when SDL *is* present, and a linker that picked up the wrong
|
||||
# akstdlib or akerror would show up here first.
|
||||
# The env block stays anyway. It is redundant with the per-test property
|
||||
# and costs nothing, and it is what keeps a hand-run `ctest` in this
|
||||
# directory behaving the same way.
|
||||
#
|
||||
# 72 cases: the default build's 72, minus the three no_device ones whose
|
||||
# premise is a driver with no devices attached -- which is exactly what
|
||||
# this build contradicts -- plus akgl_backends and akgl_frontend. The
|
||||
# golden cases run here too on purpose, and they are now doing double duty:
|
||||
# they are the ones that must keep passing when SDL is present, *and* they
|
||||
# are what proves the SDL frontend changes no output anywhere in the
|
||||
# corpus.
|
||||
- name: test with libakgl
|
||||
env:
|
||||
SDL_VIDEODRIVER: dummy
|
||||
SDL_AUDIODRIVER: dummy
|
||||
SDL_RENDER_DRIVER: software
|
||||
run: ctest --test-dir build-akgl --output-on-failure --output-junit "$(pwd)/ctest-akgl-junit.xml"
|
||||
- name: publish test results
|
||||
if: always()
|
||||
|
||||
Reference in New Issue
Block a user