Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name = "FileCheck"
uuid = "4e644321-382b-4b05-b0b6-5d23c3d944fb"
authors = ["Tim Besard <tim.besard@gmail.com>"]
version = "1.1.2"
authors = ["Tim Besard <tim.besard@gmail.com>"]

[deps]
LLVM_jll = "86de99a1-58d6-5da7-8064-bd56ce2e322c"
LLVM_utils_unified_jll = "0def2053-1a45-54bc-bfc1-6427e7aae702"

[compat]
LLVM_utils_unified_jll = "0.1.0"
julia = "1.10"
LLVM_jll = "15,16,18,20"
22 changes: 2 additions & 20 deletions src/FileCheck.jl
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
module FileCheck

import LLVM_jll
import LLVM_utils_unified_jll

export @filecheck

global filecheck_path::String
function __init__()
global filecheck_path = joinpath(LLVM_jll.artifact_dir, "tools", "FileCheck")
end

function filecheck_exe(; adjust_PATH::Bool=true, adjust_LIBPATH::Bool=true)
env = Base.invokelatest(
LLVM_jll.JLLWrappers.adjust_ENV!,
copy(ENV),
LLVM_jll.PATH[],
LLVM_jll.LIBPATH[],
adjust_PATH,
adjust_LIBPATH
)

return Cmd(Cmd([filecheck_path]); env)
end

function filecheck(f, input;
throws::Union{Nothing, Type{<:Exception}}=nothing,
match_full_lines::Bool=false,
Expand Down Expand Up @@ -82,7 +64,7 @@ function filecheck(f, input;

# now pass the collected output to FileCheck
filecheck_io = Pipe()
cmd = `$(filecheck_exe()) --color $path`
cmd = `$(LLVM_utils_unified_jll.llvm_FileCheck()) --color $path`
match_full_lines && (cmd = `$cmd --match-full-lines`)
strict_whitespace && (cmd = `$cmd --strict-whitespace`)
ignore_case && (cmd = `$cmd --ignore-case`)
Expand Down