Skip to content

synesissoftware/BDUT

Repository files navigation

BDUT

Brain-Dead Unit-Testing, for C and C++.

Table of Contents

Introduction

Brain-Dead Unit-Testing, is a very simple - simplistic, in fact - small, header-only, standalone library for C and C++. Its intent is to be bundled into other projects for which it is not desired to couple to a more sophisticated library.

Installation

CMake installation

Currently, CMake support is not yet provided.

Manual installation

Since BDUT is intended to be bundled into other open-source libraries, the simplest way to use it is to add a directory bdut under your project's include directory, into which you can then simply copy bdut.h.

Examples

BDUT is included simply into any C or C++ project by #includeing its header file, as in:

/* examples/c/example_1 */

#include <bdut/bdut.h>

int main()
{
  BDUT_ASSERT_EQ(1, 2);

  return 0;
}

The output of this will be along the lines of:

~/open-source/BDUT/examples/c/example_1/main.cpp:7:main: assertion failed: actual value of `2` not equal-to expected value `1`

or a in:

/* examples/cpp/example_1 */

#include <bdut/bdut.h>

#include <iostream>


int main(int argc, char* argv[])
{
    BDUT_ASSERT_STRING_CONTAINS("", "abcdefghijklmnopqrstuvwxyz");
    BDUT_ASSERT_STRING_CONTAINS("abc", "abcdefghijklmnopqrstuvwxyz");

    /* this one will fail */
    BDUT_ASSERT_STRING_CONTAINS("abd", "abcdefghijklmnopqrstuvwxyz");

    return 0;
}

The output of this will be along the lines of:

~/open-source/BDUT/examples/cpp/example_1/main.cpp:15:main: assertion failed: actual string 'abcdefghijklmnopqrstuvwxyz' does not contain search string 'abd'

Project Information

Where to get help

GitHub Page

Contribution guidelines

Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/BDUT.

Dependencies

BDUT has no dependencies.

Related projects

Projects in which BDUT is used for testing include:

License

BDUT is released under the 3-clause BSD license. See LICENSE for details.

About

Brain-Dead Unit-Testing, for C and C++

Resources

License

Stars

Watchers

Forks

Packages

No packages published