aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2023-10-20 10:48:30 -0500
committerXavier Claessens <xclaesse@gmail.com>2023-10-20 12:49:38 -0400
commit46cedeb431a67cde1c26c6d936bdd84ea8392d6f (patch)
treefebdb824ec0dfc6265c51afa991abbabafeb3b65
parent450b3db37810c99854f670cb70a59e0bee5b8777 (diff)
downloadmeson-46cedeb431a67cde1c26c6d936bdd84ea8392d6f.zip
meson-46cedeb431a67cde1c26c6d936bdd84ea8392d6f.tar.gz
meson-46cedeb431a67cde1c26c6d936bdd84ea8392d6f.tar.bz2
Support -j as a shorthand for --num-processes
We already use -j to support parallelism in meson compile. So let's add the same for meson test and meson subprojects.
-rw-r--r--docs/markdown/snippets/shorthand_argument_for_mtest_num_processes.md4
-rwxr-xr-xmesonbuild/msubprojects.py2
-rw-r--r--mesonbuild/mtest.py2
3 files changed, 6 insertions, 2 deletions
diff --git a/docs/markdown/snippets/shorthand_argument_for_mtest_num_processes.md b/docs/markdown/snippets/shorthand_argument_for_mtest_num_processes.md
new file mode 100644
index 0000000..7ff661b
--- /dev/null
+++ b/docs/markdown/snippets/shorthand_argument_for_mtest_num_processes.md
@@ -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
diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py
index 599d0b7..fb9a847 100755
--- a/mesonbuild/msubprojects.py
+++ b/mesonbuild/msubprojects.py
@@ -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.')
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 291b1e2..57bf28f 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -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')