NIHTEST.CONF(5)
π 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 noprogramdirective found in the test. your fallback fave. πdefault-stderr-replace = pattern replacement ...β every line has two values:patternis a regular expression andreplacementis the corresponding replacement string. these get used for test cases that don't havestderr-replacedirectives. peeknihtest-case(5)for the deets onstderr-replace. π₯default-working-directory = directoryβ usedirectoryas the working directory if noworking-directorydirective is found in the test. home base energy. πenvironment-clear = trueβ ifenvironment-clearis set totrue, 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 environmentnihtest(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 thefeaturesdirective 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 toPATH. π₯sandbox-directories = directory ...β create sandboxes indirectory. by default, the sandboxes get created in the current directory. a random directory of the patternsandbox_*will be used. π²test-input-directories = directory ...βnihtest(1)searches the current directory anddirectoryfor 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..testwill be appended if not present, and files will be searched for intest-input-directories. πexpected-failing-tests = testsβ this specifies the tests that are expected to fail. tests are searched in the same way as fortests. π
π 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
- alpine 3.24: nihtest-doc 1.11.1-r0 Β· BSD-3-Clause
- Copyright (C) 2020-2023 Dieter Baron and Thomas Klausner
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms