Skip to content

dale-wilson/assertiv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Assertiv

Minimal C++ header-only unit test framework from OCI

Why Assertiv?

Assertiv is header-only, designed to be embedded within your own project, rather than having a separate project for your clients to download and build.

No downloads, no build issues, no worrying about runtime libraries, no bjam.

Features

  • Header-only - no library to build
  • Outputs file name, line number and failiure conditions
  • Summarizes count of total and failing test cases and assertions.

Usage

  • Add Assertiv to your project:

From your project root directory, add the submodule, passing the path to where you want it to reside:

git submodule add git@github.com:iamtheschmitzer/assertiv.git test/unit/assertiv
  • Include the header file in your test source:
#include "assertiv/assertiv.h"
  • Define test cases with the TEST macro:
TEST(TestAdditionOperator) {
  // Test code goes here
}
  • Withing test case, use ASSERT_* macros:
TEST(TestAdditionOperator) {
  // Test construction and addition of Num class
  ASSERT_EQ(17, Num(8) + Num(9));
  ASSERT_EQ(Num(17), Num(8) + Num(9));
}
  • There are no more excuses. Get testing.

About

Minimal C++ header-only unit test framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%