Setting up Google Test
|Top Previous Next|
Download and install gtest:
Isolator++ Professional also installs the Google Test Framework (x64) static library and header files.
Setting up the makefile to run Google Test tests.
The installed gtest files are located in /usr/share/typemock/Examples/Common/gtest_files.
GTEST_FILES_DIR = /usr/share/typemock/Examples/Common/gtest_files # Using the installed gtest
GTEST_INCDIR = $(GTEST_FILES_DIR)
INC_FLAGS += -I$(GTEST_INCDIR)
GTEST_LIBDIR = $(GTEST_FILES_DIR)/lib64
LIBS += -L $(GTEST_LIBDIR) -lgtest -lgtest_main
Write the _tmain function to run the tests (as in ). With Google Test it looks like this:
Write tests using your test framework, in a separate cpp file.
You can write your first test with Isolator++ Professional in a separate class, deriving from the Test class:
class MyTestSuite : public ::testing::Test
Compile and run the console application to run the tests.
In the terminal you'll see which tests passed and which didn't.
Copyright Typemock Ltd. 2009-2023. All Rights Reserved.