2

Test Results

So far, we have a test library that can only have a single test. You’ll see what happens in this chapter when we try to add another test and you’ll see how to enhance the test library to support multiple tests. We’ll need to use an old and rarely used capability of C++ that actually comes from its early C roots to support multiple tests.

Once we get more than one test, we’ll need a way to view the results. This will let you tell at a glance whether everything passed or not. And finally, we’ll fix the result output so that it no longer assumes std::cout.

We’ll cover the following main topics in this chapter:

  • Reporting a single test result based on exceptions
  • Enhancing the test library to support multiple tests
  • Summarizing the ...

Get Test-Driven Development with C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.