From d235535f1d634fc77f1687c98a762c8451c213d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=9B=BD=E8=BE=89?= Date: Tue, 6 May 2025 09:33:57 +0000 Subject: [PATCH] =?UTF-8?q?Signed-off-by:=20=E9=BB=84=E5=9B=BD=E8=BE=89=20?= =?UTF-8?q??= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄国辉 --- src/core/command/console.py | 7 +++++++ src/core/driver/drivers.py | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/core/command/console.py b/src/core/command/console.py index 2aa8739..98a2727 100755 --- a/src/core/command/console.py +++ b/src/core/command/console.py @@ -142,6 +142,13 @@ class Console(object): default=0, help="Specify number of times that a test is executed" ) + parser.add_argument("-iter", "--iteration", + action="store", + type=int, + dest="iteration", + default="", + help="Number of iterations" + ) parser.add_argument("-hl", "--historylist", action='store_true', dest="historylist", diff --git a/src/core/driver/drivers.py b/src/core/driver/drivers.py index b27bf6e..8149b05 100644 --- a/src/core/driver/drivers.py +++ b/src/core/driver/drivers.py @@ -645,7 +645,8 @@ class CppTestDriver(IDriver): self.config.testtype, self.config.target_test_path, suite_file, - filename) + filename, + self.config.iteration) # execute testcase if not self.config.coverage: @@ -794,7 +795,8 @@ class CppTestDriver(IDriver): testtype, target_test_path, suite_file, - filename): + filename, + iteration): if "benchmark" == testtype[0]: test_para = (" --benchmark_out_format=json" " --benchmark_out=%s%s.json") % ( @@ -806,6 +808,8 @@ class CppTestDriver(IDriver): elif "" == testcase and "" != testlevel: level_para = get_level_para_string(testlevel) test_para = "%s=%s" % (GTestConst.exec_para_level, level_para) + elif iteration != "": + test_para = f" --gtest_repeat={iteration}" else: test_para = "" -- Gitee