CTestController Class Reference

class CTestController : public CBase

Comments : Manages the whole test procedure.

Inherits from

Constructor & Destructor Documentation

CTestController(CActiveScheduler *, RTest *)

CTestController(CActiveScheduler *aScheduler,
RTest *aRTest = NULL
)[private]

Parameters

CActiveScheduler * aScheduler
RTest * aRTest = NULL

~CTestController()

IMPORT_C~CTestController()[virtual]
Intended Usage : Standardized virtual destruction method
Since
7.0

Member Functions Documentation

Cancel()

IMPORT_C voidCancel()
Intended Usage : Cancels any outstanding tests.
Since
7.0
Pre-condition
This object has been created and the asynchronous version of Start has been called.
Post-condition
Any outstanding tests have been cancelled.

ConstructL(TLoggingInfo *, ComponentTesterInitialiserLC)

voidConstructL(TLoggingInfo *aLogInfo,
ComponentTesterInitialiserLCaEntryPoint
)[private]
Intended Usage : Completes the safe construction of the CTestController object
leave
KErrNoMemory.
Since
7.0
Pre-condition
First phase of construction is complete
Post-condition
Object is fully constructed

Parameters

TLoggingInfo * aLogInfoThe logging configuration information
ComponentTesterInitialiserLC aEntryPointThe global function used to create the derived CComponentTester object.

DataLogger()

IMPORT_C CDataLogger &DataLogger()[static]
Intended Usage : Returns a reference to the file logging functionality for use by the user interface component.
Since
7.0
Pre-condition
The CTestController has been created so that the data logger exists
Post-condition
Unspecified

FindComponents()

IMPORT_C const RPointerArray< CComponentInfo > &FindComponents()const
Intended Usage : Returns an array of the components available for testing Error Condition :
Since
7.0
Pre-condition
The object is fully constructed
Post-condition
Returns an array of the available components which can be used to select which test to run.

InitialiseComponentTesterL(ComponentTesterInitialiserLC)

voidInitialiseComponentTesterL(ComponentTesterInitialiserLCaEntryPointLC)[private]
leave
KErrNoMemory. Intended Usage : Called during construction to find all test modules Error Condition :
Since
7.0
Pre-condition
None
Post-condition
A list of all tests is available

Parameters

ComponentTesterInitialiserLC aEntryPointLCThe global function used to create the derived CComponentTester object.

NewL(CActiveScheduler *, ComponentTesterInitialiserLC, RTest *, TLoggingInfo *)

IMPORT_C CTestController *NewL(CActiveScheduler *aScheduler,
ComponentTesterInitialiserLCaEntryPoint,
RTest *aRTest = NULL,
TLoggingInfo *aLogInfo = NULL
)[static]
Intended Usage : Standardized safe construction which leaves nothing on the cleanup stack.
leave
KErrNoMemory.
Since
7.0
Pre-condition
None
Post-condition
Nothing is on the CleanupStack

Parameters

CActiveScheduler * aSchedulerThe active scheduler to use, pass NULL if no scheduler exists
ComponentTesterInitialiserLC aEntryPointThe global function used to create the derived CComponentTester object.
RTest * aRTest = NULLOptional RTest object to use in check unit test results
TLoggingInfo * aLogInfo = NULLThe logging info to use, defaults to NULL

NewLC(CActiveScheduler *, ComponentTesterInitialiserLC, RTest *, TLoggingInfo *)

IMPORT_C CTestController *NewLC(CActiveScheduler *aScheduler,
ComponentTesterInitialiserLCaEntryPoint,
RTest *aRTest = NULL,
TLoggingInfo *aLogInfo = NULL
)[static]
Intended Usage : Standardized safe construction which leaves CTestController* on the cleanup stack.
leave
KErrNoMemory.
Since
7.0
Pre-condition
None
Post-condition
CTestController is on the CleanupStack

Parameters

CActiveScheduler * aSchedulerThe active scheduler, if one exists, otherwise NULL
ComponentTesterInitialiserLC aEntryPointThe global function used to create the derived CComponentTester object.
RTest * aRTest = NULLOptional RTest object to use in check unit test results
TLoggingInfo * aLogInfo = NULLThe logging configuration information

Start()

IMPORT_C voidStart()
Intended Usage : Starts the testbed and runs all tests on all components. This function runs synchronously and does not return until all tests are complete.
Since
7.0
Pre-condition
This object is constructed
Post-condition
Starts the active scheduler and therefore doesn't complete until the active scheduler is stopped.

Start(RPointerArray< TTestInfo > *)

IMPORT_C voidStart(RPointerArray< TTestInfo > *aTests)
Intended Usage : Starts the specified tests.This function runs synchronously and does not return until all tests are complete.
Since
7.0
Pre-condition
This object is constructed
Post-condition
Starts the active scheduler and therefore doesn't complete until the active scheduler is stopped.

Parameters

RPointerArray< TTestInfo > * aTestsThe list of tests to be run.

Start(TRequestStatus *)

IMPORT_C voidStart(TRequestStatus *aStatus)
Intended Usage : Starts the testbed and runs all tests on all components. This function runs asynchronously and completes aStatus when all tests are complete.
Since
7.0
Pre-condition
This object is constructed
Post-condition
An asynchronous request is issued to run all tests.

Parameters

TRequestStatus * aStatusStatus word for the calling function. Is completed when all tests are complete.

Start(TRequestStatus *, RPointerArray< TTestInfo > *)

IMPORT_C voidStart(TRequestStatus *aStatus,
RPointerArray< TTestInfo > *aTests
)
Intended Usage : Starts the specified tests. If the default for aTest is used then all tests are run on all components. This function runs asynchronously and completes aStatus when all tests are complete.
Since
7.0
Pre-condition
This object is constructed.
Post-condition
An asynchronous request is issued to run the specified tests.

Parameters

TRequestStatus * aStatusStatus word for the calling function. Is completed when all tests are complete.
RPointerArray< TTestInfo > * aTestsThe list of tests to be run.

TestsComplete()

voidTestsComplete()[private]
Intended Usage : Called by the CTestManager to indicate that all tests are complete. Either stops the active scheduler if in synchronous mode or completes the client if in async mode.
Since
7.0
Pre-condition
This object is constructed
Post-condition
Appropriate action is taken to complete the tests.

Member Data Documentation

TRequestStatus * iClientStatus

TRequestStatus *iClientStatus[private]

The status word of the client (if tests were run asynchronously). Will be completed when all tests have finished running.

CDataLogger * iDataLogger

CDataLogger *iDataLogger[private]

Provides the file logging capability

TBool iOwnScheduler

TBool iOwnScheduler[private]

Flag indicating if we own the active scheduler in iScheduler

RTest * iRTest

RTest *iRTest[private]

Optional reference to the RTest object used in the EXE test harness code which kicked off this test framework

CActiveScheduler * iScheduler

CActiveScheduler *iScheduler[private]

Placeholder for an active scheduler if one is passed in on creation

RPointerArray< CComponentInfo > iTestList

RPointerArray< CComponentInfo >iTestList[private]

A list of the available tests

CTestManager * iTestManager

CTestManager *iTestManager[private]

Starts the tests and stops the active scheduler when finished