Skip to content

Commit

Permalink
Support -j as a shorthand for --num-processes
Browse files Browse the repository at this point in the history
We already use -j to support parallelism in meson compile. So let's add
the same for meson test and meson subprojects.
  • Loading branch information
tristan957 committed Oct 20, 2023
1 parent 450b3db commit 22e2cb3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## `-j` shorthand for `--num-processes`

`-j` now means the same thing as `--num-processes`. It was inconsistently
supported only in some subcommands. Now you may use it everywhere
2 changes: 1 addition & 1 deletion mesonbuild/msubprojects.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def add_common_arguments(p: argparse.ArgumentParser) -> None:
help='Path to source directory')
p.add_argument('--types', default='',
help=f'Comma-separated list of subproject types. Supported types are: {ALL_TYPES_STRING} (default: all)')
p.add_argument('--num-processes', default=None, type=int,
p.add_argument('-j', '--num-processes', default=None, type=int,
help='How many parallel processes to use (Since 0.59.0).')
p.add_argument('--allow-insecure', default=False, action='store_true',
help='Allow insecure server connections.')
Expand Down
2 changes: 1 addition & 1 deletion mesonbuild/mtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def add_arguments(parser: argparse.ArgumentParser) -> None:
help="Run benchmarks instead of tests.")
parser.add_argument('--logbase', default='testlog',
help="Base name for log file.")
parser.add_argument('--num-processes', default=determine_worker_count(), type=int,
parser.add_argument('-j', '--num-processes', default=determine_worker_count(), type=int,
help='How many parallel processes to use.')
parser.add_argument('-v', '--verbose', default=False, action='store_true',
help='Do not redirect stdout and stderr')
Expand Down

0 comments on commit 22e2cb3

Please sign in to comment.