AtlatestRepositorysigil-ui

sigil-ui / tree / scriptstest-discovery-error.sgl

1;;; Linux loader-failure control, isolated from the normal test process.
2(import (sigil shell prelude))
3(requires (tools sigil))
4(define root (realpath (dirname (script-dir))))
5(cond-expand
6 (linux
7 (requires (tools gcc))
8 ;; Build the test host without loading Fontconfig in this controller.
9 ($ sigil test ,(path root "test/test-text.sgl") cwd: ,root timeout: 900)
10 (with-temp-dir work
11 (define denied-library (path work "deny-fontconfig.so"))
12 ($ gcc -std=c11 -Wall -Wextra -fPIC -shared
13 ,(path root "test/deny-fontconfig.c") -ldl -o ,denied-library timeout: 30)
14 ($ ,(path root "build/dev/bin/sigil-ui-test")
15 ,(path root "test/text-discovery-error.sgl")
16 env: ,(dict "LD_PRELOAD" denied-library) cwd: ,root timeout: 60)))
17 (else (println "Fontconfig loader-failure control applies to Linux.")))