A Julia wrapper around LLVM's FileCheck tool for pattern-based file verification. Useful for testing compiler output, IR transformations, and other text-based verification tasks.
The package provides a @filecheck macro that lets you write check patterns inline with Julia code:
using Test, FileCheck
@test @filecheck begin
@check "hello"
"hello world"
endThe block's stdout and stderr are captured and verified against the check directives. If the last expression returns a non-nothing value, it is stringified and appended to the captured output.
The available checking macros closely follow FileCheck's functionality:
| Macro | Description |
|---|---|
@check |
Match a pattern anywhere in the remaining input |
@check_label |
Match a pattern and reset the match position (useful for sections) |
@check_next |
Match on the line immediately following the previous match |
@check_same |
Match on the same line as the previous match |
@check_not |
Verify a pattern does not appear before the next positive match |
@check_dag |
Match patterns in any order (unordered checks) |
@check_count n |
Match a pattern exactly n times |
@check_empty |
Match an empty line |