google c++ testing framework dr. frank xu gannon university

Post on 29-Jan-2016

217 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Google C++ Testing Framework

Dr. Frank XuGannon University

OverviewDownloadInstallationCompilationTest a demo

Download

Installation

Assume we are using MSVSClick msvs

Compilation

After compilation, you will see gtestd.lib

DemoWin32 Console Application

Important GTEST_ROOT

C:\Users\Frank\Desktop\svnrepository\MyDoc\public_html\teaching\shared\software\gtest-1.5.0

Make sure you have GTEST_ROOT/include in the header search path so that the compiler can find <gtest/gtest.h> when compiling your test. ◦ C:\Users\Frank\Desktop\svnrepository\MyDoc\

public_html\teaching\shared\software\gtest-1.5.0\include

Set up your test project to link with the Google Test library (for example, in Visual Studio, this is done by adding a dependency on gtest.vcproj).◦ C:\Users\Frank\Desktop\svnrepository\MyDoc\

public_html\teaching\shared\software\gtest-1.5.0\msvc\gtest\Debug\gtestd.lib

Testing

Greatest common divisor (gcd)

Generated Executable file

Execute Tests

Conclusion

[TestCaseName, TestName]Confusing:

◦[TestSuiteName, TestPurpose]◦{

test case 1 Test case 2

◦}

top related