(sigil test cli)
(sigil test cli) - Reusable Test CLI Logic
Provides argument parsing and test execution for both the sigil test command and standalone test harnesses. This module allows test harnesses to share the exact same behavior as sigil test.
Exports
parse-test-argsprocedureParse test command arguments into an options alist.
Recognizes the following flags: --native Run only native (C) tests --sgl Run only Sigil (.sgl) tests -f, --filter Run only tests matching PATTERN -c, --compact Compact output (dots instead of full names) -q, --quiet Minimal output (exit code only) --fail-fast Stop on first failure --no-color Disable colored output --report PATH Write JSON report to PATH and print summary line
Returns: (options . remaining-args) options - alist of parsed options remaining-args - non-flag arguments (test files/directories)
file-executable?procedureCheck if a file is executable
discover-native-testsprocedureDiscover native test executables in build directories. Looks for test- executables in build//bin/
expand-test-argsprocedureExpand test arguments (files or directories) to test file paths.
test-mainprocedureMain entry point for running tests.
This function can be called from:
- The
sigil testCLI command - A standalone test harness binary
Arguments: args - command-line arguments (excluding program name)
Returns: exit code (0 = success, 1 = failures)