Skip to content

Commit

Permalink
Fix type issue with iterations and invocations setting
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <git@stefan-marr.de>
  • Loading branch information
smarr committed Jul 12, 2018
1 parent 90dd87d commit 63f242b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rebench/rebench.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
18 changes: 18 additions & 0 deletions rebench/tests/executor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down

0 comments on commit 63f242b

Please sign in to comment.