Git Product home page Git Product logo

bashtest's Introduction

CircleCI version

pyversions license

Author: Pahaz Blinov

Repo: https://github.com/pahaz/bashtest/

BashTest is a UNIX command-line tool for the testing bash/shell utilites.

This is a simplest way to write simple bash tests.

requirements: Python2 or Python3

keywords: bash unittest, unittesting, bash tesing, sh unit testing

Installation

bashtest is on PyPI, so simply run:

pip install bashtest

or :

easy_install bashtest

to have it installed in your environment.

For installing from source, clone the repo and run:

python setup.py install

If you don`t have pip you can install it

Typical use case

You have a command line util or bash/sh script and you want to test it.

For example, we want to test ls util.

All of we need is to create text file with execution log.

./test_ls.bashtest :

$ ls ./testsuit/list-directory
file1
file2.txt
file3.py
file4.sh

Run this 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

changelog

** 0.0.8 **
  • add #skipbashtest support
** 0.0.7 **
  • fix! remove ugly and useless options
  • feat! Test README.rst #4
  • feat! find *.bashtest by default #3
** 0.0.6 **
  • fix! bad command escaping bug #5

HELP

$ bashtest --help
usage: bashtest [-h] [--exitcode] [-v] [-q] [--debug] [--version]
                [file [file ...]]

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

positional arguments:
  file           Input file (by default uses *.bashtest)

optional arguments:
  -h, --help     show this help message and exit
  --exitcode     Print exitcode after command end of output
  -v, --verbose  Verbose output mode
  -q, --quiet    Silent output mode
  --debug        Print the debug information
  --version      Print the version string

bashtest's People

Contributors

pahaz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.