sigildocs

(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 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)

Check if a file is executable

Discover native test executables in build directories. Looks for test- executables in build//bin/

Expand test arguments (files or directories) to test file paths.

test-mainprocedure

Main entry point for running tests.

This function can be called from:

  • The sigil test CLI command
  • A standalone test harness binary

Arguments: args - command-line arguments (excluding program name)

Returns: exit code (0 = success, 1 = failures)