Table of Contents
Lecture Videos
On May 13th, 2022 Prof Goeders gave a lecture/tutorial on using Github CI and Unit Testing with GoogleTest and Pytest. The first video embedded below is the most recent video explaining these tools.
On May 17, 2021 we had a Pytest Tutorial by Prof Goeders and a GoogleTest tutorial by Prof Mangelson. The videos are embedded below
Unit Testing Tutorial 2022
Pytest-for Python
Timestamps
0:00 Introduction to Pytest
5:29 Testing Python exceptions
8:30 Testing Python classes
11:50 fixtures
14:21 Parameterized test functions
16:19 doctest
Here is the link to the tutorial used in the video:
- Testing Python Applications with Pytest - https://semaphoreci.com/community/tutorials/testing-python-applications-with-pytest
GoogleTest-for C/C++
There are many different methods that can be used to perform unittesting in C++ and C.
Some of the most frequently used frameworks include:
- Catch - https://github.com/catchorg/Catch2
- Boost.Test - https://www.boost.org/doc/libs/1_75_0/libs/test/doc/html/index.html
- Google Test - https://github.com/google/googletest
Each library/framework supports different functionality and comes with its own trade offs.
In this module, we will use Google Test to provide a short example.
Timestamps
0:00 Introduction to GoogleTest
2:50 Macros
6:19 Implementing with CMake
9:24 Running tests and generating output
13:39 Test fixtures
15:30 Death tests
19:37 Mocking
TODO:
- What should this contain?