!
TestNG++(
Installation)&)Configuration)Guide)For)MSVC)Users)
Arthur)Yuan)
ABSTRACT(
This)document)guides)you)how)to) configure,)install ) and)use)TestNG++ ) on)Wind ows,)
along)w ith)Microsoft)Visual)Studio.))
(
1.#CONFIGU RATION,#BUILDING#&#INSTALLATION# 3!
1.1#PREPARATION# 3!
1.2#CONFIGURA TION# 3!
1.3#BUILDING#&#INSTALLATION# 5!
2.#USI NG#TESTNG++# 8!
2.1#CREATE#PR OJECTS# 8!
2.2#SET#DEPENDENCIES# 9!
2.3#SETUP#TEST#GENERATOR# 10!
2.4#CREATE#SOURCE#FILE# 12!
2.5#SETUP#INCL UDE#PATH#&#LINKING#LIBRARIES# 13!
2.6#CREATE#&#WR ITING#TEST# 15!
2.7#SETUP#THE#DEBUGGING# COMMAND#LINE# 15!
2.8#BUILDING#&#RUNNING#TEST# 16!
2.9#GET#THE#EXAMPLE# 17!
(
1.(C onfigura tion,(Building(&(In stallation(
1.1(Preparation(
Firstly,!go!to!the!download!page!of!TestNG++!web!site!
(http://code.google.com/p/test‐ng‐pp),!choose!a!certain!version!of!source!
archive!and!download!it.!Alternatively,!you!can!check!out!the!latest!source!code!
directly!from!SVN!repository!(http://test‐ng‐pp.google.com/svn/truck).!
However,!it!is!usually!not!as!stable!as!the!formal!released!version.!!
TestNG++!uses!cmake!(http://www.cmake.org)!as!the!building!system.!Besides,!
the!Test%Generator!of!TestNG++!is!written!in!python.!Therefore,!before!you!are!
able!to!build!TestNG++,!you!need!to!make!sure!you!have!cmake!and!python!
installed!on!your!system.!
If!you!are!going!to!use!TestNG++!with!Microsoft#Visual#Studio,!you!also!need!to!
have!it!installed!on!your!system.
After!all!these!get!ready,!uncompress!the!source!code!tar!ball!to!somewhere,!
C:\arthur,!for!instance.!!Then!you!get!C:\arthur\testngpp21.0.!!Afterwards,!
create!a!new!folder!in!which!all!cmake!generated!files!&!build!outputs!will!be!
placed.!!In!this!example,!the!folder!we!create!is!C:\arthur\testngpp21.0\build.!
1.2(Configuration(
Now,!launch!the!cmakeYgui
1
.!!Set!the!source!code!path!in!“Where%is%the%source%
code”,!and!the!build!path!in!“Where%to%build%the%binaries”.!
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1
!You!can!also!choose!to!use!command!line!of!cmake,!here!we!use!cmakeYgui!for!
the!sake!of!demonstration.!
Then,!click!the!button!“Configure”,!you!will!see!a!pop‐up!window!like!this:!
!
Choose!a!generator!according!to!your!Visual#Studio!version,!and!select!“Use%
default%native%compilers”,!and!then!click!the!button!“Finish”,!which!will!start!
the!configuration!process.!
After!the!configuration!finishes!successfully,!modify!the!value!of!the!variable!
“CMAKE_INSTALL_PREFIX”!to!the!path!where!you!are!going!to!install!TestNG++.!
On!Windows,!its!default!value!is!C:\Program%Files\testngpp.!
!
After!setting!the!installation!path,!click!the!“Configure”!button!again,!then!you’ll!
get:!
!
Click!the!“Generate”!button!to!generate!the!Visual#Studio!project!files.!
1.3(Building(&(Installation(
Now,!close!the!“cmakeYgui”!window,!open!the!folder!c:\arthur\testngppY
1.0\build.!Here!you!can!see!the!solution!and!project!files,!as!well!as!others.!
!
Double!click!the!solution!file!“testngpp.sln”!to!open!it!in!Visual#Studio.!
In!Visual!Studio,!press!F7!to!build!the!solution.!After!TestNG++!is!built!
successfully,!right!click!the!project!“INSTALL”!and!select!“build”!to!install!