diff --git a/src/core/command/console.py b/src/core/command/console.py index 2aa87393578cc0106064b884929dbcbe9d792137..98a2727e10d199d6e9820a7fb6f96eba86cc4725 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 b27bf6e4811ec72281b77c6a88115bde677abb54..8149b0536f4855820cd653bcc02ec58af8ea4383 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 = ""