YoVDO

Mix Tests and Production Code With Doctest - Implementing and Using the Fastest Modern C++ Testing Framework

Offered By: code::dive conference via YouTube

Tags

Code::Dive Courses C++ Courses Software Testing Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the fastest modern C++ testing framework in this code::dive conference talk. Learn how to mix tests and production code using doctest, a lightweight single-header testing framework inspired by compiled languages like D, Rust, and Nim. Discover the framework's unique features, including anonymous variables, auto registration, and test suites. Delve into practical aspects such as silencing warnings, handling the preprocessor, and managing compile times. Gain insights on expression decomposition, exception translation, and runtime performance. Understand how to effectively use doctest in header-only libraries, compiled libraries, and multiple binaries. Follow the speaker's journey in developing this powerful testing tool and learn how to maximize its potential in your C++ projects.

Syllabus

Intro
Mix Tests and Production Code With Doctest - Implementing and Using the Fastest Modern C++ Testing Framework
About me
The lightest feature-rich C++ single-header testing framework Inspired by the ability of compiled languages such as D/Rust Nim to write tests directly in the production code
This presentation
Single header with 2 parts
A complete example
Example output
What makes doctest different
All this makes writing tests in the production code feasible!
Other most notable features
Unique anonymous variables
Auto registration
Test Suites
Lets talk about warnings
Silencing warnings in the header
Warnings in user code?
The preprocessor
Embedding a pragma in a macro
Silencing warnings in macros
Subcase macro expansion
The main() entry point
Removing everything testing- related from the binary
Expression decomposition
Translating exceptions
The Lippincott function
Major C++ issue - compile times
Compile times - header cost
Compile times - implementation cost
doctest 11 asserts
Runtime performance
Mixing tests and production code
Tests in header-only libraries
Tests in compiled libraries Many binaries (shared objects and executables) can share the same test runner - a single test case registry
Getting the most out of the framework
Where most of the effort went • Familiarizing myself with testing and other frameworks
History of doctest
description(const char*) • test suite const char


Taught by

code::dive conference

Related Courses

Computer Graphics
University of California, San Diego via edX
Intro to Parallel Programming
Nvidia via Udacity
Initiation à la programmation (en C++)
École Polytechnique Fédérale de Lausanne via Coursera
C++ For C Programmers, Part A
University of California, Santa Cruz via Coursera
Introduction à la programmation orientée objet (en C++)
École Polytechnique Fédérale de Lausanne via Coursera