All Projects → banditcpp → Bandit

banditcpp / Bandit

Licence: other
Human-friendly unit testing for C++11

Programming Languages

cpp
1120 projects
cpp11
221 projects

Projects that are alternatives of or similar to Bandit

bdd-for-c
A simple BDD library for the C language
Stars: ✭ 90 (-62.5%)
Mutual labels:  tdd, bdd, test-framework, test-driven-development
PixelTest
Fast, modern, simple iOS snapshot testing written purely in Swift.
Stars: ✭ 56 (-76.67%)
Mutual labels:  tdd, test-framework, test-driven-development, testing-framework
Aruba
Test command-line applications with Cucumber-Ruby, RSpec or Minitest. The most up to date documentation can be found on Cucumber.Pro (https://app.cucumber.pro/projects/aruba)
Stars: ✭ 900 (+275%)
Mutual labels:  tdd, bdd, test-driven-development, testing-framework
Catch2
A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)
Stars: ✭ 14,330 (+5870.83%)
Mutual labels:  tdd, bdd, test-framework
eat
Json based scenario testing tool(which can have test for functional and non-functional)
Stars: ✭ 41 (-82.92%)
Mutual labels:  test-framework, test-driven-development, testing-framework
Awesome Unit Testing Swift
A curated collection of awesome blog articles, books, talks, podcasts, tools/frameworks and examples.
Stars: ✭ 272 (+13.33%)
Mutual labels:  tdd, test-driven-development, testing-framework
Lightbdd
BDD framework allowing to create easy to read and maintain tests.
Stars: ✭ 195 (-18.75%)
Mutual labels:  tdd, bdd, test-framework
Nunit
NUnit 3 Framework
Stars: ✭ 2,131 (+787.92%)
Mutual labels:  tdd, test-framework, test-driven-development
Jgiven
Behavior-Driven Development in plain Java
Stars: ✭ 319 (+32.92%)
Mutual labels:  tdd, bdd, test-driven-development
Baretest
An extremely fast and simple JavaScript test runner.
Stars: ✭ 364 (+51.67%)
Mutual labels:  tdd, bdd, test-framework
Bash unit
bash unit testing enterprise edition framework for professionals
Stars: ✭ 419 (+74.58%)
Mutual labels:  tdd, test-framework, test-driven-development
List Of Testing Tools And Frameworks For .net
✅ List of Automated Testing (TDD/BDD/ATDD/SBE) Tools and Frameworks for .NET
Stars: ✭ 303 (+26.25%)
Mutual labels:  tdd, bdd, test-driven-development
Mocha
☕️ simple, flexible, fun javascript test framework for node.js & the browser
Stars: ✭ 20,986 (+8644.17%)
Mutual labels:  tdd, bdd, test-framework
Ut
UT: C++20 μ(micro)/Unit Testing Framework
Stars: ✭ 507 (+111.25%)
Mutual labels:  tdd, bdd, testing-framework
Should.js
BDD style assertions for node.js -- test framework agnostic
Stars: ✭ 1,908 (+695%)
Mutual labels:  tdd, bdd
Karma
Spectacular Test Runner for JavaScript
Stars: ✭ 11,591 (+4729.58%)
Mutual labels:  tdd, bdd
Flaskr Tdd
Flaskr: Intro to Flask, Test-Driven Development (TDD), and JavaScript
Stars: ✭ 2,103 (+776.25%)
Mutual labels:  tdd, test-driven-development
Gunit
GUnit - Google.Test/Google.Mock/Cucumber on steroids
Stars: ✭ 156 (-35%)
Mutual labels:  tdd, bdd
Spek
A specification framework for Kotlin
Stars: ✭ 2,143 (+792.92%)
Mutual labels:  tdd, bdd
Radish
Behavior Driven Development tooling for Python. The root from red to green.
Stars: ✭ 153 (-36.25%)
Mutual labels:  tdd, bdd

bandit

MIT License Contributors Watchers Stars Forks Commits per year Last commit Travis CI Status AppVeyor Status Codecov Badge Codacy Badge Coverity Scan Build Status Issues Pull Requests freenode

Human-friendly unit testing for C++11

Bandit is a framework for C++11 that wants to make working with unit tests a pleasant experience.

An example

This is a complete test application written in bandit:

#include <bandit/bandit.h>

using namespace snowhouse;
using namespace bandit;

// Tell bandit there are tests here.
go_bandit([]() {
  // We're describing how a fuzzbox works.
  describe("fuzzbox", []() {
    guitar_ptr guitar;
    fuzzbox_ptr fuzzbox;

    // Make sure each test has a fresh setup with
    // a guitar with a fuzzbox connected to it.
    before_each([&]() {
      guitar = guitar_ptr(new struct guitar());
      fuzzbox = fuzzbox_ptr(new struct fuzzbox());
      guitar->add_effect(fuzzbox.get());
    });

    it("starts in clean mode", [&]() {
      AssertThat(guitar->sound(), Equals(sounds::clean));
    });

    // Describe what happens when we turn on the fuzzbox.
    describe("in distorted mode", [&]() {
      // Turn on the fuzzbox.
      before_each([&]() {
        fuzzbox->flip();
      });

      it("sounds distorted", [&]() {
        AssertThat(guitar->sound(), Equals(sounds::distorted));
      });
    });
  });
});

int main(int argc, char* argv[]) {
  // Run the tests.
  return bandit::run(argc, argv);
}

Download

Clone the Git repository:

git clone --recursive https://github.com/banditcpp/bandit.git

or if you have already cloned the repository without --recursive, do

cd bandit
git submodule update --init --recursive

The Git repository contains several directories besides bandit itself, that is, the specifications (or tests) for bandit (in specs), the bandit website and documentation (in docs), and auxiliary tools for CMake (in cmake) and continuous integration (in util).

Installation

Bandit is header-only, so there is no need for additional compilation before you can start using it. (CMake is only necessary to compile the specs for bandit itself.)

If you want to use bandit inside your projects, add the parent directory of the bandit directory to your project's include directories and you are ready to go.

Note that you can remove all directories except the bandit directory. Also keep license and copyright information intact. You can also simply use the headers-only branch as a submodule:

git submodule add -b headers-only https://github.com/banditcpp/bandit bandit
git submodule update --init --recursive

Compilers

Bandit has been tested with the following compilers:

  • GCC ≥ 4.5
  • Clang ≥ 3.2
  • MSVC ≥ 2012

If you want to see if bandit works for your compiler, bandit is shipped with a cmake project for generating bandit's self tests. Let us know how it goes.

If your compiler does not support the C++11 features required by Bandit, we suggest that you take a look at Igloo, which is built on the same philosophy but works without C++11.

Online resources

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].