filecheck(1)

✨ filecheck(1) β€” bestie edition ✨

okay so like, welcome to the filecheck manual page πŸ’– this is section 1 of the manual (iykyk), and we're about to have a whole moment together. grab a strawberry πŸ“, sit down, and let's get into it.


🌸 NAME 🌸

filecheck β€” it's literally an attempt to reimplement LLVM's FileCheck using Python 🐍✨


πŸŽ€ SYNOPSIS πŸŽ€

filecheck <check-file> [<options>]

like… that's it. that's the whole vibe. one check file, some options, go off πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

so Filecheck is a Python implementation for LLVM LIT integration tests (yes, integration tests, they said it twice in the original and honestly? iconic of them, we're keeping that energy fr fr 😭).

ngl this package is so useful for people who are not familiar with the LLVM infrastructure, and also for Python-based projects that would simply prefer to not have to build anything from LLVM's source code in their CI process. no cap. you just… don't have to do all that πŸ’€πŸ«Ά


✨ OPTIONS ✨

  • --match-full-lines β€” require all positive matches to cover an entire input line. it does allow leading and trailing whitespace, but only if --strict-whitespace is not also passed. it's giving ✨conditional generosity✨
  • --strict-whitespace β€” do not treat all horizontal whitespace as equivalent. the spaces are gonna matter now bestie, every single one 🫣
  • --check-prefix β€” lets you change the default match keyword CHECK to literally any arbitrary keyword you want. your keyword, your rules πŸ’…
  • --implicit-check-not β€” adds an implicit CHECK-NOT check that works on every input line. sneaky? no. effective? absolutely πŸ”₯
  • --help β€” display available options. the classic. the main character. always there for you πŸ’–

🌈 EXAMPLES 🌈

okay this is the fun part, let's actually see it.

take this check file named without--strict-whitespace.check:

CHECK: String1   String2           String3

it will pass on any of the following inputs:

printf "String1 String2 String3" | filecheck without--strict-whitespace.check
printf "String1  String2          String3" | filecheck without--strict-whitespace.check
printf "   String1String2String3 " | filecheck without--strict-whitespace.check

because by default all that horizontal whitespace is treated as equivalent β€” it's giving chaos, it's giving flexible, it's giving slay πŸ¦‹

adding --strict-whitespace disables this behavior. periodt. 🚫


now the other one. take this check file named without--match-full-lines.check:

CHECK: tring1
CHECK: ring2
CHECK: String3

it will pass on the following input:

printf "String110tring210tring3" | filecheck without--match-full-lines.check

(no because the way those matches just be living inside the other strings, unbothered, moisturized, in their lane πŸ˜­πŸ’€)

the --match-full-lines disables this behavior. so if you want your matches to cover the whole line, that's your flag, bestie πŸ‘‘


🧚 REPORTING BUGS 🧚

found a bug? don't be shy, tell on it πŸ™ˆ to report a bug please visit the filecheck issues tracking system at:

https://github.com/mull-project/FileCheck.py/issues


πŸ‘‘ AUTHORS πŸ‘‘

this manual page was written by Bo YU <tsu.yubo@gmail.com> for the Debian project β€” but like, it may be used by others too, so don't gatekeep πŸ’œ


and that's the whole page, bestie!! πŸ’–βœ¨ this was FILECHECK 0.0.23, dated Oct 2023, brought to you by filecheck(1) β€” thanks for reading, ily, go write some passing tests πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from