Unit Testing an Expression Template Library in C++20
summary
An expression-template parser-combinator called token parser-combinator targets C++20 and parses spans of any value type; a full JSON parser is implemented and works. Unit tests run both at compile-time and runtime using GoogleTest, Boost.Test, Catch2, doctest, Snitch and UT, plus a custom macro-based framework. Surprise: Snitch and UT capture compile-time verdicts and report them at runtime instead of always failing the build. Upcoming C++26 features (user-generated static-assert messages) make compile-time + runtime checks and prettier diagnostics practical.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 4:52Goals of compile-time testing
- 5:14Library demo: Token parser
- 19:19Recursive JSON parser
- 23:38Testing frameworks overview
- 35:17Runtime testing with frameworks
- 40:13Compile-time testing with frameworks
- 56:24Custom testing framework
- 1:05:54C++23 and C++26 features
- 1:14:03Q&A
related talks
01h 29mTesting Everything in Constexpr
01h 01m"unit"_test: Implementing a Macro-free Unit Testing Framework from Scratch in C++20
01h 32mFuture of Testing With C++20
01h 06mExpression Templates - Past, Present, Future
01h 03mClean Test: a modern C++20 testing framework
01h 02mBack to Basics: Unit Tests
01h 18mTesting C++ Templates: Investigating Tests for C++ Templates using Adversarial Methods
01h 27mC++20 Templates - the Next Level: Concepts and More
