NIHTEST.CONF(5)

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

πŸ’– nihtest.conf β€” the config file glow-up πŸ’–

okay so this is the nihtest.conf(5) page, bestie β€” the file formats manual entry for the config file that nihtest(1) reads. sit down, hydrate, let's go 🫢


✨ NAME ✨

nihtest.conf β€” literally the format of the testing tool's configuration file. that's it, that's the vibe. πŸ’…


🌸 DESCRIPTION 🌸

so nihtest(1) is a testing tool, right? and it reads a configuration file to get its default settings. the default path for that file is nihtest.conf in the current directory β€” but you can override it with nihtest(1)'s -C flag, no cap. and this man page? it describes the format of this configuration file. iconic. πŸ’–


πŸ¦‹ FILE FORMAT πŸ¦‹

the configuration file is made of multiple sections, and each one starts with [section-name]. the supported sections are settings, environment, comparators, comparator-preprocessors, copiers, and suite. ✨

each section is just variable assignments in the format name = value, one per line. simple, clean, slay.

multiple values for the same variable? yes bestie, totally allowed β€” one per line, where the subsequent lines must be indented with spaces. 🌸


πŸŽ€ SETTINGS πŸŽ€

in the settings section, these are the variables that get recognized:

  • default-program = program β€” the test program to use if there's no program directive found in the test. your fallback fave. πŸ’œ
  • default-stderr-replace = pattern replacement ... β€” every line has two values: pattern is a regular expression and replacement is the corresponding replacement string. these get used for test cases that don't have stderr-replace directives. peek nihtest-case(5) for the deets on stderr-replace. πŸ”₯
  • default-working-directory = directory β€” use directory as the working directory if no working-directory directive is found in the test. home base energy. 🏠
  • environment-clear = true β€” if environment-clear is set to true, only variables explicitly set or passed through get included in the environment passed to the tested program. everything else? gone. ghosted. πŸ’€
  • environment-passthrough = variable ... β€” the named environment variables get passed through from the environment nihtest(1) is run in, straight into the environment passed to the tested program. 🫢
  • environment-unset = variable ... β€” the named environment variables get removed from the environment passed to the tested program. bye bestie ✌️
  • features-files = file ... β€” specifies the files to search for feature defines. this is used in the features directive in test cases. πŸ”
  • keep-sandbox = when β€” describes when to keep the sandbox (i.e., not delete it) after running the test. these are the supported values:
    • never β€” never keep the sandbox. πŸ—‘οΈ
    • failed β€” keep the sandbox when the test failed. 😭
    • always β€” always keep the sandbox. πŸ‘‘

this can be overridden with the nihtest(1) flags --keep-broken -= when or --no-cleanup. the default is never. ⭐

  • print-results = when β€” describes when to print the test results verbosely. supported values:
    • never β€” quiet mode. 🀫
    • failed β€” print details when the test failed. 😭
    • always β€” verbose mode. πŸ—£οΈ

this can be overridden with the nihtest(1) flags --quiet or --verbose. the default is failed. ✨

  • program-directories = directory ... β€” specifies the directories programs are searched for. they get prepended to PATH. πŸ”₯
  • sandbox-directories = directory ... β€” create sandboxes in directory. by default, the sandboxes get created in the current directory. a random directory of the pattern sandbox_* will be used. 🎲
  • test-input-directories = directory ... β€” nihtest(1) searches the current directory and directory for test cases, input and output files. πŸ“

🌈 ENVIRONMENT 🌈

the environment section contains variables and values that will be added as environment variables when the test program is run. it's giving "setting the scene". 🌸


🧚 COMPARATORS 🧚

the comparators section specifies programs to use to compare files of certain types. the variable names have the format got-extension.expected-extension, and the value specifies the command line to use to compare these files. πŸ’…

the command gets run with one or two files as arguments: the file in the sandbox is the first argument; if the expected file is a file, it will be the second argument; if it's inline data, it will be provided on stdin. 🫢

the command is expected to exit with code 0 if the two files are considered equal, and any other exit code if not. the command output will be displayed if verbose test results are enabled (see print-results above). πŸ‘€

for example, with comparators containing

zip.zip = zipcmp -v

and the test case containing

file got.zip expected.zip

then the command

zipcmp -v got.zip expected.zip

will be run to compare the files. ate that, fr fr. πŸ”₯


πŸ’œ COMPARATOR-PREPROCESSORS πŸ’œ

the comparator-preprocessors section specifies programs to use to preprocess certain file types for comparison. the variable names have the format got-extension.expected-extension, and the value specifies the command line to use to preprocess the file in the sandbox. the command gets run with the file in the sandbox first as argument. the command's output will be compared to the expected file. πŸ¦‹

if the command doesn't exit with code 0, the test will fail. 😭


⭐ COPIERS ⭐

the copiers section specifies programs to use to copy certain file types into the sandbox. the variable names have the format sandbox-extension.source-extension, and the value specifies the command line to use to copy the file into the sandbox. the command gets run with the two files as arguments β€” the source file first and the file in the sandbox last. πŸŽ€

if the command doesn't exit with code 0, the test will fail. πŸ’€


πŸ‘‘ SUITE πŸ‘‘

the optional suite can be used to define a suite of tests to be run with the --all command line option. main character section, honestly. 🌟

  • tests = tests β€” this specifies the tests to run. it can contain names or shell globs. .test will be appended if not present, and files will be searched for in test-input-directories. πŸ”
  • expected-failing-tests = tests β€” this specifies the tests that are expected to fail. tests are searched in the same way as for tests. πŸ™ˆ

πŸ“ EXAMPLES πŸ“

[settings]
default-program = program_to_test
program-directories = bin
    tests
[environment]
LC_ALL=en_US.UTF-8
[comparators]
zip.zip = zipcmp -v
[suite]
tests = *.test
expected_failing_tests = *-broken.test
    completely_broken_test.test

look at her. gorgeous. no notes. πŸ’…βœ¨


πŸŽ€ SEE ALSO πŸŽ€

  • nihtest(1) β€” go read it bestie, iykyk 🫢

ily for reading this far, fr fr πŸ’–

okay and the official sign-off: brought to you by NiH, dated January 21, 2026, and yeah the page is literally called NIHTEST.CONF(5). periodt. πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from