All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions
Qtilities::Testing::TestFrontend Class Reference

The test front-end for unit tests implementing Qtilities::Testing::Interfaces::ITestable. More...

#include <TestFrontend.h>

List of all members.

Public Member Functions

void addTest (ITestable *test, QtilitiesCategory category=QtilitiesCategory())
 Adds a test to the list of tests.

Detailed Description

The test front-end for unit tests implementing Qtilities::Testing::Interfaces::ITestable.

The Qtilities::Testing::TestFrontend class allows you to run any tests implementing Qtilities::Testing::Interfaces::ITestable.

To construct a testing front-end is easy, for example:

TestFrontend testFrontend(argc,argv);
// ---------------------------------------------
// Create and register the tests that we want to use:
// ---------------------------------------------
#ifdef QTILITIES_TESTING
TestVersionNumber* testVersionNumber = new TestVersionNumber;
testFrontend.addTest(testVersionNumber,QtilitiesCategory("Qtilities::Core","::"));
TestSubjectIterator* testSubjectIterator = new TestSubjectIterator;
testFrontend.addTest(testSubjectIterator,QtilitiesCategory("Qtilities::Core","::"));
TestTreeIterator* testTreeIterator = new TestTreeIterator;
testFrontend.addTest(testTreeIterator,QtilitiesCategory("Qtilities::Core","::"));
TestObserver* testObserver = new TestObserver;
testFrontend.addTest(testObserver,QtilitiesCategory("Qtilities::Core","::"));
TestObserverRelationalTable* testObserverRelationalTable = new TestObserverRelationalTable;
testFrontend.addTest(testObserverRelationalTable,QtilitiesCategory("Qtilities::Core","::"));
TestExporting* testExporting = new TestExporting;
testFrontend.addTest(testExporting,QtilitiesCategory("Qtilities::General","::"));
BenchmarkTests* benchmarkTests = new BenchmarkTests;
testFrontend.addTest(benchmarkTests,QtilitiesCategory("Qtilities::Benchmarking","::"));
#endif
// ---------------------------------------------
// Show the testing frontend:
// ---------------------------------------------
testFrontend.show();

The resulting test front-end looks like this:

class_testfrontend_screenshot.jpg
Test Frontend With Some Tests

This class was added in Qtilities v1.0.



Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé