C++Now 2021 has ended
Back To Schedule
Thursday, May 6 • 1:30pm - 3:00pm
UT - C++20 Unit Testing Framework

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Testing in C++ is not easy, it often requires a lot of boilerplate code, macro usage and/or understanding of complicated testing frameworks.
But it doesn't have to be like that. C++20 will enable us to reinvent the way we write tests!

In this case study, we will address the difficulty of testing with C++ by implementing a new,
fully functional, macro-free testing framework [1] from scratch with modern C++20 features to make the following snippet compile and run:

01 import ut;
03 int main() {
04 "fib"_test = [] { // Running "fib"...
05 fib(7) == 12_i; // fib.cpp:5:FAILED [ 13 == 12 ]
06 }; // tests: 1 | 1 failed
07 } // asserts: 1 | 0 passed | 1 failed

At the end of this session, the audience will have a better understanding of C++20 features such as:

* Modules
* Concepts
* Source Location
* New additions to lambdas
* User-Defined Literals

Additionally, attendees will get familiar with an expressive way of testing with modern C++ based on UT - Unit Testing Framework [2].

Let's get ready to follow the Beyonce rule - 'If you liked it then you "should put a" test on it' and test all the things at C++Now 2021!

[1]: https://godbolt.org/z/a7Mses
[2]: https://github.com/boost-ext/ut

avatar for Kris Jusiak

Kris Jusiak

Quantlab Financial, LLC
Kris is a Software Architect passionate about programming and who has worked in different industries over the years including telecommunications, games and most recently finance for Quantlab Financial, LLC. He has an interest in modern C++ development with a focus on performance and... Read More →

Thursday May 6, 2021 1:30pm - 3:00pm MDT