Skip to main content

UNIX command-line tool for bash/shell utils unit testing

Project description

CircleCI coveralls version

DwnMonth DwnWeek DwnDay

pyversions license

Author: Pahaz Blinov


BashTest is a UNIX command-line tool for bash/shell utils unit testing.

This is a simplest way to write a simple bash tests.

requirements: Python2 or Python3


bashtest is on PyPI, so simply run:

pip install bashtest


easy_install bashtest

to have it installed in your environment.

For installing from source, clone the repo and run:

python install

If you don`t have pip you can install it

Typical use case

You write a text processed util or script and you want to test it.

For example, we want test ls util.

All of we need is create test_ls.bashtest file:

$ ls ./testsuit/list-directory

and then run tests

$ bashtest test_ls.bashtest
1 items passed all tests:
   1 tests in test_ls.bashtest
1 tests in 1 items.
1 passed and 0 failed.
Test passed.

Test README examples

You have a some open source project like this. And of course, as in any good open source project, you have examples. You can automatically check this examples. Just add bashtest README.rst in your CI tests.

More examples

You can finde some examples in this project. Please check test_*.bashtest files


usage: bashtest [-h] [--exitcode] [--no-blankline-substitution]
                [--no-normalize-whitespace] [-v] [-q] [--version]
                file [file ...]

BashTest is a UNIX command-line tool for running text-based bash tests.

positional arguments:
  file                  Input file

optional arguments:
  -h, --help            show this help message and exit
  --exitcode            Print exitcode after command end of output
                        Substitute `<BLANKLINE>` if an expected output block
                        contains a line containing only the `\n`
                        All sequences of whitespace (blanks and newlines) are
                        not equal
  -v, --verbose
  -q, --quiet
  --version             Print the version string

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for bashtest, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size bashtest-0.0.5.tar.gz (6.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page