RTestEngine Class Reference

class RTestEngine : public RSubSessionBase

Inherits from

Public Member Functions
IMPORT_C TInt AddConfigFile (const TName &, const TFileName &)
IMPORT_C TInt AddTestCaseResultToTestReport (const TTestInfo &, const TFullTestResult &, const TInt )
IMPORT_C TInt AddTestModule (const TName &, const TFileName &)
IMPORT_C TInt CancelAsyncRequest ( TInt )
IMPORT_C void Close ()
IMPORT_C void EnumerateTestCases ( TCaseCount &, TRequestStatus &)
IMPORT_C void ErrorNotification ( TErrorNotificationPckg &, TRequestStatus &)
IMPORT_C void Event ( TEventIfPckg &, TRequestStatus &)
IMPORT_C TInt GetTestCases ( CFixedFlatArray < TTestInfo > &)
IMPORT_C TInt Open ( RTestEngineServer &, const TFileName &)
IMPORT_C TInt OpenLoggerSession ( RTestEngineServer &, TLoggerSettings &)
IMPORT_C TInt RemoveConfigFile (const TName &, const TFileName &)
IMPORT_C TInt RemoveTestModule (const TName &)
IMPORT_C TInt SetAttribute ( TAttribute , const TDesC &)
Inherited Functions
RSubSessionBase::CloseSubSession(TInt)
RSubSessionBase::CreateAutoCloseSubSession(RSessionBase &,TInt,const TIpcArgs &)
RSubSessionBase::CreateSubSession(const RSessionBase &,TInt)
RSubSessionBase::CreateSubSession(const RSessionBase &,TInt,const TIpcArgs &)
RSubSessionBase::RSubSessionBase()
RSubSessionBase::Send(TInt)const
RSubSessionBase::Send(TInt,const TIpcArgs &)const
RSubSessionBase::SendReceive(TInt)const
RSubSessionBase::SendReceive(TInt,TRequestStatus &)const
RSubSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSubSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSubSessionBase::Session()const
RSubSessionBase::SubSessionHandle()const

Member Functions Documentation

AddConfigFile(const TName &, const TFileName &)

IMPORT_C TInt AddConfigFile ( const TName & aTestModule,
const TFileName & aConfigFile
)

AddConfigFile is used to add dynamically a new config file to the Test Module specified by aTestModule. New test cases are then executed by calling first GetTestCases and then RunTestCase. Thus new test cases can be run from the Test Module without restarting the Test Framework.

Parameters

const TName & aTestModule
const TFileName & aConfigFile

AddTestCaseResultToTestReport(const TTestInfo &, const TFullTestResult &, const TInt)

IMPORT_C TInt AddTestCaseResultToTestReport ( const TTestInfo & aTestInfo,
const TFullTestResult & aTestResult,
const TInt aError
)

Add info about test case to test report.

Parameters

const TTestInfo & aTestInfo
const TFullTestResult & aTestResult
const TInt aError

AddTestModule(const TName &, const TFileName &)

IMPORT_C TInt AddTestModule ( const TName & aTestModule,
const TFileName & aIniFile
)

AddTestModule is used to add dynamically a new Test Module to the Test Framework. Test cases can then be run from the new Test Module without restarting the Test Framework. If the Test Module specified by aTestModule doesn't exists this method returns KErrNotFound. If the Test Module has been already loaded this method returns KErrAlreadyExists.

Parameters

const TName & aTestModule
const TFileName & aIniFile

CancelAsyncRequest(TInt)

IMPORT_C TInt CancelAsyncRequest ( TInt aReqToCancel )

Asynchronous request can be canceled with CancelAsyncRequest method. The aReqToCancel parameter defines the request that will be canceled.

Parameters

TInt aReqToCancel

Close()

IMPORT_C void Close ( )

Closes the RTestEngine subsession.

EnumerateTestCases(TCaseCount &, TRequestStatus &)

IMPORT_C void EnumerateTestCases ( TCaseCount & aCount,
TRequestStatus & aStatus
)

Test cases are inquired by two-phased operation calling first the EnumerateTestCases method and then the GetTestCases. Test cases are inquired from Test Engine that will inquire them from Test Modules. EnumerateTestCases requests the needed array size for test cases that will be inquired by GetTestCases method. When the EnumerateTestCases is completed succesfully the GetTestCases method is called to retrieve test cases to CArrayFixFlat <TTestInfo> list object.

TTestInfo defines individual test case and, if needed, a test set (TName iParent) where the test case belongs to. TTestInfo is used to create test case by calling RTestCase::Open that constructs the actual test case. Test case is then executed calling RTestCase::RunTestCase .

Parameters

TCaseCount & aCount
TRequestStatus & aStatus

ErrorNotification(TErrorNotificationPckg &, TRequestStatus &)

IMPORT_C void ErrorNotification ( TErrorNotificationPckg & aError,
TRequestStatus & aStatus
)

ErrorNotification obtains error notifications from test engine.

Parameters

TErrorNotificationPckg & aError
TRequestStatus & aStatus

Event(TEventIfPckg &, TRequestStatus &)

IMPORT_C void Event ( TEventIfPckg & aEvent,
TRequestStatus & aStatus
)

Event is used to get and set events in STIF Test Framework. TEventIf defines the event request information.

Parameters

TEventIfPckg & aEvent
TRequestStatus & aStatus

GetTestCases(CFixedFlatArray< TTestInfo > &)

IMPORT_C TInt GetTestCases ( CFixedFlatArray < TTestInfo > & aTestCaseBuffer )

GetTestCases retrieves test cases from Test Modules to aTestCaseBuffer that is a list consisting of several TTestInfo objects. If this method is called without previously succesfully called EnumerateTestCases method, this function returns the KErrNotReady.

Parameters

CFixedFlatArray < TTestInfo > & aTestCaseBuffer

Open(RTestEngineServer &, const TFileName &)

IMPORT_C TInt Open ( RTestEngineServer & aServer,
const TFileName & aIniFile
)

Open creates a subsession to Test Engine and opens new handle to RTestEngine . The RTestEngineServer subsession shall be created by calling RTestEngineServer::Connect before calling Open to create new RTestEngine subsession.

Parameters

RTestEngineServer & aServer
const TFileName & aIniFile

OpenLoggerSession(RTestEngineServer &, TLoggerSettings &)

IMPORT_C TInt OpenLoggerSession ( RTestEngineServer & aServer,
TLoggerSettings & aLoggerSettings
)

Used to get Logger's overwrite parameters.

Parameters

RTestEngineServer & aServer
TLoggerSettings & aLoggerSettings

RemoveConfigFile(const TName &, const TFileName &)

IMPORT_C TInt RemoveConfigFile ( const TName & aTestModule,
const TFileName & aConfigFile
)

RemoveConfigFile is used to remove a config file from the Test Module specified by aTestModule.

Parameters

const TName & aTestModule
const TFileName & aConfigFile

RemoveTestModule(const TName &)

IMPORT_C TInt RemoveTestModule ( const TName & aTestModule )

RemoveTestModule is used to remove the existing Test Module from Test Framework. If there are not test cases executing in the Test Module it will be shut down. If there is test case running from the Test Module this method returns KErrInUse. If the Test Module specified by aTestModule is not loaded this method returns KErrNotFound.

Parameters

const TName & aTestModule

SetAttribute(TAttribute, const TDesC &)

IMPORT_C TInt SetAttribute ( TAttribute aAttribute,
const TDesC & aValue
)

Sets attributes to Test Framework

Parameters

TAttribute aAttribute
const TDesC & aValue