All Projects → dodie → testing-in-bash

dodie / testing-in-bash

Licence: GPL-2.0 license
Bash test framework comparison

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to testing-in-bash

Spree reviews
Straightforward review/rating functionality.
Stars: ✭ 122 (+24.49%)
Mutual labels:  review
Pull Review
✅ Assign pull request reviewers intelligently.
Stars: ✭ 179 (+82.65%)
Mutual labels:  review
Ofscripts
A collection of the AppleScripts I use to extend OmniFocus.
Stars: ✭ 231 (+135.71%)
Mutual labels:  review
Nlp Competitions List Review
复盘所有NLP比赛的TOP方案,只关注NLP比赛,持续更新中!
Stars: ✭ 1,997 (+1937.76%)
Mutual labels:  review
Ebisu
Public-domain Python library for flashcard quiz scheduling using Bayesian statistics. (JavaScript, Java, Dart, and other ports available!)
Stars: ✭ 176 (+79.59%)
Mutual labels:  review
Papers we read
Summaries of the papers that are discussed by VLG.
Stars: ✭ 203 (+107.14%)
Mutual labels:  review
Bird Recognition Review
A list of useful resources in the bird sound (song and calls) recognition, such as datasets, papers, links to open source projects and competitions
Stars: ✭ 116 (+18.37%)
Mutual labels:  review
Dashi
💯 Get a notification in Slack every time someone asks you to check some code on Github or Bitbucket.
Stars: ✭ 29 (-70.41%)
Mutual labels:  review
React Native In App Review
The Google Play In-App Review API, App store rating API lets you prompt users to submit Play Store or App store ratings and reviews without the inconvenience of leaving your app or game.
Stars: ✭ 175 (+78.57%)
Mutual labels:  review
Codeponder
Marketplace for Code Reviews
Stars: ✭ 221 (+125.51%)
Mutual labels:  review
Hyperion Android
App Debugging & Inspection Tool for Android
Stars: ✭ 1,778 (+1714.29%)
Mutual labels:  review
Hyperion Ios
In-app design review tool to inspect measurements, attributes, and animations.
Stars: ✭ 1,964 (+1904.08%)
Mutual labels:  review
Pronto
Quick automated code review of your changes
Stars: ✭ 2,450 (+2400%)
Mutual labels:  review
Leetcode Sol Res
Clean, Understandable Solutions and Resources for LeetCode Online Judge Algorithm Problems.
Stars: ✭ 1,647 (+1580.61%)
Mutual labels:  review
Thorsserializer
C++ Serialization library for JSON
Stars: ✭ 241 (+145.92%)
Mutual labels:  review
Merge Request Integration
An Intellij IDE plugin which helps you manage Merge Request and do Code Review right in your IDE.
Stars: ✭ 122 (+24.49%)
Mutual labels:  review
Sputnik
Static code review for your Gerrit patchsets. Runs Checkstyle, PMD, FindBugs, Scalastyle, CodeNarc, JSLint for you!
Stars: ✭ 189 (+92.86%)
Mutual labels:  review
react-before-after-slider
A sexy image comparison slider for React.
Stars: ✭ 63 (-35.71%)
Mutual labels:  comparison
Change Detection Review
A review of change detection methods, including codes and open data sets for deep learning. From paper: change detection based on artificial intelligence: state-of-the-art and challenges.
Stars: ✭ 248 (+153.06%)
Mutual labels:  review
Survey Computer Vision
2020-2021年计算机视觉综述论文分方向整理
Stars: ✭ 207 (+111.22%)
Mutual labels:  review

In search of the best test framework for Bash

There are many testing frameworks for Bash. However, many of them are not actively maintained, or are used only by a small group of people.

In this comparision I've included well-established and new testing frameworks that had at least recent release and have more than 50 Stars on GitHub:

  • Bats, a mature testing library with a bit of a custom syntax for more concise tests
  • shUnit2, possibly the oldest Bash test framework around, supporting test files in pure Bash
  • bash_unit, a new and featureful test framework where test cases can be written in pure Bash
  • ShellSpec, a BDD style testing framework with its own DSL
  • shpec, a BDD style testing framework similar to RSpec, Jasmine, and mocha

Test drive

To start fiddling with any of the test projects just run the install.sh to download and extract the particular testing framework to a local directory, then execute test.sh to start the suite.

Detailed comparision

Bats shUnit2 bash_unit ShellSpec shpec
Discover and run all tests
in the project
✔️ ? ? ✔️ ? ✔️
Run subset of tests or
a specific test
✔️ ? ? ✔️ ✔️ issue
Parallel test execution ✔️ ✔️
Skip or ignore tests ✔️ ? ✔️ ? ✔️ issue
Rich assertion library ? ? ? ✔️ ? ✔️ ?
Extensible with custom assertions ✔️ ? ✔️ ? ✔️ ? ✔️ ? ✔️ ?
Before / After ✔️ issue ✔️ ✔️ issue
BeforeAll / AfterAll issue issue ✔️ ✔️ ? issue
Parameterized tests
and test data
issue ✔️
Mocking * ✔️ ? ? ✔️ ? ✔️ ? ✔️ ?
Isolation between tests ** ✔️ doc ✔️ ✔️
Nice local report ? ✔️ ✔️ ✔️ ✔️
CI compatible report ✔️ TAP issue ✔️ TAP ✔️ TAP
Zero Dependency and
implemented in Bash ***
✔️ ✔️ ✔️ ✔️ ✔️
Easy to install **** ✔️ ✔️ ✔️ ✔️ ✔️
Tests written in Bash almost ✔️ ✔️ ? ?
Compatible with the
Unofficial Bash Strict Mode *****
? ✔️ issue ✔️
Maintained ? ? ✔️ ? ✔️ ? ?
Mature ✔️ since 2011 ✔️ since 2007 ✔️ since 2016 since 2019 ✔️ since 2013
Good documentation ? ✔️ ? ✔️ ? ✔️ ? ✔️ ?

* Mocking:
The testing framework is compatible with the common mocking techniques.

** Isolation between tests:
Aliases, custom function definitions, Bash options and variables are not leaking from one test to another.

*** Zero Dependency and implemented in Bash:
Apart from a few common tools like coreutils and grep, you don't need anything to use the framework.
The source code of the framework is itself implemented as Bash scripts. If you are comfortable with Bash, you can read and even modify it.

**** Easy to install:
Many of the frameworks support more than one alternatives on how to set it up quickly. It's possible to install it with your favourite package manager and some of them even have an official Docker image. Personally, I try to avoid installing project dependencies globally as much as I can, so I just decided to grab a tar.gz file with the latest release from GitHub.

***** Compatible with the Unofficial Bash Strict Mode:
Sourcing a script file that use the Unofficial Bash Strict Mode should not break the test framework. Of course, custom assertions and the test code should also work with strict mode but that's up for the user. Also, the test framework shouldn't set Bash options as well to ensure that executing sourced functions work similarly to when they are not sourced.

Related posts, other comparisions

Contribution guide

If you know a testing framework that should be mentioned here or find that there's room for improvement feel free to open an issue or Pull Request. (See CONTRIBUTING.md.)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].