Inspiration

Some Unit Testers currently in C++ are overcomplicated, have a lot of tester methods I'd never get around to using, and have steep learning curves that just makes you want to throw your keyboard at the wall. We wanted to try to create something simple and straight to the point, and thought it would be fun to create our own library to be used in our own projects. In general, the frustration and Joy of learning made the foundation for this idea and project.

What it does

The C++ Unit Tester is a static library (libtester.a) for C++17 with zero external dependencies. Drop it into any project, link it, #include <tester/Tests.hpp>, and you're testing. No main() required — test registration is automatic.

Assert Vs. Expect

  • ASSERT_* — stops the current test function immediately on failure, like an early exit.
  • EXPECT_* — records the failure but keeps running, collecting every failure in one pass.

How we built it

Test++ is a compiled C++17 static library. Test Registration** Assert vs. Expect Engine** Templated Assertion Dispatch**

Challenges we ran into

Learning C++ syntax and type traits. Leveraging quick development with extendability. Understanding the compilation and linking process, and how headers impact that.

Accomplishments that we're proud of

Still being able to pull it off with lots of features right out of the box

What we learned

Makefile, C++, implementing design patterns in C++

What's next for Test++

C++17 to C++20

Built With

Share this project:

Updates