Mix Tests and Production Code With Doctest...
summary
doctest is a single-header C++ test framework that actually ships a tiny interface and a separate implementation block so including it everywhere costs ~20 ms vs ~500 ms for Catch and you can remove all tests from release binaries with a compile-time flag. it auto-registers tests by initializing a global dummy that calls regTest, supports subcases and templated test cases, user-registered exception translators and lazy stringification, and its author reports 50,000 asserts compiling in under 10s in the fastest mode; CI covers ~300–400 builds.
AI-written summary · about
chapters (24)
- 0:00Introduction to Doctest
- 1:36Integration and Setup
- 3:04Basic Test Example
- 4:18Key Features and Benefits
- 5:55Assertions and Subcases
- 7:33Advanced Test Features
- 9:25Test Registration Details
- 11:05Test Case Registry & Suites
- 13:13Handling Warnings & Macros
- 15:52Preprocessor Techniques
- 17:21Subcase Implementation
- 19:37Production Code Integration
- 21:22Assertion Mechanisms
- 23:14Expression Decomposition
- 25:05Exception Translation
- 28:38Compile Time Benchmarks
- 31:02Assertion Performance
- 32:58Benchmark Results
- 35:16Runtime Performance
- 37:26Optimization Techniques
- 39:40Library Specific Considerations
- 41:43Development Challenges
- 43:40Roadmap and Future
- 45:26Q&A Session
related talks
01h 07mTestdriven C++ with Catch
58mTest Driven C++ with Catch
38mProperties Of Unit Tests in C++
01h 03mBack to Basics: Testing in C++
28mDeveloping With Doctests - Using Xdoctest As A Backend
01h 32mFuture of Testing With C++20
53mC++ Unit testing - the good, the bad & the ugly
59mC++ Unit testing - the good, the bad & the ugly
