Game Development Community

Simple UnitTest++ integration with Torque

by Matthew Jessick · 05/22/2008 (2:14 pm) · 0 comments

Download Code File

FILES:
ReadMe_UnitTest++.txt - this file

TorqueUnitTest++.cpp - Torque integration file. Provides ConsoleFunction to run all tests or just a particular set

(suite) of tests.

TestReporterTorqueConsole.h, .cpp Provide a write-to-Torque Console subclass of the UnitTest++ "Test Reporter" object.
(Writes test report including failures to the console.)


REFERENCES:
Download UnitTest++ unittest-cpp.sourceforge.net/
UnitTest++ Tutorial: unittest-cpp.sourceforge.net/money_tutorial/

Test Driven Development: en.wikipedia.org/wiki/Test_driven_development
Unit Testing: en.wikipedia.org/wiki/Unit_testing
List of unit testing frameworks: en.wikipedia.org/wiki/List_of_unit_testing_frameworks


INSTALLATION:
Download and unpack UnitTest++. (See UL above). I chose to put UnitTest++'s src folder heirarchy into engine/UnitTest++. (If you put it elsewhere, edit the include paths in the source)
Include the subfolder matching your platform (Posix or Win32)
Add the integration files from this resource into engine/UnitTest++

Add all these files into your Torque code project and recompile.
TorqueUnitTest++.cpp includes two example "TEST" macro methods, one sucess and one test in a test suite that fails.
See the UnitTest++ documentation and various online examples for ways to make UnitTest++ most useful.