Skip to content

Using FileCheck in Julia unit tests.

License

Notifications You must be signed in to change notification settings

JuliaLLVM/FileCheck.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileCheck.jl

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.

Quick Start

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"
end

The 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.

Check Directives

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

About

Using FileCheck in Julia unit tests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages