ADTF
Loading...
Searching...
No Matches
adtf::testing Namespace Reference

Namespace for the ADTF Testing SDK. More...

Namespaces

namespace  giant
 Namespace for all functionality provided since v3.6.
 

Classes

class  test_runtime
 

Functions

template<typename Callable>
bool wait_until (Callable &&oCallable, std::chrono::milliseconds tmTimeOut, std::chrono::milliseconds tmInterval=std::chrono::milliseconds{100})
 

Detailed Description

Namespace for the ADTF Testing SDK.

Within this namespace all interfaces, classes and functions always refer to their last revised implementation (version namespace). When using types defined within this namespace it is guaranteed to always use the latest version of the types.

The ADTF Testing SDK provides some simple functionality to test your ADTF components. It will work with each testing framework you like, we recommend and support the use with Catch2.

The main focus of this package is to create functional tests for ADTF components (filters, streaming sources/sinks, services) as well as all other ADTF code created with the use of overview_adtf_sdk_package.

In CMake, just use the provided macro

adtf_add_catch_test(...)

Now you can access the catch2 Macros within your test scope.

The test report handling is configured via the following CMake cache variables:

  • ADTF_TESTING_CATCH_REPORTER: The reporter used in Catch2. This is passed to the test executable via the "-r" parameter.
  • ADTF_TESTING_CATCH_GENERATE_REPORTS: Whether or not to generate report files.
  • ADTF_TESTING_CATCH_REPORTS_DIR: The directory where the test reports should pe placed in.
  • ADTF_TESTING_CATCH_REPORT_NAME_PATTERN: The pattern for constructing the report filenames, relative to ADTF_TESTING_CATCH_REPORTS_DIR. This support CMake generator expressions and CMake variables. ${NAME} can be used to address the name of the tests. Defaults to "\${NAME}/report_\${NAME}_\$<IF:\$<CONFIG:Debug>,debug,release>_\${PLATFORM}.xml"

We extended the SDKs with some additional classes for your testing porpuse.

The System SDK provides following testing helper classes:

To use them, just include following header:

The ADTF Filter SDK provides following testing helper classes:

To use them, just include following header:

Function Documentation

◆ wait_until()

template<typename Callable>
bool adtf::testing::mega::wait_until ( Callable && oCallable,
std::chrono::milliseconds tmTimeOut,
std::chrono::milliseconds tmInterval = std::chrono::milliseconds{100} )

Repeateatly calls oCallable until either it returns true or the timeout expires.

Parameters
[in]oCallableThe condition that should be checked for.
[in]tmTimeOutThe timeout to wait for.
[in]tmIntervalThe interval at which the condition should be reevaluated.
Template Parameters
CallableA callable.