Google Test - gtest setup for unit testing in C++ on windows 10 Using Visual Studio

preview_player
Показать описание
If you're a C++ Programmer and want to write unit test for the C++ code, it's highly likely that you'll end up using Google Test. Now installing good test is an additional activity which may take some extra effort and time. However, there is a shortcut available if you're using Visual Studio on windows platform.

If you're using visual studio for your C++ development (whether you're using C++11, C++14, or C++17 / C++20 Specification), you can install C++ gtest framework for writing unit test code in for your C++ code. You can write gtest and create gmock with worrying about adding libraries or source path.

In this video, I'm talking about how you can install and make use of this shortcut. Remember this is only applicable if you intend to use Google C++ gtest / gmock framework for writing unit test code in C++. You can also use for Test Driven Development in C++

Hope this video helps you in writing unit test in C++

#googletest #gtest #gmock #unittesting #C++11 #C++14 #C++17 #C++20 #tdd #programming #softwaredevelopment #testing

-----------------------------------------------------------------------------------------------------------------------

Hi I am Daksh Deepak K Gupta (nickname & Preferred:- Daksh). I am a software developer and creating software since 1999. During the course of my career I've worked as a software Developer, Architect as well as Chief Technology Office.

I started this channel to share my knowledge and understanding of Software Development which I believe will help people in writing better and quality code. This channel covers broad set of Computer Science and Software Engineering topics including but not limited to Programming.

Here is the kind of contents you can expect from my YouTube Channel i.e. both existing and upcoming

1. Data Structures and Big O Notations, Algorithms and Algorithm complexity
2. C++ programming (latest specifications C++17 and C++20 ) tutorial. Learn How to create high performance system applications using one of the oldest and still relevant programming Language.
3. Learn modern Python Programming (Python 3.x) and understand how python is used for Data Science, Data Analytics and Machine Learning.
4. Learn Python libraries like NumPy, Scipy, Scikit-learn, Pandas and more
5. Learn JAVA, one of the widely used and most versatile Programming Language. Explore Java Libraries like Spring and SpringBoot
6. Learn JavaScript and understand how JavaScript can be used for Functional Programming as well as for Reactive Functional Programming. Explore JavaScript libraries like ReactJs, BaeconJS, Mocha and ChaiJS
7. Learn Golang, an extremely fast, microservices ready programming language with goroutines
8. Systems Programming including details about writing memory and multi Core CPU efficient codes.
9. Understand Machine learning and Neural Networks and create prediction engines. Lean Languages, tool, and libraries for the same
10. Understand and explore Neural Network with PyTorch, Keras, OpenCV and TensorFlow
11. How to Create cross platform mobile apps
12. Explore SQL and NoSQL databases like PostgreSQL, MongoDB, Redis, Apache Spark, neo4j and Apache Cassandra
6. Learn source with git, which is one of the most widely used decentralized source control. Learn more about branches merge and commit
7. Learn about persistent nosql databases like mongodb using my mongodb tutorial as well as in memory nosql databases like redis using my redis tutorial. you'll also learn about using redis nodejs
8. Understand the concept of handling large data e.g. Big Data
9. Learn about graph theory and graph database

Рекомендации по теме
Комментарии
Автор

Thank you! Very simple, short infomation, which really helped me with google tests in Visual Studio.

unextazy
Автор

Can we create library application? i.e Configuration type DLL instead of .exe for test application. I tried this, I changed Configuration type to DLL but test discovery is not happening in VS2022. Is there any way to make it happen?

vikramgondane
Автор

"Really Helpful against all the odds of basics"Thnks

alanthomas
Автор

Hi, that is very useful information.
Can you tell me how to add and test source file ?

SiddanagowdaBiradar
Автор

Works great. Nice tutorial. Thanks a lot!

eyalgerber
Автор

Been a staunch follower of your video, well crafted. I have grounded when I was trying with your gmock on db., Been trying to install gmockn for the last two days on VC 2022 but in vain, Seems to be a nagging problem in the developers guild too. Would really appreciate if you can give us your helping hand. Thank you in advance

sathyababu
Автор

Thank you sir for this video. I wanna request you for a GMock test set up tutorial using Visual Studio 2019.
Thank you in Advance!

surajnikam
Автор

How do I select a particular file to test?

mdsufiyan
Автор

How do you include the gmock library? My Visual Studio 2019 is saying the file cannot be found.

yospa
Автор

Hi sir, can you explain the error
Pure virtual method is called
Terminate without an active exception mean ?

raghuvadla
Автор

J'aime bien le petit ficu derrière toi

rainix
Автор

Hi,
debug console is not coming after running

rajhiremath
Автор

Thank you so much sir, Is there any way to make this test suite in executable binary and run on Linux machine ?

akshaynanavare