(sigil cli test)
(sigil cli test) - sigil-cli's host-side build-fn for sigil test --backend=native
Wraps Scheme→C codegen + gcc linking into the (sigil test native-backend) build-fn contract:
(build-fn config sources output-path opts) => (values success? artifact-path build-output)
Lives in sigil-cli (not in sigil-test-runner) because it imports (sigil build) / (sigil compiler), and harness binaries built by sigil-build's generate-test-entrypoint can NOT bundle sigil-cli. The portable orchestration (parse-test-args, test-main, discovery) stays in (sigil test cli) inside sigil-test-runner so harnesses can resolve (import (sigil test cli)) at runtime.
sigil-cli's test-handler imports (sigil test cli) for test-main and (sigil cli test) for native-build-fn; it then calls test-main with build-fn: + config: kwargs. See [[procedures/sigil-package-extraction]] §6c for the dep-inversion-at-host-boundary pattern.
Exports
collect-files-with-extensionprocedureList files with a given extension in a directory. Returns absolute paths, [] if directory missing.
capture-stderrprocedureDrain stdout while capturing stderr from a subprocess. Returns (exit-code . stderr-string).
native-build-fnprocedurenative-build-fn — sigil-cli's wrap of compile-to-native-c + gcc into the (sigil test native-backend) build-fn contract.
(native-build-fn config sources output-path opts) => (values success? artifact-path build-output)
- config: symbol like 'dev / 'release. Selects build/<config>/native/*.a for package-specific native archives.
- sources: list of .sgl test source paths. Currently only the first is compiled (one test file per binary, matching the runner's per-file invocation pattern).
- output-path: where to drop the binary.
- opts: alist for the long tail (currently unused, reserved for extra-flags / package-context).