From 8603c3b44515ca92499bcd70daeece8edbe8e6b0 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 27 Mar 2020 10:52:50 -0400 Subject: [PATCH] dist: Add --no-tests option It is not always needed to test generated tarballs, for example when they are generated by CI that already does its own testing. --- docs/markdown/snippets/dist_not_tests.md | 5 +++++ mesonbuild/mdist.py | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 docs/markdown/snippets/dist_not_tests.md diff --git a/docs/markdown/snippets/dist_not_tests.md b/docs/markdown/snippets/dist_not_tests.md new file mode 100644 index 000000000..f9c971e9f --- /dev/null +++ b/docs/markdown/snippets/dist_not_tests.md @@ -0,0 +1,5 @@ +## meson dist --no-tests + +`meson dist` has a new option `--no-tests` to skip build and tests of generated +packages. It can be used to not waste time for example when done in CI that +already does its own testing. diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py index ea0583e6f..5637e7097 100644 --- a/mesonbuild/mdist.py +++ b/mesonbuild/mdist.py @@ -39,6 +39,8 @@ def add_arguments(parser): help='Comma separated list of archive types to create.') parser.add_argument('--include-subprojects', action='store_true', help='Include source code of subprojects that have been used for the build.') + parser.add_argument('--no-tests', action='store_true', + help='Do not build and test generated packages.') def create_hash(fname): @@ -272,8 +274,10 @@ def run(options): return 1 if names is None: return 1 - # Check only one. - rc = check_dist(names[0], meson_command, extra_meson_args, bld_root, priv_dir) + rc = 0 + if not options.no_tests: + # Check only one. + rc = check_dist(names[0], meson_command, extra_meson_args, bld_root, priv_dir) if rc == 0: for name in names: create_hash(name)