Skip to content

Commit 70ae40f

Browse files
committed
Propagated 'jobs' argument to test suite CLI. Now option -j can be used with 'single_test.py' script
1 parent dc4d741 commit 70ae40f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

workspace_tools/test_api.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ def __init__(self,
143143
_opts_suppress_summary=False,
144144
_opts_test_x_toolchain_summary=False,
145145
_opts_copy_method=None,
146-
_opts_mut_reset_type=None
146+
_opts_mut_reset_type=None,
147+
_opts_jobs=None
147148
):
148149
""" Let's try hard to init this object """
149150
PATTERN = "\\{(" + "|".join(self.TEST_RESULT_MAPPING.keys()) + ")\\}"
@@ -183,6 +184,7 @@ def __init__(self,
183184
self.opts_test_x_toolchain_summary = _opts_test_x_toolchain_summary
184185
self.opts_copy_method = _opts_copy_method
185186
self.opts_mut_reset_type = _opts_mut_reset_type
187+
self.opts_jobs = _opts_jobs
186188

187189
def shuffle_random_func(self):
188190
return self.shuffle_random_seed
@@ -222,7 +224,8 @@ def execute(self):
222224
build_mbed_libs_result = build_mbed_libs(T,
223225
toolchain,
224226
options=build_mbed_libs_options,
225-
clean=clean_mbed_libs_options)
227+
clean=clean_mbed_libs_options,
228+
jobs=self.opts_jobs)
226229
if not build_mbed_libs_result:
227230
print 'Skipped tests for %s target. Toolchain %s is not yet supported for this target' % (T.name, toolchain)
228231
continue
@@ -275,7 +278,8 @@ def execute(self):
275278
toolchain,
276279
options=build_project_options,
277280
verbose=self.opts_verbose,
278-
clean=clean_mbed_libs_options)
281+
clean=clean_mbed_libs_options,
282+
jobs=self.opts_jobs)
279283

280284
# TODO: move this 2 below loops to separate function
281285
INC_DIRS = []
@@ -299,7 +303,8 @@ def execute(self):
299303
verbose=self.opts_verbose,
300304
name=project_name,
301305
macros=MACROS,
302-
inc_dirs=INC_DIRS)
306+
inc_dirs=INC_DIRS,
307+
jobs=self.opts_jobs)
303308

304309
if self.opts_only_build_tests:
305310
# With this option we are skipping testing phase
@@ -966,6 +971,12 @@ def get_default_test_options_parser():
966971
metavar="FILE",
967972
help='Points to file with MUTs specification (overwrites settings.py and private_settings.py)')
968973

974+
parser.add_option("-j", "--jobs",
975+
dest='jobs',
976+
metavar="NUMBER",
977+
type="int",
978+
help="Define number of compilation jobs. Default value is 1")
979+
969980
parser.add_option('-g', '--goanna-for-tests',
970981
dest='goanna_for_tests',
971982
metavar=False,

0 commit comments

Comments
 (0)