Compute Library
 22.11
TestCaseRegistrar< T > Class Template Referencefinal

Helper class to statically register a test case. More...

#include <Registrars.h>

Public Member Functions

 TestCaseRegistrar (std::string test_name, DatasetMode mode, TestCaseFactory::Status status)
 Add a new test case with the given name to the framework. More...
 
template<typename D >
 TestCaseRegistrar (std::string test_name, DatasetMode mode, TestCaseFactory::Status status, D &&dataset)
 Add a new data test case with the given name to the framework. More...
 

Detailed Description

template<typename T>
class arm_compute::test::framework::detail::TestCaseRegistrar< T >

Helper class to statically register a test case.

Definition at line 43 of file Registrars.h.

Constructor & Destructor Documentation

◆ TestCaseRegistrar() [1/2]

TestCaseRegistrar ( std::string  test_name,
DatasetMode  mode,
TestCaseFactory::Status  status 
)
inline

Add a new test case with the given name to the framework.

Parameters
[in]test_nameName of the test case.
[in]modeMode in which the test should be activated.
[in]statusStatus of the test case.

Definition at line 80 of file Registrars.h.

References Framework::add_test_case(), Framework::get(), and clang_tidy_rules::mode.

81 {
82  Framework::get().add_test_case<T>(std::move(test_name), mode, status);
83 }
void add_test_case(std::string test_name, DatasetMode mode, TestCaseFactory::Status status)
Add a test case to the framework.
Definition: Framework.h:374
static Framework & get()
Access to the singleton.
Definition: Framework.cpp:124

◆ TestCaseRegistrar() [2/2]

TestCaseRegistrar ( std::string  test_name,
DatasetMode  mode,
TestCaseFactory::Status  status,
D &&  dataset 
)
inline

Add a new data test case with the given name to the framework.

Parameters
[in]test_nameName of the test case.
[in]modeMode in which the test should be activated.
[in]statusStatus of the test case.
[in]datasetDataset used as input for the test case.

Definition at line 87 of file Registrars.h.

References Framework::add_data_test_case(), Framework::get(), and clang_tidy_rules::mode.

88 {
89  auto it = dataset.begin();
90 
91  for(int i = 0; i < dataset.size(); ++i, ++it)
92  {
93  // WORKAROUND for GCC 4.9
94  // The last argument should be *it to pass just the data and not the
95  // iterator.
96  Framework::get().add_data_test_case<T>(test_name, mode, status, it.description(), it);
97  }
98 }
static Framework & get()
Access to the singleton.
Definition: Framework.cpp:124
void add_data_test_case(std::string test_name, DatasetMode mode, TestCaseFactory::Status status, std::string description, D &&data)
Add a data test case to the framework.
Definition: Framework.h:380

The documentation for this class was generated from the following file: