Workspace 6.21.5
Classes | Functions
CSIRO::Testing Namespace Reference

Namespace in which all testing code resides. More...

Classes

class  MockLogStream
 
class  StdCapture
 
class  TestHarness
 Basic test harness for running test cases. More...
 
class  TestSuite
 Class for implementing a suite of related tests. More...
 
class  TestWorkspaceAssertionFile
 This class is designed to simplify the use of loading workspace test files for use as test cases. More...
 

Functions

template<typename T >
bool inputExists (const DataExecution::Operation &op, const QString &name, bool isScalar)
 
template<typename T >
bool outputExists (const DataExecution::Operation &op, const QString &name)
 

Detailed Description

All testing code is in its own separate namespace. The Testing namespace is distinct from the TestRunner namespace because the latter contains the code needed for running tests, whereas the former contains just the test harness code which has no reliance on anything in TestRunner. Thus, client test code should define all their tests in the Testing namespace so that only those symbols made visible by the client test code will be visible to the compiler (apart from the TestHarness and TestSuite classes defined for the sole purpose of simplifying the writing of tests).

Function Documentation

◆ inputExists()

bool inputExists ( const DataExecution::Operation op,
const QString &  name,
bool  isScalar 
)
Template Parameters
TThe expected data type of the input.
Parameters
opThe operation for which we are testing the existence of an input.
nameThe expected name of the input.
isScalarWhether or not the input is expected to be scalar. If false, the operation is expected to be an array input.
Returns
true if the input exists, false if it does not.

◆ outputExists()

bool outputExists ( const DataExecution::Operation op,
const QString &  name 
)
Template Parameters
TThe expected data type of the output.
Parameters
opThe operation for which we are testing the existence of an output.
nameThe expected name of the output.
Returns
true if the output exists, false if it does not.