filmov
tv
ESP8266 Unit Testing - Part 2/2: GoogleTest and GoogleMock - Day 33 of #100DaysOfCode in IoT

Показать описание
Part 2 of unit testing with ESP8266. Today I focused on GoogleTest, created few example tests testing example code, and then I moved on to testing my Core library functionalities with the use of mocks with GoogleMock...
You can find the code from this episode here:
Add and Multiply function tests:
UniUno tests:
GoogleTest Documentation:
Social Media:
Software used in the video:
1. Visual Studio Code IDE:
2. C/C++ VSCode extension:
3. Clang-Format VSCode extension:
4. PlatformIO VSCode extension:
Thanks for watching and see you tomorrow!
00:00:00 Intro
00:00:14 Where I finished yesterday
00:01:55 Clean up
00:03:25 How to configure tests to run (reminder)
00:05:10 Installing and configuring googletest
00:07:28 Initializing googletest
00:08:40 Documentation and first unit test
00:13:05 Running the test
00:15:45 Multiple test files and test files next to production code vs test files in the test folder
00:21:42 Unit testing in an embedded environment
00:28:08 Running embedded tests
00:29:25 Issue with googletest support on PlatformIO and the fix
00:32:15 Trying to break the test by breaking production code
00:34:16 Introduction to googlemock and pasting in Core lib files
00:35:50 My goal with IoT framework as for the prototyping tool
00:36:58 How to mock with googlemock on real-world example with EventDispatcher
00:55:40 Matchers explanation
00:58:08 Running the test with mock and fixing the issue
00:59:55 Breaking code to check if tests fail
01:01:07 Expect mocks to be called in sequence
01:04:24 Another test for EventDispatcher::once method
01:07:20 How I implemented unit tests for Timer class
01:13:36 Plan for tomorrow
You can find the code from this episode here:
Add and Multiply function tests:
UniUno tests:
GoogleTest Documentation:
Social Media:
Software used in the video:
1. Visual Studio Code IDE:
2. C/C++ VSCode extension:
3. Clang-Format VSCode extension:
4. PlatformIO VSCode extension:
Thanks for watching and see you tomorrow!
00:00:00 Intro
00:00:14 Where I finished yesterday
00:01:55 Clean up
00:03:25 How to configure tests to run (reminder)
00:05:10 Installing and configuring googletest
00:07:28 Initializing googletest
00:08:40 Documentation and first unit test
00:13:05 Running the test
00:15:45 Multiple test files and test files next to production code vs test files in the test folder
00:21:42 Unit testing in an embedded environment
00:28:08 Running embedded tests
00:29:25 Issue with googletest support on PlatformIO and the fix
00:32:15 Trying to break the test by breaking production code
00:34:16 Introduction to googlemock and pasting in Core lib files
00:35:50 My goal with IoT framework as for the prototyping tool
00:36:58 How to mock with googlemock on real-world example with EventDispatcher
00:55:40 Matchers explanation
00:58:08 Running the test with mock and fixing the issue
00:59:55 Breaking code to check if tests fail
01:01:07 Expect mocks to be called in sequence
01:04:24 Another test for EventDispatcher::once method
01:07:20 How I implemented unit tests for Timer class
01:13:36 Plan for tomorrow
Комментарии