testglobe

Host regression checks

These checks compile production code on a host system and verify geometry, software-rendered pixels, graphics API arguments, input, and resource cleanup. Separate WebGL checks verify the browser frontend’s data, geometry, rendered pixels, and controls without changing the native test requirements. For application build instructions, see the project README.

Requirements and quick start

Run commands from the repository root. The native C runner requires:

These are host-test requirements; the runner is not intended for the historical DOS, Windows, Macintosh, or Unix toolchains used to build the application.

python3 tests/run.py

Additional options may be combined:

Option Additional checks Extra requirements
--ogl-contract OpenGL/GLUT calls and software texture pixels None
--igl-contract IRIS GL calls and software texture pixels None
--xgl-contract XGL calls with real X11 windows and events X11 development files, Xvfb, and xvfb-run
--sdk /path/to/sdk DOS/Matrox calls against original SDK declarations LibShell headers under XGX1/HEADERS
--gdi-contract Win16 startup, GDI calls, and messages None
--qd-contract System 7 startup, Toolbox calls, and events None

With all prerequisites installed, run every native group with:

python3 tests/run.py --ogl-contract --igl-contract --xgl-contract \
  --gdi-contract --qd-contract --sdk /path/to/sdk

Exit status zero means all requested checks passed. PASS lines identify completed checks; SKIP identifies an optional group that did not run. Without --sdk or MATROX_SDK, the Matrox SDK group is reported as skipped. The baseline needs no vendor graphics SDK. An intentionally injected application failure can be a passing test when the runner verifies its expected exit status and diagnostics.

What the host checks establish

Compilation uses strict C89, warnings, ASan, and UBSan, with undefined behavior handled as fatal. NO_SINF selects the C89 math path; the runner does not replay every Makefile target’s compiler options.

Each requested driver contract also compiles its production source files as separate translation units. This catches dependencies accidentally supplied by a fixture that includes a driver .c file. These checks use the same recorder declarations as the behavior tests; they do not substitute for compiling with the native SDK and linker.

Most legacy API declarations come from test fixtures; Matrox uses the supplied SDK headers. Call recorders check submitted arguments and simulated outcomes. They do not implement the original graphics libraries, establish native binary ABIs, or verify hardware rendering. Host integer and pointer widths, byte order, and calling conventions remain those of the host, even when segmented-driver keywords are removed for compilation. Platform-specific validation requirements appear below.

OSD meanings are defined under Controls and status. The tests check those states against actual submission, fallback, and failure paths, rather than only checking the user’s toggle settings.

Baseline coverage

Earth data

The runner builds src/e_bin.c and checks deterministic regeneration against the supplied src/e_saved.c. Missing, truncated, and oversized chunks must preserve an existing output. Input aliases, symbolic links, directories, FIFOs, and occupied temporary or backup paths must fail promptly without changing files. Changing the shared chunk size without updating the binary layout must reject generation; stale generated readers must also fail compilation.

tests/earth_data.c compares every embedded byte with the binary maps and checks invalid reads, 16 KiB chunk seams, and 64 KiB boundaries. It also runs from an empty directory to verify that runtime map files are unnecessary. Object symbols verify the 16 KiB per-array limit and Matrox’s inclusion of only EARTH_32 and EARTH_64. tests/earth_reference.h reads the binaries for expected colors; the application does not use that test-only file I/O.

Geometry and shared interfaces

Shared utilities and configuration

tests/driver_helpers.c exercises flat OpenGL and segmented GDI configurations: strip splitting with even overlap and odd limits, UV triangle parity, quad packet bounds and packing, invalid inputs, key handling, FPS toggling, debug metadata, bounded dragging, zero-sized windows, and large elapsed-time rotations. Shared-service checks cover allocation bounds, handle release, bounded status messages, empty-scene OSD, and completed-presentation timing that includes time between native events. Configuration checks cover platform and architecture defaults, conflicting settings, and explicit errors for unsupported legacy drivers.

tests/recovery.c injects failures into each scene-allocation stage in compiled-map and resource-backed builds. It checks bounded retries, restoring or reducing the resolution, empty-scene recovery, no-op revision handling, direct resource loading, reduced-latitude compaction, exact retained allocation sizes, and aborted traversal. Console diagnostics describe committed meshes only; GUI builds remain silent.

tests/tex_take.c verifies ownership transfer of the software texture base image, all nine lower-mipmap allocation failures, invalid dimensions, and the retained copying interface for borrowed input. Every adopted allocation must be released exactly once, including partial-construction failures.

WebGL

Commands and requirements

Palette verification requires Python 3. The data and geometry checks require Node.js 18 or later, with no npm packages, browser, or server:

python3 web/gen_cmap.py --check
node tests/web.mjs

Browser checks require Python 3.10 or later, the Python Playwright package, and Chromium. Install them in a suitable Python environment if needed:

python3 -m pip install playwright
python3 -m playwright install chromium
python3 tests/web_browser.py

The browser test starts its own HTTP server at the repository root. It selects CHROMIUM_BIN, then chromium or chromium-browser on PATH, then Playwright’s installed Chromium. These checks run separately from tests/run.py and add no native application build dependencies.

Coverage

Validation limits

The browser checks exercise a real WebGL implementation, which may use a software renderer in headless environments. They do not establish hardware acceleration, cross-browser compatibility, mobile performance, or availability of the public demo. Manual browser checks remain useful for graphics drivers, accessibility, and touch behavior on physical devices. The frontend requires WebGL 2 and has no WebGL 1 path.

OpenGL

Command

python3 tests/run.py --ogl-contract

Coverage

Native validation

Actual OpenGL rendering and availability of color-index visuals require GUI checks with the installed GL implementation. Apple SDK compilation and Cocoa/GLUT event-loop behavior require macOS; the host recorder checks callback ordering without implementing that event loop.

IRIS GL

Command

python3 tests/run.py --igl-contract

Coverage

Native validation

The recorder’s declarations are checked against the SGI guides and 1990 reference; optional subdivision constants are test-local tags. Native IRIX 4.0 builds must validate the 32-bit ABI, packed pixel transfer, fonts, window manager, and graphics hardware. IRIS GL texture and pixel-transfer calls return no success value, so checks of submission and observable failures cannot detect silent library or hardware errors.

Sun XGL

Command

python3 tests/run.py --xgl-contract

Additional requirements

Install X11 development headers/libraries, Xvfb, and xvfb-run. Set XGL_TEST_CPPFLAGS and XGL_TEST_LDFLAGS for nonstandard X11 locations. The driver uses real X11 windows and events under Xvfb; XGL calls use a host recorder.

Coverage

Native validation

tests/xgl_record/xgl/xgl.h uses manual-derived declarations and test-local symbolic values. The Sun SDK/runtime on Solaris is required to validate the real ABI, pipeline, and graphics output; the real X11 activity in these tests does not exercise XGL itself.

Matrox LibShell

Command

python3 tests/run.py --sdk /path/to/sdk
# Or set MATROX_SDK=/path/to/sdk.

Additional requirements

Provide the original LibShell headers under XGX1/HEADERS outside the repository. The runner uses their function prototypes, copying headers into a temporary directory and removing trailing DOS EOF bytes. DOS and board calls are recorded, and compiler pointer keywords are removed for host compilation. Vendor headers are not committed.

Coverage

Native validation

Microsoft C 7, LSCL.LIB, and a PG-641-compatible board are needed to validate huge pointers, DOS timing, the LibShell ABI, and graphics output. The recorder assumes nonblocking error-register reads and that positive rdfifocnt() permits a complete word read. The supplied SDK documentation does not establish FIFO count units or atomic availability; the installed library and board must validate those assumptions and asynchronous timing.

Windows GDI

Command

python3 tests/run.py --gdi-contract

Coverage

Native validation

The Win16 fixture models 16-bit POINT fields but does not reproduce Microsoft C 7 segmented pointers or callback code generation. Its MakeProcInstance casts suppress only GCC’s corresponding function-cast warning. Microsoft C 7, the Windows 3.1 SDK, and Windows must validate loader format, segmentation, FPU-emulator dispatch, palette mapping, and rendered pixels.

QuickDraw

Command

python3 tests/run.py --qd-contract

Coverage

Native validation

The Toolbox fixture models 16-bit Point/Rect fields. MPW, the stated Apple interfaces/libraries, and System 7 hardware or an appropriate emulator must validate code resources, A5 globals, executable format, and SANE/68881 dispatch. The FPU helper is compiled as ordinary host C for numerical checks; only MPW can verify its instruction selection and separate code segment. Physical palette mapping and QuickDraw hardware acceleration require the target runtime and display.

Shared software pipelines

OpenGL and IRIS GL textures

Either --ogl-contract or --igl-contract runs the real shared texsoft.c renderer against analytically predicted pixels. Cases cover row-vector transforms, six clipping planes, depth and culling, perspective interpolation, wrapping, bilinear/trilinear filtering, mipmap minification, indexed conversion, and cleanup. Invalid matrices, vertices, and UVs must be rejected before integer conversion; very large finite repeating UVs remain valid. Raster release retains mipmaps and the indexed lookup table for re-enabling at a resized viewport.

The same options run tests/texture.c, comparing every expanded RGB texel with the Earth palette source at all five resolutions. Checks cover same-size allocation reuse, transactional allocation failure, invalid sizes, idempotent cleanup, and dimensions needed after the staging image is released. Native IRIS GL and XGL recorders verify direct map-row conversion into packed images/rasters. Allocation-pressure profiles check smaller texture selection and flat-color recovery after exhausting supported sizes; retained OpenGL GLU staging remains covered by the OpenGL 1.1 checks.

GDI and QuickDraw geometry

Both driver contracts link the real integer soft3d.c module and exercise quad batching and Earth-resource traversal. Packets contain at most 64 quads and 130 shared vertices, with four indices and one palette byte per quad. DRV_QUAD_BATCH remains a capability of QUAD; individual quad submission is also checked.

Independent projection cases cover exact coordinates, near/far rejection, collapsed poles, triangle projection, and whole-polygon signed-area culling. A polygon whose first rounded fan triangle has the opposite orientation must still be classified correctly. Large accepted fixed-point rotation angles must match their equivalents modulo 360 degrees.

Boundary cases clip a triangle spanning 268 million coordinate units to exact viewport corners, reject reversed winding, and check full 32,767-pixel viewports. Indices are checked against the packet’s actual point count; short-array rejection must occur before any out-of-bounds read or output modification.