"unit"_test: Implementing a Macro-free Unit Testing Framework from Scratch in C++20
summary
Claim: a working macro-free C++20 framework is implemented from scratch that makes the shown snippet compile and run. It uses C++20 features — modules concepts source_location plus new lambda and UDL tricks — to provide tests, suites, sections, BDD, matchers and a parallel runner as a single header single module delivery. Benchmarks show faster compile and run vs. common frameworks; results include cross‑compiler support (works on four compilers, MSVC 2019 with caveats) and published code on GitHub.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 2:03Outline of the talk
- 4:33Motivation
- 6:44Problems
- 9:10Goal
- 10:18Implementation
- 12:44Modules
- 15:56Test
- 20:07Test Implementation
- 24:46Operator Concept
- 25:51Implementation Overview
- 28:32Getting the correct return type
- 31:28Missing the file and line
- 32:53Passing the location into the error
- 35:21Expect
- 37:29Suite
- 41:11Filter
- 42:11Tags
- 46:34Printing
- 52:06Meta programming
- 55:13Questions
- 56:36Benchmarks
related talks
06mMacro-Free Testing With C++20
01h 32mFuture of Testing With C++20
01h 03mClean Test: a modern C++20 testing framework
01h 20mUnit Testing an Expression Template Library in C++20
59mC++ Unit testing - the good, the bad & the ugly
34mSwift Testing: A testing framework for modern Swift
01h 01mAdvanced Unit Testing in C & C++
01h 18mMocking Framworks considered, harmful?!
