24.02
|
#include "armnnTestUtils/TensorHelpers.hpp"
#include <armnn/Logging.hpp>
#include <armnn/Utils.hpp>
#include <reference/RefWorkloadFactory.hpp>
#include <reference/test/RefWorkloadFactoryHelper.hpp>
#include <backendsCommon/test/WorkloadFactoryHelper.hpp>
#include <armnnTestUtils/LayerTestResult.hpp>
#include <armnnTestUtils/TensorCopyUtils.hpp>
#include <armnnTestUtils/WorkloadTestUtils.hpp>
#include <doctest/doctest.h>
Go to the source code of this file.
Macros | |
#define | ARMNN_SIMPLE_TEST_CASE(TestName, TestFunction) |
#define | ARMNN_AUTO_TEST_CASE(TestName, TestFunction, ...) |
#define | ARMNN_AUTO_TEST_FIXTURE(TestName, Fixture, TestFunction, ...) |
#define | ARMNN_AUTO_TEST_CASE_WITH_THF(TestName, TestFunction, ...) |
#define | ARMNN_AUTO_TEST_FIXTURE_WITH_THF(TestName, Fixture, TestFunction, ...) |
#define | ARMNN_COMPARE_REF_AUTO_TEST_CASE(TestName, TestFunction, ...) |
#define | ARMNN_COMPARE_REF_AUTO_TEST_CASE_WITH_THF(TestName, TestFunction, ...) |
#define | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(TestName, Fixture, TestFunction, ...) |
#define | ARMNN_COMPARE_REF_FIXTURE_TEST_CASE_WITH_THF(TestName, Fixture, TestFunction, ...) |
Functions | |
void | ConfigureLoggingTest () |
template<typename T , std::size_t n> | |
void | CompareTestResultIfSupported (const std::string &testName, const LayerTestResult< T, n > &testResult) |
Executes CHECK_MESSAGE on CompareTensors() return value so that the predicate_result message is reported. More... | |
template<typename T , std::size_t n> | |
void | CompareTestResultIfSupported (const std::string &testName, const std::vector< LayerTestResult< T, n >> &testResult) |
template<typename FactoryType , typename TFuncPtr , typename... Args> | |
void | RunTestFunction (const char *testName, TFuncPtr testFunction, Args... args) |
template<typename FactoryType , typename TFuncPtr , typename... Args> | |
void | RunTestFunctionUsingTensorHandleFactory (const char *testName, TFuncPtr testFunction, Args... args) |
template<typename FactoryType , typename TFuncPtr , typename... Args> | |
void | CompareRefTestFunction (const char *testName, TFuncPtr testFunction, Args... args) |
template<typename FactoryType , typename TFuncPtr , typename... Args> | |
void | CompareRefTestFunctionUsingTensorHandleFactory (const char *testName, TFuncPtr testFunction, Args... args) |
#define ARMNN_AUTO_TEST_CASE | ( | TestName, | |
TestFunction, | |||
... | |||
) |
Definition at line 117 of file UnitTests.hpp.
#define ARMNN_AUTO_TEST_CASE_WITH_THF | ( | TestName, | |
TestFunction, | |||
... | |||
) |
Definition at line 129 of file UnitTests.hpp.
#define ARMNN_AUTO_TEST_FIXTURE | ( | TestName, | |
Fixture, | |||
TestFunction, | |||
... | |||
) |
Definition at line 123 of file UnitTests.hpp.
#define ARMNN_AUTO_TEST_FIXTURE_WITH_THF | ( | TestName, | |
Fixture, | |||
TestFunction, | |||
... | |||
) |
Definition at line 135 of file UnitTests.hpp.
#define ARMNN_COMPARE_REF_AUTO_TEST_CASE | ( | TestName, | |
TestFunction, | |||
... | |||
) |
Definition at line 169 of file UnitTests.hpp.
#define ARMNN_COMPARE_REF_AUTO_TEST_CASE_WITH_THF | ( | TestName, | |
TestFunction, | |||
... | |||
) |
Definition at line 175 of file UnitTests.hpp.
#define ARMNN_COMPARE_REF_FIXTURE_TEST_CASE | ( | TestName, | |
Fixture, | |||
TestFunction, | |||
... | |||
) |
Definition at line 181 of file UnitTests.hpp.
#define ARMNN_COMPARE_REF_FIXTURE_TEST_CASE_WITH_THF | ( | TestName, | |
Fixture, | |||
TestFunction, | |||
... | |||
) |
Definition at line 187 of file UnitTests.hpp.
#define ARMNN_SIMPLE_TEST_CASE | ( | TestName, | |
TestFunction | |||
) |
Definition at line 111 of file UnitTests.hpp.
void CompareRefTestFunction | ( | const char * | testName, |
TFuncPtr | testFunction, | ||
Args... | args | ||
) |
void CompareRefTestFunctionUsingTensorHandleFactory | ( | const char * | testName, |
TFuncPtr | testFunction, | ||
Args... | args | ||
) |
Definition at line 154 of file UnitTests.hpp.
References CompareTestResultIfSupported().
void CompareTestResultIfSupported | ( | const std::string & | testName, |
const LayerTestResult< T, n > & | testResult | ||
) |
Executes CHECK_MESSAGE on CompareTensors() return value so that the predicate_result message is reported.
If the test reports itself as not supported then the tensors are not compared. Additionally this checks that the supportedness reported by the test matches the name of the test. Unsupported tests must be 'tagged' by including "UNSUPPORTED" in their name. This is useful because it clarifies that the feature being tested is not actually supported (a passed test with the name of a feature would imply that feature was supported). If support is added for a feature, the test case will fail because the name incorrectly contains UNSUPPORTED. If support is removed for a feature, the test case will fail because the name doesn't contain UNSUPPORTED.
Definition at line 43 of file UnitTests.hpp.
Referenced by CompareRefTestFunction(), CompareRefTestFunctionUsingTensorHandleFactory(), RunTestFunction(), and RunTestFunctionUsingTensorHandleFactory().
void CompareTestResultIfSupported | ( | const std::string & | testName, |
const std::vector< LayerTestResult< T, n >> & | testResult | ||
) |
Definition at line 60 of file UnitTests.hpp.
|
inline |
Definition at line 22 of file UnitTests.hpp.
References armnn::ConfigureLogging(), and armnn::Fatal.
void RunTestFunction | ( | const char * | testName, |
TFuncPtr | testFunction, | ||
Args... | args | ||
) |
Definition at line 79 of file UnitTests.hpp.
References CompareTestResultIfSupported(), ProfilerManager::GetInstance(), and ProfilerManager::RegisterProfiler().
void RunTestFunctionUsingTensorHandleFactory | ( | const char * | testName, |
TFuncPtr | testFunction, | ||
Args... | args | ||
) |
Definition at line 95 of file UnitTests.hpp.
References CompareTestResultIfSupported(), ProfilerManager::GetInstance(), and ProfilerManager::RegisterProfiler().