blob: 8d015c69d2df08a1553ab563e174817040ec4874 [file] [log] [blame]
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +01001/*
2 * Copyright (c) 2017 ARM Limited.
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24#include "Framework.h"
25
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010026#include "support/ToolchainSupport.h"
27
Moritz Pflanzer47752c92017-07-18 13:38:47 +010028#ifdef ARM_COMPUTE_CL
29#include "arm_compute/core/CL/OpenCL.h"
Anthony Barbierbf959222017-07-19 17:01:42 +010030#include "arm_compute/runtime/CL/CLScheduler.h"
Moritz Pflanzer47752c92017-07-18 13:38:47 +010031#endif /* ARM_COMPUTE_CL */
32
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010033#include <chrono>
34#include <iostream>
35#include <sstream>
36#include <type_traits>
37
38namespace arm_compute
39{
40namespace test
41{
42namespace framework
43{
Moritz Pflanzera4f711b2017-07-05 11:02:23 +010044Framework::Framework()
45{
46 _available_instruments.emplace(InstrumentType::WALL_CLOCK_TIMER, Instrument::make_instrument<WallClockTimer>);
47#ifdef PMU_ENABLED
48 _available_instruments.emplace(InstrumentType::PMU_CYCLE_COUNTER, Instrument::make_instrument<CycleCounter>);
49 _available_instruments.emplace(InstrumentType::PMU_INSTRUCTION_COUNTER, Instrument::make_instrument<InstructionCounter>);
50#endif /* PMU_ENABLED */
51}
52
53std::set<InstrumentType> Framework::available_instruments() const
54{
55 std::set<InstrumentType> types;
56
57 for(const auto &instrument : _available_instruments)
58 {
59 types.emplace(instrument.first);
60 }
61
62 return types;
63}
64
Moritz Pflanzerbf234e02017-07-24 15:04:14 +010065std::map<TestResult::Status, int> Framework::count_test_results() const
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010066{
Moritz Pflanzerbf234e02017-07-24 15:04:14 +010067 std::map<TestResult::Status, int> counts;
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010068
69 for(const auto &test : _test_results)
70 {
Moritz Pflanzerbf234e02017-07-24 15:04:14 +010071 ++counts[test.second.status];
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010072 }
73
Moritz Pflanzerbf234e02017-07-24 15:04:14 +010074 return counts;
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010075}
76
77Framework &Framework::get()
78{
79 static Framework instance;
80 return instance;
81}
82
Moritz Pflanzerec2de0f2017-07-27 14:43:46 +010083void Framework::init(const std::vector<InstrumentType> &instruments, int num_iterations, DatasetMode mode, const std::string &name_filter, const std::string &id_filter, LogLevel log_level)
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010084{
Moritz Pflanzerec2de0f2017-07-27 14:43:46 +010085 _test_filter = TestFilter(mode, name_filter, id_filter);
86 _num_iterations = num_iterations;
87 _log_level = log_level;
Moritz Pflanzera4f711b2017-07-05 11:02:23 +010088
89 _instruments = InstrumentType::NONE;
90
91 for(const auto &instrument : instruments)
92 {
93 _instruments |= instrument;
94 }
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010095}
96
97std::string Framework::current_suite_name() const
98{
99 return join(_test_suite_name.cbegin(), _test_suite_name.cend(), "/");
100}
101
102void Framework::push_suite(std::string name)
103{
104 _test_suite_name.emplace_back(std::move(name));
105}
106
107void Framework::pop_suite()
108{
109 _test_suite_name.pop_back();
110}
111
Moritz Pflanzerc7d15032017-07-18 16:21:16 +0100112void Framework::add_test_info(std::string info)
113{
114 _test_info.emplace_back(std::move(info));
115}
116
117void Framework::clear_test_info()
118{
119 _test_info.clear();
120}
121
122bool Framework::has_test_info() const
123{
124 return !_test_info.empty();
125}
126
127void Framework::print_test_info(std::ostream &os) const
128{
Moritz Pflanzer8df3faf2017-07-28 13:57:53 +0100129 if(!_test_info.empty())
Moritz Pflanzerc7d15032017-07-18 16:21:16 +0100130 {
Moritz Pflanzer8df3faf2017-07-28 13:57:53 +0100131 os << "CONTEXT:\n";
132
133 for(const auto &str : _test_info)
134 {
135 os << " " << str << "\n";
136 }
Moritz Pflanzerc7d15032017-07-18 16:21:16 +0100137 }
138}
139
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100140void Framework::log_test_start(const TestInfo &info)
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100141{
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100142 if(_printer != nullptr && _log_level >= LogLevel::TESTS)
Moritz Pflanzer80fffae2017-07-05 11:02:37 +0100143 {
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100144 _printer->print_test_header(info);
Moritz Pflanzer80fffae2017-07-05 11:02:37 +0100145 }
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100146}
147
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100148void Framework::log_test_skipped(const TestInfo &info)
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100149{
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100150 static_cast<void>(info);
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100151}
152
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100153void Framework::log_test_end(const TestInfo &info)
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100154{
Moritz Pflanzer80fffae2017-07-05 11:02:37 +0100155 if(_printer != nullptr)
156 {
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100157 if(_log_level >= LogLevel::MEASUREMENTS)
158 {
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100159 _printer->print_measurements(_test_results.at(info).measurements);
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100160 }
161
162 if(_log_level >= LogLevel::TESTS)
163 {
164 _printer->print_test_footer();
165 }
Moritz Pflanzer80fffae2017-07-05 11:02:37 +0100166 }
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100167}
168
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100169void Framework::log_failed_expectation(const TestError &error)
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100170{
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100171 if(_log_level >= error.level() && _printer != nullptr)
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100172 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100173 _printer->print_error(error);
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100174 }
Moritz Pflanzere1103a82017-07-18 12:20:45 +0100175
176 if(_current_test_result != nullptr)
177 {
178 _current_test_result->status = TestResult::Status::FAILED;
179 }
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100180}
181
steniu01172c58d2017-08-31 13:49:08 +0100182void Framework::log_info(const std::string &info)
183{
184 if(_log_level >= LogLevel::DEBUG && _printer != nullptr)
185 {
186 _printer->print_info(info);
187 }
188}
189
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100190int Framework::num_iterations() const
191{
192 return _num_iterations;
193}
194
195void Framework::set_num_iterations(int num_iterations)
196{
197 _num_iterations = num_iterations;
198}
199
200void Framework::set_throw_errors(bool throw_errors)
201{
202 _throw_errors = throw_errors;
203}
204
205bool Framework::throw_errors() const
206{
207 return _throw_errors;
208}
209
Moritz Pflanzerfa811652017-07-26 17:00:37 +0100210void Framework::set_stop_on_error(bool stop_on_error)
211{
212 _stop_on_error = stop_on_error;
213}
214
215bool Framework::stop_on_error() const
216{
217 return _stop_on_error;
218}
219
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100220void Framework::run_test(const TestInfo &info, TestCaseFactory &test_factory)
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100221{
Moritz Pflanzerbf234e02017-07-24 15:04:14 +0100222 if(test_factory.status() == TestCaseFactory::Status::DISABLED)
223 {
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100224 log_test_skipped(info);
225 set_test_result(info, TestResult(TestResult::Status::DISABLED));
Moritz Pflanzerbf234e02017-07-24 15:04:14 +0100226 return;
227 }
228
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100229 log_test_start(info);
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100230
Moritz Pflanzera4f711b2017-07-05 11:02:23 +0100231 Profiler profiler = get_profiler();
Moritz Pflanzere33eb642017-07-31 14:48:45 +0100232 TestResult result(TestResult::Status::NOT_RUN);
Moritz Pflanzere1103a82017-07-18 12:20:45 +0100233
234 _current_test_result = &result;
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100235
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100236 if(_log_level >= LogLevel::ERRORS && _printer != nullptr)
237 {
238 _printer->print_errors_header();
239 }
240
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100241 try
242 {
243 std::unique_ptr<TestCase> test_case = test_factory.make();
244
245 try
246 {
247 test_case->do_setup();
248
249 for(int i = 0; i < _num_iterations; ++i)
250 {
Moritz Pflanzera4f711b2017-07-05 11:02:23 +0100251 profiler.start();
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100252 test_case->do_run();
Anthony Barbierbf959222017-07-19 17:01:42 +0100253#ifdef ARM_COMPUTE_CL
254 if(opencl_is_available())
255 {
256 CLScheduler::get().sync();
257 }
258#endif /* ARM_COMPUTE_CL */
Moritz Pflanzera4f711b2017-07-05 11:02:23 +0100259 profiler.stop();
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100260 }
261
262 test_case->do_teardown();
Moritz Pflanzere33eb642017-07-31 14:48:45 +0100263
264 // Change status to success if no error has happend
265 if(result.status == TestResult::Status::NOT_RUN)
266 {
267 result.status = TestResult::Status::SUCCESS;
268 }
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100269 }
270 catch(const TestError &error)
271 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100272 if(_log_level >= error.level() && _printer != nullptr)
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100273 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100274 _printer->print_error(error);
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100275 }
276
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100277 result.status = TestResult::Status::FAILED;
278
279 if(_throw_errors)
280 {
281 throw;
282 }
283 }
Moritz Pflanzer47752c92017-07-18 13:38:47 +0100284#ifdef ARM_COMPUTE_CL
285 catch(const ::cl::Error &error)
286 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100287 if(_log_level >= LogLevel::ERRORS && _printer != nullptr)
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100288 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100289 std::stringstream stream;
290 stream << "Error code: " << error.err();
291 _printer->print_error(TestError(error.what(), LogLevel::ERRORS, stream.str()));
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100292 }
293
Moritz Pflanzer47752c92017-07-18 13:38:47 +0100294 result.status = TestResult::Status::FAILED;
295
296 if(_throw_errors)
297 {
298 throw;
299 }
300 }
301#endif /* ARM_COMPUTE_CL */
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100302 catch(const std::exception &error)
303 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100304 if(_log_level >= LogLevel::ERRORS && _printer != nullptr)
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100305 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100306 _printer->print_error(error);
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100307 }
308
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100309 result.status = TestResult::Status::CRASHED;
310
311 if(_throw_errors)
312 {
313 throw;
314 }
315 }
316 catch(...)
317 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100318 if(_log_level >= LogLevel::ERRORS && _printer != nullptr)
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100319 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100320 _printer->print_error(TestError("Received unknown exception"));
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100321 }
322
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100323 result.status = TestResult::Status::CRASHED;
324
325 if(_throw_errors)
326 {
327 throw;
328 }
329 }
330 }
331 catch(const std::exception &error)
332 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100333 if(_log_level >= LogLevel::ERRORS && _printer != nullptr)
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100334 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100335 _printer->print_error(error);
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100336 }
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100337
Moritz Pflanzere33eb642017-07-31 14:48:45 +0100338 result.status = TestResult::Status::CRASHED;
339
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100340 if(_throw_errors)
341 {
342 throw;
343 }
344 }
345 catch(...)
346 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100347 if(_log_level >= LogLevel::ERRORS && _printer != nullptr)
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100348 {
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100349 _printer->print_error(TestError("Received unknown exception"));
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100350 }
351
Moritz Pflanzere1103a82017-07-18 12:20:45 +0100352 result.status = TestResult::Status::CRASHED;
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100353
354 if(_throw_errors)
355 {
356 throw;
357 }
358 }
359
Moritz Pflanzer24a82462017-08-04 11:34:44 +0100360 if(_log_level >= LogLevel::ERRORS && _printer != nullptr)
361 {
362 _printer->print_errors_footer();
363 }
364
Moritz Pflanzere1103a82017-07-18 12:20:45 +0100365 _current_test_result = nullptr;
366
Moritz Pflanzerfa811652017-07-26 17:00:37 +0100367 if(result.status == TestResult::Status::FAILED)
Moritz Pflanzerbf234e02017-07-24 15:04:14 +0100368 {
Moritz Pflanzerfa811652017-07-26 17:00:37 +0100369 if(info.status == TestCaseFactory::Status::EXPECTED_FAILURE)
370 {
371 result.status = TestResult::Status::EXPECTED_FAILURE;
372 }
Moritz Pflanzere33eb642017-07-31 14:48:45 +0100373 }
374
375 if(result.status == TestResult::Status::FAILED || result.status == TestResult::Status::CRASHED)
376 {
377 if(_stop_on_error)
Moritz Pflanzerfa811652017-07-26 17:00:37 +0100378 {
379 throw std::runtime_error("Abort on first error.");
380 }
Moritz Pflanzerbf234e02017-07-24 15:04:14 +0100381 }
382
Moritz Pflanzera4f711b2017-07-05 11:02:23 +0100383 result.measurements = profiler.measurements();
384
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100385 set_test_result(info, result);
386 log_test_end(info);
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100387}
388
389bool Framework::run()
390{
391 // Clear old test results
392 _test_results.clear();
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100393
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100394 if(_printer != nullptr && _log_level >= LogLevel::TESTS)
Moritz Pflanzer80fffae2017-07-05 11:02:37 +0100395 {
396 _printer->print_run_header();
397 }
398
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100399 const std::chrono::time_point<std::chrono::high_resolution_clock> start = std::chrono::high_resolution_clock::now();
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100400
401 int id = 0;
402
403 for(auto &test_factory : _test_factories)
404 {
405 const std::string test_case_name = test_factory->name();
Moritz Pflanzerbf234e02017-07-24 15:04:14 +0100406 const TestInfo test_info{ id, test_case_name, test_factory->mode(), test_factory->status() };
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100407
Moritz Pflanzerec2de0f2017-07-27 14:43:46 +0100408 if(_test_filter.is_selected(test_info))
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100409 {
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100410 run_test(test_info, *test_factory);
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100411 }
412
413 ++id;
414 }
415
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100416 const std::chrono::time_point<std::chrono::high_resolution_clock> end = std::chrono::high_resolution_clock::now();
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100417
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100418 if(_printer != nullptr && _log_level >= LogLevel::TESTS)
Moritz Pflanzer80fffae2017-07-05 11:02:37 +0100419 {
420 _printer->print_run_footer();
421 }
422
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100423 auto runtime = std::chrono::duration_cast<std::chrono::seconds>(end - start);
424 std::map<TestResult::Status, int> results = count_test_results();
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100425
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100426 if(_log_level > LogLevel::NONE)
427 {
Moritz Pflanzer8df3faf2017-07-28 13:57:53 +0100428 std::cout << "Executed " << _test_results.size() << " test(s) ("
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100429 << results[TestResult::Status::SUCCESS] << " passed, "
430 << results[TestResult::Status::EXPECTED_FAILURE] << " expected failures, "
431 << results[TestResult::Status::FAILED] << " failed, "
432 << results[TestResult::Status::CRASHED] << " crashed, "
433 << results[TestResult::Status::DISABLED] << " disabled) in " << runtime.count() << " second(s)\n";
Moritz Pflanzer2ac50402017-07-24 15:52:54 +0100434 }
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100435
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100436 int num_successful_tests = results[TestResult::Status::SUCCESS] + results[TestResult::Status::EXPECTED_FAILURE];
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100437
Moritz Pflanzerbf234e02017-07-24 15:04:14 +0100438 return (static_cast<unsigned int>(num_successful_tests) == _test_results.size());
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100439}
440
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100441void Framework::set_test_result(TestInfo info, TestResult result)
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100442{
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100443 _test_results.emplace(std::move(info), std::move(result));
Moritz Pflanzera4f711b2017-07-05 11:02:23 +0100444}
445
Moritz Pflanzer80fffae2017-07-05 11:02:37 +0100446void Framework::print_test_results(Printer &printer) const
447{
448 printer.print_run_header();
449
450 for(const auto &test : _test_results)
451 {
452 printer.print_test_header(test.first);
453 printer.print_measurements(test.second.measurements);
454 printer.print_test_footer();
455 }
456
457 printer.print_run_footer();
458}
459
Moritz Pflanzera4f711b2017-07-05 11:02:23 +0100460Profiler Framework::get_profiler() const
461{
462 Profiler profiler;
463
464 for(const auto &instrument : _available_instruments)
465 {
466 if((instrument.first & _instruments) != InstrumentType::NONE)
467 {
468 profiler.add(instrument.second());
469 }
470 }
471
472 return profiler;
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100473}
474
Moritz Pflanzer80fffae2017-07-05 11:02:37 +0100475void Framework::set_printer(Printer *printer)
476{
477 _printer = printer;
478}
479
Moritz Pflanzer542002c2017-07-26 16:03:58 +0100480std::vector<TestInfo> Framework::test_infos() const
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100481{
Moritz Pflanzerbf234e02017-07-24 15:04:14 +0100482 std::vector<TestInfo> ids;
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100483
484 int id = 0;
485
486 for(const auto &factory : _test_factories)
487 {
Moritz Pflanzerbf234e02017-07-24 15:04:14 +0100488 TestInfo test_info{ id, factory->name(), factory->mode(), factory->status() };
489
Moritz Pflanzerec2de0f2017-07-27 14:43:46 +0100490 if(_test_filter.is_selected(test_info))
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100491 {
Moritz Pflanzerbf234e02017-07-24 15:04:14 +0100492 ids.emplace_back(std::move(test_info));
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100493 }
494
495 ++id;
496 }
497
498 return ids;
499}
steniu01172c58d2017-08-31 13:49:08 +0100500
501LogLevel Framework::log_level() const
502{
503 return _log_level;
504}
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +0100505} // namespace framework
506} // namespace test
507} // namespace arm_compute