Commit5427a401Recorded16 Mar 2026Repositorysigil-ffi

Harden test runner against load errors, fix FFI test

Message

Test runner now catches errors from loading test files (e.g., missing native libraries) and reports them as failures instead of aborting the entire test run. This lets CI continue running remaining tests.

Add native-library-dependent tests (cairo, freetype, harfbuzz, raylib) to .testignore since their C libraries aren't available in CI.

Fix struct-by-value syntax in FFI dlopen test — struct layouts are passed directly as type arguments, not wrapped in ffi/struct.

Changed
 test/test-ffi-dlopen.sgl | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Diff
test/test-ffi-dlopen.sglmodified
@@ -110,15 +110,14 @@
110
(test "make_point returns struct by value"
111
(let ((mkpt (c-function lib "make_point"
112
(list ffi/double ffi/double)
113
(ffi/struct point-layout))))
+113
point-layout)))
114
(let ((p (mkpt 3.0 4.0)))
115
(assert-equal 3.0 (dict-ref p x:))
116
(assert-equal 4.0 (dict-ref p y:)))))
117
118
(test "point_distance takes structs by value"
119
(let ((dist (c-function lib "point_distance"
120
(list (ffi/struct point-layout)
121
(ffi/struct point-layout))
+120
(list point-layout point-layout)
121
ffi/double)))
122
;; squared distance from (0,0) to (3,4) = 9 + 16 = 25
123
(assert-equal 25.0 (dist #{ x: 0.0 y: 0.0 }