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

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

code::dive conference via YouTube Direct link

Intro

1 of 38

1 of 38

Intro

Class Central Classrooms beta

YouTube videos curated by Class Central.

Classroom Contents

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

Automatically move to the next video in the Classroom when playback concludes

  1. 1 Intro
  2. 2 Mix Tests and Production Code With Doctest - Implementing and Using the Fastest Modern C++ Testing Framework
  3. 3 About me
  4. 4 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
  5. 5 This presentation
  6. 6 Single header with 2 parts
  7. 7 A complete example
  8. 8 Example output
  9. 9 What makes doctest different
  10. 10 All this makes writing tests in the production code feasible!
  11. 11 Other most notable features
  12. 12 Unique anonymous variables
  13. 13 Auto registration
  14. 14 Test Suites
  15. 15 Lets talk about warnings
  16. 16 Silencing warnings in the header
  17. 17 Warnings in user code?
  18. 18 The preprocessor
  19. 19 Embedding a pragma in a macro
  20. 20 Silencing warnings in macros
  21. 21 Subcase macro expansion
  22. 22 The main() entry point
  23. 23 Removing everything testing- related from the binary
  24. 24 Expression decomposition
  25. 25 Translating exceptions
  26. 26 The Lippincott function
  27. 27 Major C++ issue - compile times
  28. 28 Compile times - header cost
  29. 29 Compile times - implementation cost
  30. 30 doctest 11 asserts
  31. 31 Runtime performance
  32. 32 Mixing tests and production code
  33. 33 Tests in header-only libraries
  34. 34 Tests in compiled libraries Many binaries (shared objects and executables) can share the same test runner - a single test case registry
  35. 35 Getting the most out of the framework
  36. 36 Where most of the effort went • Familiarizing myself with testing and other frameworks
  37. 37 History of doctest
  38. 38 description(const char*) • test suite const char

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.