24 #ifndef ARM_COMPUTE_TEST_TEST_CASE_FACTORY 25 #define ARM_COMPUTE_TEST_TEST_CASE_FACTORY 73 std::string
name()
const;
91 virtual std::unique_ptr<TestCase>
make()
const = 0;
94 const std::string _suite_name;
95 const std::string _test_name;
96 const std::string _data_description;
102 template <
typename T>
109 std::unique_ptr<TestCase>
make()
const override;
113 template <
typename T,
typename D>
128 std::unique_ptr<TestCase>
make()
const override;
135 : _suite_name{ std::move(suite_name) }, _test_name{ std::move(test_name) }, _data_description{ std::move(description) }, _mode{
mode }, _status{
status }
142 std::string
name = _suite_name +
"/" + _test_name;
144 if(!_data_description.empty())
146 name +=
"@" + _data_description;
170 stream <<
"EXPECTED_FAILURE";
173 stream <<
"DISABLED";
176 throw std::invalid_argument(
"Unsupported test case factory status");
182 template <
typename T>
185 return std::make_unique<T>();
188 template <
typename T,
typename D>
194 template <
typename T,
typename D>
197 return std::make_unique<T>(_data);
virtual std::unique_ptr< TestCase > make() const =0
Factory function to create the test case.
DatasetMode mode() const
Get the mode for which test case will be enabled.
Implementation of a test case factory to create data test cases.
TestCaseFactory(std::string suite_name, std::string name, DatasetMode mode, Status status, std::string description="")
Constructor.
Copyright (c) 2017-2021 Arm Limited.
Abstract factory class to create test cases.
std::string name() const
Name of the test case.
DatasetMode
Possible dataset modes.
Implementation of a test case factory to create non-data test cases.
std::unique_ptr< TestCase > make() const override
Factory function to create the test case.
Status status() const
Get the status of the test case.
std::unique_ptr< TestCase > make() const override
Factory function to create the test case.
DataTestCaseFactory(std::string suite_name, std::string test_name, DatasetMode mode, Status status, std::string description, const D &data)
Constructor.
virtual ~TestCaseFactory()=default
Default destructor.
inline ::std::ostream & operator<<(::std::ostream &stream, DatasetMode mode)