diff --git a/rebench/rebench.py b/rebench/rebench.py index 64040028..1da90848 100755 --- a/rebench/rebench.py +++ b/rebench/rebench.py @@ -90,11 +90,11 @@ def shell_options(self): execution.add_argument( '-in', '--invocations', action='store', dest='invocations', help='The number of times a VM is started to execute a run.', - default=None) + default=None, type=int) execution.add_argument( '-it', '--iterations', action='store', dest='iterations', help='The number of times a benchmark is to be executed within a VM invocation.', - default=None) + default=None, type=int) execution.add_argument( '-q', '--quick', action='store_true', dest='quick', help='Execute quickly. Identical with --iterations=1 --invocations=1', diff --git a/rebench/tests/executor_test.py b/rebench/tests/executor_test.py index 1befaebc..996065ee 100644 --- a/rebench/tests/executor_test.py +++ b/rebench/tests/executor_test.py @@ -134,6 +134,24 @@ def test_execution_with_quick_set(self): self.assertEqual(1, run.get_number_of_data_points()) + def test_execution_with_invocation_and_iteration_set(self): + self._set_path(__file__) + option_parser = ReBench().shell_options() + cmd_config = option_parser.parse_args(['-in=2', '-it=2', 'persistency.conf']) + self.assertEqual(2, cmd_config.invocations) + self.assertEqual(2, cmd_config.iterations) + + cnf = Configurator(load_config(self._path + '/persistency.conf'), DataStore(self._ui), + self._ui, cmd_config, data_file=self._tmp_file) + runs = cnf.get_runs() + self.assertEqual(1, len(runs)) + + ex = Executor(runs, False, False, self._ui) + ex.execute() + run = list(runs)[0] + + self.assertEqual(2, run.get_number_of_data_points()) + def test_shell_options_without_filters(self): option_parser = ReBench().shell_options() args = option_parser.parse_args(['-d', '-v', 'some.conf'])