Skip to content

Commit fa1e9df

Browse files
authored
Merge pull request #30981 from omochi/run-test-jobs
[run-test] add `--build-jobs` option
2 parents 763875a + 081ffaa commit fa1e9df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

utils/run-test

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ def main():
126126
choices=["true", "verbose", "skip"], default='true',
127127
help="build test dependencies before running tests "
128128
"(default: true)")
129+
parser.add_argument("--build-jobs",
130+
type=int,
131+
help="The number of parallel build jobs to use")
129132
parser.add_argument("--target",
130133
type=argparse.types.ShellSplitType(),
131134
action=argparse.actions.AppendAction,
@@ -232,7 +235,11 @@ def main():
232235
cmake_build = ['cmake', '--build', build_dir, '--']
233236
if args.build == 'verbose':
234237
cmake_build += ['-v']
235-
cmake_build += ['-j%d' % multiprocessing.cpu_count()]
238+
239+
if args.build_jobs is not None:
240+
cmake_build += ['-j%d' % args.build_jobs]
241+
else:
242+
cmake_build += ['-j%d' % multiprocessing.cpu_count()]
236243

237244
print("--- Building test dependencies %s ---" %
238245
', '.join(dependency_targets))

0 commit comments

Comments
 (0)