[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
203/203: build: meson: Replace the 'test-target' argument by 'test-optio
From: |
guix-commits |
Subject: |
203/203: build: meson: Replace the 'test-target' argument by 'test-options'. |
Date: |
Wed, 3 Nov 2021 21:10:46 -0400 (EDT) |
apteryx pushed a commit to branch core-updates-frozen-batched-changes
in repository guix.
commit 1f5cff2d478b20ac0b60684cbc37a3f327d723e1
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Wed Nov 3 12:07:22 2021 -0400
build: meson: Replace the 'test-target' argument by 'test-options'.
This change is motivated by the need to disable the default 30 seconds
timeout
that Meson uses (see: https://gitlab.gnome.org/GNOME/glib/-/issues/2522),
and
also by desire to specify extra options to run the check phase without
having
to override it.
* guix/build-system/meson.scm (meson-build) <test-target>: Replace argument
with...
<test-options>: ... this one.
* guix/build/meson-build-system.scm (check): Invoke 'meson test' instead of
'ninja test-target', as the former is configurable via options.
* doc/guix.texi (Build Systems) <meson-build-system>: Update doc.
---
doc/guix.texi | 6 ++++--
guix/build-system/meson.scm | 12 ++++++------
guix/build/meson-build-system.scm | 18 ++++++++++--------
3 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 85d834a..2130af7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8746,8 +8746,10 @@ The phase runs @code{ninja} to build the package in
parallel by default, but
this can be changed with @code{#:parallel-build?}.
@item check
-The phase runs @code{ninja} with the target specified in @code{#:test-target},
-which is @code{"test"} by default.
+The phase runs @samp{meson test} with a base set of options that cannot
+be overridden. This base set of options can be extended via the
+@code{#:test-options} argument, for example to select or skip a specific
+test suite.
@item install
The phase runs @code{ninja install} and can not be changed.
diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm
index 198aa08..ba7441a 100644
--- a/guix/build-system/meson.scm
+++ b/guix/build-system/meson.scm
@@ -169,7 +169,7 @@ TRIPLET."
(search-paths '())
(build-type "debugoptimized")
(tests? #t)
- (test-target "test")
+ (test-options ''())
(glib-or-gtk? #f)
(parallel-build? #t)
(parallel-tests? #f)
@@ -218,7 +218,7 @@ has a 'meson.build' file."
configure-flags)
#:build-type #$build-type
#:tests? #$tests?
- #:test-target #$test-target
+ #:test-options #$(sexp->gexp test-options)
#:parallel-build? #$parallel-build?
#:parallel-tests? #$parallel-tests?
#:validate-runpath? #$validate-runpath?
@@ -251,7 +251,7 @@ has a 'meson.build' file."
(build-type "debugoptimized")
(tests? #f)
- (test-target "test")
+ (test-options ''())
(glib-or-gtk? #f)
(parallel-build? #t)
(parallel-tests? #f)
@@ -281,7 +281,7 @@ SOURCE has a 'meson.build' file."
(if (null? target-inputs)
(input-tuples->gexp host-inputs)
#~(append #$(input-tuples->gexp host-inputs)
- #+(input-tuples->gexp target-inputs))))
+ #+(input-tuples->gexp target-inputs))))
(define builder
(with-imported-modules imported-modules
#~(begin
@@ -306,7 +306,7 @@ SOURCE has a 'meson.build' file."
#:native-inputs #+(input-tuples->gexp build-inputs)
#:search-paths '#$(sexp->gexp
(map search-path-specification->sexp
- search-paths))
+ search-paths))
#:native-search-paths '#$(sexp->gexp
(map
search-path-specification->sexp
native-search-paths))
@@ -318,7 +318,7 @@ SOURCE has a 'meson.build' file."
configure-flags))
#:build-type #$build-type
#:tests? #$tests?
- #:test-target #$test-target
+ #:test-options #$(sexp->gexp test-options)
#:parallel-build? #$parallel-build?
#:parallel-tests? #$parallel-tests?
#:validate-runpath? #$validate-runpath?
diff --git a/guix/build/meson-build-system.scm
b/guix/build/meson-build-system.scm
index cc2ba83..61ce453 100644
--- a/guix/build/meson-build-system.scm
+++ b/guix/build/meson-build-system.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -63,16 +64,17 @@
(number->string (parallel-job-count))
"1")))
-(define* (check #:key test-target parallel-tests? tests?
+(define* (check #:key tests? test-options parallel-tests?
#:allow-other-keys)
- (setenv "MESON_TESTTHREADS"
- (if parallel-tests?
- (number->string (parallel-job-count))
- "1"))
(if tests?
- (invoke "ninja" test-target)
- (format #t "test suite not run~%"))
- #t)
+ (begin
+ (setenv "MESON_TESTTHREADS"
+ (if parallel-tests?
+ (number->string (parallel-job-count))
+ "1"))
+ ;; Always provide "-t 0" to disable the 30 s default timeout.
+ (apply invoke "meson" "test" "--print-errorlogs" "-t" "0"
test-options))
+ (format #t "test suite not run~%")))
(define* (install #:rest args)
(invoke "ninja" "install"))
- 185/203: gnu: uhttpmock: Use libsoup 2., (continued)
- 185/203: gnu: uhttpmock: Use libsoup 2., guix-commits, 2021/11/03
- 194/203: gnu: docker-compose: Update to 1.29.2., guix-commits, 2021/11/03
- 200/203: gnu: gvfs: Use meson-0.59 to workaround faulty meson., guix-commits, 2021/11/03
- 143/203: gnu: elogind: Update to 246.10., guix-commits, 2021/11/03
- 184/203: gnu: emacs-elpy: Update to 1.35.0-0.8d0de31., guix-commits, 2021/11/03
- 191/203: gnu: python-docker: Update to 5.0.3 and remove obsolete package variants., guix-commits, 2021/11/03
- 196/203: gnu: ansible-core: Use GUIX_PYTHONPATH to fix build., guix-commits, 2021/11/03
- 107/203: gnu: lsof: Disable the LTlock test., guix-commits, 2021/11/03
- 173/203: gnu: tracker: Use libsoup-minimal-2 to fix build., guix-commits, 2021/11/03
- 178/203: gnu: duktape: Install a pkg-config file., guix-commits, 2021/11/03
- 203/203: build: meson: Replace the 'test-target' argument by 'test-options'.,
guix-commits <=
- 160/203: gnu: mesa: Replace obsolete vulkan-overlay-layer build option., guix-commits, 2021/11/03
- 174/203: gnu: xkeyboard-config: Update to 2.34., guix-commits, 2021/11/03
- 177/203: gnu: xorg-server, xorg-server-for-tests: Update to 21.1.0., guix-commits, 2021/11/03
- 182/203: gnu: geoclue: Fix build option name., guix-commits, 2021/11/03
- 183/203: gnu: jami-gnome: Fix build with webkitgtk 2.34.1., guix-commits, 2021/11/03
- 198/203: gnu: ansible: Update to 4.7.0., guix-commits, 2021/11/03
- 190/203: gnu: python-requests: Update to 2.26.0., guix-commits, 2021/11/03
- 192/203: gnu: Add python-dotenv., guix-commits, 2021/11/03
- 199/203: gnu: libgdata: Use libsoup 2 to fix build., guix-commits, 2021/11/03
- 201/203: gnu: icecat: Use latest rust., guix-commits, 2021/11/03