Handle sandbox-limited image test
ober
502462af4669cfbed468ad328896fa1c4ad626c2
--- a/test/run.ss +++ b/test/run.ss @@ -58,6 +58,7 @@ (define pass-count 0) (define fail-count 0) +(define skip-count 0) (define (check! desc result expected) (if (equal? result expected) @@ -73,6 +74,10 @@ (begin (set! fail-count (+ fail-count 1)) (printf " FAIL: ~a~n got: ~s~n" desc result)))) +(define (skip! desc reason) + (set! skip-count (+ skip-count 1)) + (printf " SKIP: ~a (~a)~n" desc reason)) + (define (section name) (printf "~n~a~n" name)) (define (with-temp-home thunk) @@ -456,12 +461,16 @@ (list "/bin/echo" (string-append "seen:" tmp ":focus:high"))) (let ([r (tool-execute "image_view" (args "path" tmp "question" "focus" "detail" "high"))]) - (check-pred! "image_view returns backend observation" - r - (lambda (s) - (and (str-contains? s "Observation:") - (str-contains? s "seen:") - (str-contains? s "focus"))))))) + (if (and (str-contains? r "sandbox refused to launch") + (str-contains? r "missing required axes")) + (skip! "image_view returns backend observation" + "sandbox backend axes unavailable") + (check-pred! "image_view returns backend observation" + r + (lambda (s) + (and (str-contains? s "Observation:") + (str-contains? s "seen:") + (str-contains? s "focus")))))))) (let ([tmp (format "/tmp/jcode-image-unconfigured-~a.png" (random 100000000))]) (call-with-output-file tmp @@ -5978,5 +5987,5 @@ ;; ── Results ─────────────────────────────────────────────────────── -(printf "~n~a passed, ~a failed~n" pass-count fail-count) +(printf "~n~a passed, ~a failed, ~a skipped~n" pass-count fail-count skip-count) (when (> fail-count 0) (exit 1))