Introduction to Google Test and CMake

preview_player
Показать описание
A viewer on one of my recent Twitch streams made an excellent suggestion/request for a video showing how to get started with the Google Test framework, to develop unit tests as part of Test Driven Development.

I decided to throw in CMake as well and show how to start a new project using both, with a simple example that I hope anyone can follow along and do as well.

I hope you enjoy this video! If you have ideas/requests for similar videos, please let me know. I can't promise to produce them right away, but I'll definitely put them on the list for consideration.

Prerequisites for this example:

* Visual Studio Code (VSCode)

* C/C++ toolchain (examples: Visual Studio Community 2017, Xcode, Clang, gcc)

* C/C++ extension for VSCode

* CMake Tools extension for VSCode

* CMake (either installed separately or as part of CMake Tools for VSCode)

* git command-line tools (for cloning the googletest repository from github)
Рекомендации по теме
Комментарии
Автор

Awsome!! I learned so much in that half an hour, not only about cmake and gtest but also about VS code 👍

MaEtUgR
Автор

Best tutorial on Google Test I have found so far.

Heres a tip, when you give your project a name, a PROJECT_NAME variable will be set. So basically you can put project ("ProjectName") and then use ${PROJECT_NAME}. Similar but works.

DoggoYT
Автор

It's almost like you're a real coder who actually knows what they are doing. XD (Unlike every other google test tutorial I've found so far). Thank you!

timothywright
Автор

I'm a Java developer and this is similar approach that is see in the java software development. Thank you for the video, this is the best approach and the superb explanation.

DawidSwitonManiakowski
Автор

Pretty easy guide for learning how to test in C/C++. Thank you!

SaifUlIslam-dbnu
Автор

Thank you for spending time to make this tutorial !

florentgarnier
Автор

These tutorials are really helpful! Thank you so much.

ameynarkhede
Автор

Thank you ! It was really helpful.. It was exactly what I was looking for.

AvijitDas
Автор

Very nice tutorial. I really learned a lot :) I would really appreciate a indepth video(series) about TDD in C++. Could be something super simple like a todo app where you store todos inside a SQLite database. You could show us then how to use gtest for the specific unit tests, gmock to mock external dependencies and maybe also integration tests.

I think testing in C++ is super confusing compared to Rust or Python. Such a series would help a lot :)

XxGabberlordxX
Автор

Ok, that was pretty awesome and extremely useful.

rabunbike
Автор

Wonderful video, It helps me a lot, thank you very much

deepknowledge
Автор

I really dont know why he has a low number of viewers. He is AWESOME explaining

guicolho
Автор

Amazing tutorial. I learned a lot. Keep it up! I have a question. What if we have multiple submodules in our project? Do we need to create separate google test folder for each one of them? How do we run all tests from the main one?

GeekyMino
Автор

Thanks for the video, it was really helpful and straightforward !!

beniamintucu
Автор

Thanks for the intro. Very useful. I hear some echos of the Hitchhiker's guide in the code.

heyquantboy
Автор

Incredible video. You're a master!

guilhermedantas
Автор

In a sea of hour-long YouTube videos with meaningless slides and useless details, you (1) actually program, (2) show how to set up a test suite, and (3) take half the time. I'm convinced you know Kitware's packages better than the creators. It's mind-blowing how a company of 25+ PhD's cannot teach anything. They must have been born from the revolving door of university academics who make more academics that don't know how to work in the real world. Thank you for this!! Great video!!

adamhendry
Автор

Thank you. I spent hours trying to get all of the pieces to play nicely together. As a noob to C++ its project structure and the hoops are very foreign compared to, say, go, java or python

eldarmusayev
Автор

Hi, I have stopped on the building part. I get getting this error: "[build] LINK : fatal error LNK1104: cannot open file "Example.lib"". I have checked my CMakeLists.txt failed, and they are 1:1 with CMakes on the videos

SquezzBill
Автор

Awsome!! Very informative tutorial! Thank you so much.

saintofallsaints