SHELLTEST(1)
π SHELLTEST(1) π
okay bestie, listen up β this is the manual page for shelltest, from shelltestrunner, version 1.2.1. yes the whole thing. no skimming. we're doing this together π«Ά
β¨ NAME β¨
shelltestrunner β test command-line programs or arbitrary shell commands
πΈ SYNOPSIS πΈ
literally that's it. that's the whole vibe.
π¦ DESCRIPTION π¦
shelltestrunner tests command-line programs (or like, arbitrary shell commands, it does not care). It reads simple declarative tests that specify a command, some input, and the expected output β and then it can run them:
- in parallel π₯
- selectively π
- with a timeout β°
- in color π
- and/or with differences highlighted β¨
it's giving "organized chaos but make it cute". periodt.
π OPTIONS π
-a,--allβ show all the failure output, even if it's huge. no hiding, we look at everything π-c,--colorβ show colored output, but only if your terminal supports it. if it doesn't, don't blame us π-d,--diffβ show failures in diff format. side-by-side-ish drama β¨-p,--preciseβ show failure output precisely. this one is good for whitespace, so if you're the kind of person who cares about a single trailing space, this is your moment π-x STR,--exclude=STRβ exclude test files whose path contains STR. bye felicia π¦--execdirβ run tests from within the test file's directory. normally test commands run within your current directory;--execdirmakes them run within the directory where they are defined, instead. main character energy, but for directories π--extension=EXTβ filename suffix of test files. default is.testπ-w,--with=EXECUTABLEβ replace the first word of (unindented) test commands. this option replaces the first word of all test commands with something else, which can be useful for testing alternate versions of a program. β οΈ commands which have been indented by one or more spaces will not be affected by this option. so indent responsibly, bestie--debugβ show debug info, for troubleshooting. when everything is on fire and you need answers π--debug-parseβ show test file parsing info and stop. just the parsing tea, nothing else β--help-formatβ display test format help π-?,--helpβ display help message π-V,--versionβ print version information π·οΈ-- TFOPTIONSβ set extra test-framework options like-j/--threads,-t/--select-tests,-o/--timeout,--hide-successes. use-- --helpfor a list. avoid spaces. (fr fr, no spaces)
π DEFINING TESTS π
test files, typically named tests/*.test, contain one or more tests consisting of:
- a one-line command
- optional standard input (
<<<), standard output (>>>) and/or standard error output (>>>2) specifications - an exit status (
>>>=) specification
test format:
# optional comment
the command to test
<<<
zero or more lines of standard input
>>>
zero or more lines of expected standard output
(or /REGEXP/ added to the previous line)
>>>2
zero or more lines of expected standard error output
(or /REGEXP/ added to the previous line)
>>>= EXITCODE (or /REGEXP/)
- a
/REGEXP/pattern may be used instead of explicit data. in this case, a match anywhere in the output allows the test to pass. the regular expression syntax isregex-tdfa(http://hackage.haskell.org/package/regex-tdfa)'s. iykyk πΈ EXITCODEis a numeric exit status (http://en.wikipedia.org/wiki/Exit_status), eg0for a successful exit. zero means we ate and left no crumbs π- you can put
!before a/REGEXP/orEXITCODEto negate the match. plot twist π - comment lines beginning with
#may be used between tests.
π EXAMPLES π
here's example.test, a file containing two simple tests:
# 1. let's test that echo runs. Numbering your tests can be helpful.
echo
>>>= 0
# 2. and now the cat command. On windows, this one should fail.
cat
<<<
foo
>>>
foo
>>>= 0
run it with shelltest:
$ shelltest example.test
:t.test:1: [OK]
:t.test:2: [OK]
Test Cases Total
Passed 2 2
Failed 0 0
Total 2 2
look at that. [OK] [OK] and a full house. we love to see it β¨π₯
π AUTHORS π
Simon Michael.
and that's the whole page, bestie!! π this was shelltestrunner, version 1.2.1, dated March 18 2012 β and that's the cute little sign-off, mwah π π¦ β¨
π¦ where this page comes from
- debian bookworm: shelltestrunner 1.9-2+b2 Β· GPL-3.0-or-later
- debian trixie: shelltestrunner 1.10-1+b1 Β· GPL-3.0-or-later
- ubuntu jammy: shelltestrunner 1.9-2build4.1 Β· GPL-3.0-or-later
- ubuntu noble: shelltestrunner 1.9.0.1-1 Β· GPL-3.0-or-later
- ubuntu questing: shelltestrunner 1.10-1
- ubuntu resolute: shelltestrunner 1.10-2 Β· GPL-3.0-or-later
- ubuntu stonking: shelltestrunner 1.10-2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms