Skip to content
🍃 Mint is a minimal header-only C++ test runner.
C++ Shell CMake
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Setting up linting test with CircleCI Dec 9, 2019
docs Important note to docs regarding ensuring custom types/classes have =… Nov 18, 2019
examples I'm happy with all of these linting changes! Dec 9, 2019
include/mint
test Refactor appears to be working! Let's add writeTestFail()... Nov 10, 2019
.clang-format Added .clang-format and linting script, let's test this out on Mint now Dec 9, 2019
.gitignore Initial commit Nov 9, 2019
CMakeLists.txt Adding CMakeLists.txt for Mint Nov 10, 2019
LICENSE
README.md Updating README.md Dec 2, 2019
lint.sh Added .clang-format and linting script, let's test this out on Mint now Dec 9, 2019

README.md

Mint

mint-image

GitHub CircleCI Codacy Badge

Mint is a minimal header-only C++ test runner.

Installation

A CMakeLists.txt file has been added for simple linking with CMake. For more on this, check the examples/ directory.

Usage

Using Mint is intentionally simple. The basic flow of a test program using Mint:

  1. Initialize a Mint object.
  2. Call assertions.
  3. Return with end() to clean-up and return with status code.

Example:

#include <mint/mint.h>

int main() {

    //Declare and intialize Mint
    Mint m;

    //Title test
    m.title("Testing Integer Equality");

    //Assertions
    m.equal(10, 10, "integers of same value are equal");

    //Finish tests, and return exit code
    return m.end();
}

Documentation

Documentation can be found by checking the docs/ directory.

Expected output

Output for the above test:

============================
  Testing Integer Equality
============================
  ✓ integers of same value are equal

SUCCESS! All tests (1) passing with no tests failing. Returned with exit code "0".

A snippet from a seperate test:

======================
  Testing Assertions
======================
  ✓ number equality
  ✗ number inequality
    FAIL: Expected "4", found: "1"
  ✓ true
  ✗ false
    FAIL: false is false
  ✓ throws caught from throwing function
  ✗ throws not caught from non-throwing function
    FAIL: willNotThrow() failed to throw (function did not throw)

FAIL! 3 tests failing with 3 tests passing. Returned with exit code "1".

Contact

Questions? Comments? Suggestions?
Open an issue, make a pull request!

Or, you can email me at: luis@serebii.io

You can’t perform that action at this time.