Skip to content
A C++17 testing and benchmarking library.
C++ Meson
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.
examples
headers
sources
.gitattributes
.gitignore
LICENSE.txt
README.md
meson.build
meson_options.txt

README.md

accelerando

A C++17 testing and benchmarking library.

Released under the Apache License 2.0.

Documentation

Features

  • Powerful custom assertions
  • Parameterized benchmarks and tests
  • Templated benchmarks and tests
  • Exceptions and RTTI not required

Example

#include <accelerando.hpp>

ACCEL_TESTS

TEST(Arithmetic) {
    ASSERT_EQ(2 + 2, 4);
    ASSERT_EQ(2 * 2, 4);
}

ASSERTION(is_even, uint64_t integer) {
    if (integer % 2 == 0) {
        return PASS;
    } else {
        return FAIL << integer << " is not even";
    }
}

ASSERTION(is_odd, uint64_t integer) {
    if (integer % 2 != 0) {
        return PASS;
    } else {
        return FAIL << integer << " is not odd";
    }
}

TEST(Parity) {
    ASSERT(is_even, 2);
    ASSERT(is_odd, 3);
    ASSERT(is_even, 4);
    ASSERT(is_odd, 5);
}
You can’t perform that action at this time.