Add colorful test output runner #11

Open
xrd wants to merge 1 commit from issue/7-colorful-test-output into main
Owner

Summary

Implements issue #7: Generate readable and colorful test output.

Changes

  • New src/test_runner.zig: Colorful test runner with:

    • ANSI color codes (green pass, red fail, yellow skip)
    • Box-drawing header
    • Per-test tree structure output (truncated to 20 lines)
    • Tree hash + content hash display
    • Regression detection banner
    • Summary with pass/fail/skip counts
    • Respects NO_COLOR / FORCE_COLOR env vars
    • Exit code 1 on failure
  • Updated src/main.zig: Added test command to CLI

  • Updated build.zig: Points to new test runner

Usage

sprinkyll test
TEST_EXAMPLE=simple sprinkyll test  # filter single example

Sample Output

  ╔══════════════════════════════════════════════════╗
  ║         Sprinkyll Test Suite                    ║
  ╚══════════════════════════════════════════════════╝

  [1/2] simple
  [2/2] hugo-svekyll

────────────────────────────────────────────────────────

  ✓ PASS  simple
         tree hash:    28e43e8e...
         content hash: a61e9292...
         Tree structure:
           _site/
           ├── index.html
           ...

────────────────────────────────────────────────────────

  ✓ ALL TESTS PASSED

  Results: 2 total, 2 passed, 0 failed, 0 skipped

Closes

Closes #7

## Summary Implements issue #7: Generate readable and colorful test output. ## Changes - **New `src/test_runner.zig`**: Colorful test runner with: - ANSI color codes (green pass, red fail, yellow skip) - Box-drawing header - Per-test tree structure output (truncated to 20 lines) - Tree hash + content hash display - Regression detection banner - Summary with pass/fail/skip counts - Respects `NO_COLOR` / `FORCE_COLOR` env vars - Exit code 1 on failure - **Updated `src/main.zig`**: Added `test` command to CLI - **Updated `build.zig`**: Points to new test runner ## Usage ```bash sprinkyll test TEST_EXAMPLE=simple sprinkyll test # filter single example ``` ## Sample Output ``` ╔══════════════════════════════════════════════════╗ ║ Sprinkyll Test Suite ║ ╚══════════════════════════════════════════════════╝ [1/2] simple [2/2] hugo-svekyll ──────────────────────────────────────────────────────── ✓ PASS simple tree hash: 28e43e8e... content hash: a61e9292... Tree structure: _site/ ├── index.html ... ──────────────────────────────────────────────────────── ✓ ALL TESTS PASSED Results: 2 total, 2 passed, 0 failed, 0 skipped ``` ## Closes Closes #7
- New test_runner.zig with ANSI color codes for pass/fail/skip
- Box-drawing header and regression detection banner
- Per-test tree structure output with hash verification
- Summary with pass/fail/skip counts
- Respects NO_COLOR and FORCE_COLOR environment variables
- Exit code 1 on test failures
- Added 'sprinkyll test' CLI command
- Updated build.zig to use new test runner
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue/7-colorful-test-output:issue/7-colorful-test-output
git switch issue/7-colorful-test-output

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff issue/7-colorful-test-output
git switch issue/7-colorful-test-output
git rebase main
git switch main
git merge --ff-only issue/7-colorful-test-output
git switch issue/7-colorful-test-output
git rebase main
git switch main
git merge --no-ff issue/7-colorful-test-output
git switch main
git merge --squash issue/7-colorful-test-output
git switch main
git merge --ff-only issue/7-colorful-test-output
git switch main
git merge issue/7-colorful-test-output
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
svekyll/sprinkyll!11
No description provided.