filecheck
A Python-native clone of LLVMs FileCheck tool
Decision gist · record as of 2026-08-14
Yes, if you need LLVM FileCheck semantics in Python for compiler or code-generation testing. The package is stable, dependency-free, and covers 95.8% of LLVM's test suite. Install with caution if your tests rely on numeric substitution (arithmetic on captures), which is not yet supported; otherwise, it's a straightforward drop-in replacement for the C++ FileCheck tool.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later (3.10, 3.11, 3.12, or 3.13).
- Low friction: pure Python wheel with no runtime dependencies.
- Maintenance is aging—last release 360 days ago, but the repository remains active with a recent commit on 2025-08-19 and full type checking via pyright.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows use in most projects without restriction, including proprietary software.
last release 2025-08-19 (360 days) · last repo commit 2025-08-19 · 24 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 395,000 downloads/mo, #6,985 on PyPI
Alternatives
Verify before relying
pip install filecheck
# In a test file or comment:
# CHECK: expected pattern
# CHECK-NEXT: next line pattern
# CHECK-NOT: should not appear
from filecheck import FileCheck
fc = FileCheck()
fc.run_filecheck('input.txt', 'test_file.py')- Whether numeric substitution (arithmetic on captured values) is a blocker for your test suite, given it covers only 2 out of 1645 MLIR tests
- Whether the 69 known test failures (4.2% of MLIR filecheck tests) affect your specific use case
What it is and what it does
filecheck is a Python port of LLVM's FileCheck pattern-matching tool for validating text output in tests. It reads check directives (CHECK, CHECK-NEXT, CHECK-NOT, CHECK-LABEL, CHECK-DAG, etc.) from test files or comments and matches them against input text, reporting pass/fail with detailed diagnostics. The package passes 95.8% of LLVM's MLIR filecheck test suite and supports most core features including regex patterns, variable captures, and numeric captures, though numeric substitution (arithmetic on captured values) is not yet implemented.
The tool is fully type-checked with pyright and formatted with black, making it suitable for integration into compiler testing pipelines, MLIR/xDSL projects, and any workflow that needs pattern-based output validation. It requires Python 3.10 or later and has no external runtime dependencies, keeping installation and deployment simple.
Use it for
- Validate compiler or interpreter output in test suites by embedding CHECK directives in expected-output files
- Test MLIR or LLVM IR generation by matching patterns against generated code
- Verify code generation correctness in language implementation projects using pattern matching and variable capture
- Check diagnostic or error message output from tools by matching against known patterns
- Automate regression testing for xDSL or similar domain-specific languages
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need LLVM FileCheck semantics in Python for compiler or code-generation testing.
The package is stable, dependency-free, and covers 95.8% of LLVM's test suite. Install with caution if your tests rely on numeric substitution (arithmetic on captures), which is not yet supported; otherwise, it's a straightforward drop-in replacement for the C++ FileCheck tool.
Install
filecheck on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging—last release 360 days ago, but the repository remains active with a recent commit on 2025-08-19 and full type checking via pyright.
Requires Python 3.10 or later (3.10, 3.11, 3.12, or 3.13).
License in practice
Apache-2.0 permissive license allows use in most projects without restriction, including proprietary software.
Quickstart
pip install filecheck
# In a test file or comment:
# CHECK: expected pattern
# CHECK-NEXT: next line pattern
# CHECK-NOT: should not appear
from filecheck import FileCheck
fc = FileCheck()
fc.run_filecheck('input.txt', 'test_file.py')
Verify before relying
- Whether numeric substitution (arithmetic on captured values) is a blocker for your test suite, given it covers only 2 out of 1645 MLIR tests
- Whether the 69 known test failures (4.2% of MLIR filecheck tests) affect your specific use case
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release <4.0,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 360 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 395,000 / month, #6,985 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13 |
Evidence: filecheck-1.0.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “llvm filecheck python”
- filecheckfilecheck is a Python implementation of LLVM's FileCheck tool, used…
- llvm-testing-toolsProvides LLVM testing utilities like FileCheck and split-file as…
- llvmlitellvmlite provides a lightweight Python binding to LLVM's IR builder,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also llvm-testing-tools · lit · re-assert · iregexp-check · scripttest · mkdocs-exclude · interegular · LinkChecker · regexploit · shellcheck-py