diff options
Diffstat (limited to 'tests/framework')
-rw-r--r-- | tests/framework/Framework.cpp | 8 | ||||
-rw-r--r-- | tests/framework/Framework.h | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/tests/framework/Framework.cpp b/tests/framework/Framework.cpp index c6aaad0586..dff280dc8c 100644 --- a/tests/framework/Framework.cpp +++ b/tests/framework/Framework.cpp @@ -26,6 +26,7 @@ #include "arm_compute/runtime/Scheduler.h" #include "support/MemorySupport.h" #include "tests/framework/ParametersLibrary.h" +#include "tests/framework/TestFilter.h" #ifdef ARM_COMPUTE_CL #include "arm_compute/runtime/CL/CLRuntimeContext.h" @@ -49,6 +50,7 @@ namespace framework std::unique_ptr<InstrumentsInfo> instruments_info; Framework::Framework() + : _test_filter(nullptr) { _available_instruments.emplace(std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMESTAMPS, ScaleFactor::NONE), Instrument::make_instrument<WallClockTimestamps, ScaleFactor::NONE>); _available_instruments.emplace(std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMESTAMPS, ScaleFactor::TIME_MS), @@ -127,7 +129,7 @@ Framework &Framework::get() void Framework::init(const FrameworkConfig &config) { - _test_filter = TestFilter(config.mode, config.name_filter, config.id_filter); + _test_filter.reset(new TestFilter(config.mode, config.name_filter, config.id_filter)); _num_iterations = config.num_iterations; _log_level = config.log_level; _cooldown_sec = config.cooldown_sec; @@ -558,7 +560,7 @@ bool Framework::run() const std::string test_case_name = test_factory->name(); const TestInfo test_info{ id, test_case_name, test_factory->mode(), test_factory->status() }; - if(_test_filter.is_selected(test_info)) + if(_test_filter->is_selected(test_info)) { #ifdef ARM_COMPUTE_CL // Every 100 tests, reset the OpenCL context to release the allocated memory @@ -678,7 +680,7 @@ std::vector<TestInfo> Framework::test_infos() const { TestInfo test_info{ id, factory->name(), factory->mode(), factory->status() }; - if(_test_filter.is_selected(test_info)) + if(_test_filter->is_selected(test_info)) { ids.emplace_back(std::move(test_info)); } diff --git a/tests/framework/Framework.h b/tests/framework/Framework.h index fb52fd8ffe..11dedfe89f 100644 --- a/tests/framework/Framework.h +++ b/tests/framework/Framework.h @@ -29,7 +29,6 @@ #include "Profiler.h" #include "TestCase.h" #include "TestCaseFactory.h" -#include "TestFilter.h" #include "TestResult.h" #include "Utils.h" #include "instruments/Instruments.h" @@ -41,11 +40,9 @@ #include <memory> #include <numeric> #include <ostream> -#include <regex> #include <set> #include <sstream> #include <string> -#include <tuple> #include <vector> namespace arm_compute @@ -54,6 +51,8 @@ namespace test { namespace framework { +class TestFilter; + /** Framework configuration structure */ struct FrameworkConfig { @@ -346,7 +345,7 @@ private: std::map<InstrumentsDescription, create_function *> _available_instruments{}; std::set<framework::InstrumentsDescription> _instruments{ std::pair<InstrumentType, ScaleFactor>(InstrumentType::NONE, ScaleFactor::NONE) }; - TestFilter _test_filter{}; + std::unique_ptr<TestFilter> _test_filter; LogLevel _log_level{ LogLevel::ALL }; const TestInfo *_current_test_info{ nullptr }; TestResult *_current_test_result{ nullptr }; |