From 7f15251e2fd6c729a1d8f4f524a4bb902c30cdad Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 16 Dec 2019 19:59:52 +0000 Subject: COMPMID-2986: Extend test framework options. Add the following option to the test framework: - delay: Allows run delay between tests in seconds. Signed-off-by: Georgios Pinitas Change-Id: Ib1b7a1d1ad83c9a99b23f353b1800db075b32bce Reviewed-on: https://review.mlplatform.org/c/2525 Reviewed-by: Michele Di Giorgio Tested-by: Arm Jenkins Reviewed-by: Gian Marco Iodice Comments-Addressed: Arm Jenkins --- tests/framework/Framework.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'tests/framework/Framework.cpp') diff --git a/tests/framework/Framework.cpp b/tests/framework/Framework.cpp index 44887a9125..4d66b14d67 100644 --- a/tests/framework/Framework.cpp +++ b/tests/framework/Framework.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 ARM Limited. + * Copyright (c) 2017-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -125,14 +125,14 @@ Framework &Framework::get() return instance; } -void Framework::init(const std::vector &instruments, int num_iterations, DatasetMode mode, const std::string &name_filter, const std::string &id_filter, - LogLevel log_level) +void Framework::init(const FrameworkConfig &config) { - _test_filter = TestFilter(mode, name_filter, id_filter); - _num_iterations = num_iterations; - _log_level = log_level; + _test_filter = TestFilter(config.mode, config.name_filter, config.id_filter); + _num_iterations = config.num_iterations; + _log_level = config.log_level; + _cooldown_sec = config.cooldown_sec; - _instruments = std::set(instruments.begin(), instruments.end()); + _instruments = std::set(std::begin(config.instruments), std::end(config.instruments)); } std::string Framework::current_suite_name() const @@ -579,6 +579,9 @@ bool Framework::run() run_test(test_info, *test_factory); ++id_run_test; + + // Run test delay + sleep_in_seconds(_cooldown_sec); } ++id; -- cgit v1.2.1