NIHTEST(1)

πŸ“¦
version 1.11.1 Β· 3 versions
, in alpine 3.24

πŸ’– NIHTEST(1) β€” the testing tool glow-up πŸ’–

okay so bestie, welcome to nihtest (that's the fancy General Commands Manual energy, iykyk) β€” the testing tool that's literally about to be your new best friend 🫢


✨ SYNOPSIS ✨

nihtest [-hqVv] [--all] [-C config] [--debug] [--keep-broken] [--no-
        cleanup] [--setup-only] [testcase ...]

🌸 DESCRIPTION 🌸

So. nihtest is a testing tool for command line utilities, and it slays. It eats .test files for breakfast β€” the whole format is spelled out in nihtest-case(5) if you wanna go read it, which you should, bestie.

nihtest runs the test cases you name on the command line or, if you pass the --all option, the ones in the suite section of the config file. Shell globs work on the command line too (yes, * is your friend πŸ’…), and test cases are expected to live in the test case directory.

Where does it look for stuff? nihtest searches the current directory and the source-directory specified in nihtest.conf(5) for test cases, input files and output files. It's thorough like that πŸ”

nihtest supports the following options:

  • --all β€” runs all the tests specified in the suite section of the config file. all of them. the whole squad. πŸ‘‘
  • -C config, --config-file config β€” use config as the configuration file instead of ./nihtest.conf. picky about its menu, we love that.
  • --debug β€” sets up the sandbox but runs the program inside a debugger. super handy for vibes-based investigation, but heads up: results are not checked. not me letting you poke at it freely πŸ™ˆ
  • -h, --help β€” displays a short help message and exits. the classic.
  • --keep-broken β€” does not delete the sandbox if the test fails. keep the crime scene intact πŸ”₯
  • --no-cleanup β€” does not delete the sandbox after the test finishes (successfully or not). no tidying, no cap.
  • -q, --quiet β€” does not print test results. silent mode. stealth mode. ninja mode. 🀫
  • --setup-only β€” only populates the sandbox, but doesn't run the actual test. a little appetiser, no main course πŸ“
  • -v, --verbose β€” prints detailed test results. give me all the lore.
  • -V, --version β€” prints the nihtest version number and exits. short and sweet.

πŸ¦‹ the test run pipeline (a whole journey) πŸ¦‹

A test run consists of the following steps:

  1. check if test should be skipped
  2. create sandbox directory
  3. populate sandbox directory with input files
  4. run program
  5. compare program output, exit code, and output files
  6. remove sandbox

it's giving process. it's giving structure. honestly obsessed ✨


πŸŽ€ FILES πŸŽ€

  • nihtest.conf β€” the nihtest configuration file, see nihtest.conf(5) for details. it's giving main character energy for your project setup.

πŸ’€ EXIT STATUS πŸ’€

nihtest uses the following exit codes:

  • 0 β€” Test passed πŸ₯³
  • 1 β€” Test failed 😭
  • 2 β€” Other error
  • 77 β€” Test was skipped.

πŸ” DIAGNOSTICS πŸ”

In general, differences to the test case expectation are marked up with - if something expected did not happen and + if something unexpected happened. very readable, very demure.

In case the return value does not match, nihtest will report Exit code not as expected. If the standard output or standard error output are not correct, nihtest will report Output not as expected or Error output not as expected respectively. And finally, if the file contents of the sandbox are not correct, nihtest will report Files in sandbox not as expected.

basically it tells you exactly which vibe check you failed. no guessing required πŸ’…


🌈 SEE ALSO 🌈


okay bestie, that's the whole page πŸ’– this little number is from NiH, dated September 16, 2025, and it's the NIHTEST(1) manpage β€” go forth and test your command line utilities with confidence, you're gonna eat 🫢✨

πŸ“¦ where this page comes from