Home > Article > Backend Development > How to Integrate Google C Testing Framework (gtest) into Visual Studio 2005?
Integrating Google C Testing Framework (gtest) into Visual Studio 2005
Setting up Google C Testing Framework (gtest) for use with Visual Studio 2005 can be a daunting task, but it can be accomplished with a step-by-step approach.
Obtaining and Building gtest
Creating and Configuring Your Test Project
In the project properties:
Testing the Setup
In the main() function of your test project, include necessary headers and add a simple test case:
#include "stdafx.h" #include <iostream> #include "gtest/gtest.h" TEST(sample_test_case, sample_test) { EXPECT_EQ(1, 1); } int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); RUN_ALL_TESTS(); std::getchar(); // keep console window open until Return keystroke }
If everything works correctly, the test results should be displayed in the console window.
The above is the detailed content of How to Integrate Google C Testing Framework (gtest) into Visual Studio 2005?. For more information, please follow other related articles on the PHP Chinese website!