diff mbox series

[bug#49828,01/20] gnu: minetest: Respect --without-tests.

Message ID 20210802155019.6122-1-maximedevos@telenet.be
State Accepted
Headers show
Series Add minetest mods | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

M Aug. 2, 2021, 3:50 p.m. UTC
* gnu/packages/games.scm
  (minetest)[arguments]<#:phases>{check}: Use 'tests?' instead
  of ',(%current-target-system)'. Remove trailing #t.
---
 gnu/packages/games.scm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Leo Prikler Aug. 2, 2021, 5:14 p.m. UTC | #1
Hi Maxime,

Am Montag, den 02.08.2021, 17:50 +0200 schrieb Maxime Devos:
> * gnu/packages/games.scm
>   (minetest)[arguments]<#:phases>{check}: Use 'tests?' instead
>   of ',(%current-target-system)'. Remove trailing #t.
For context, (%current-target-system) is used because tests only work
in native builds.  If this can't be reflected in the value of tests?,
we should have both checks, imo.
> ---
>  gnu/packages/games.scm | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index 8c6b5523f1..3e7086b398 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -3590,13 +3590,12 @@ match, cannon keep, and grave-itation pit.")
>                       (string-append (getcwd) "/games")) ; for check
>               #t))
>           (replace 'check
> -           (lambda _
> +           (lambda* (#:key tests? #:allow-other-keys)
>               ;; Thanks to our substitutions, the tests should also
> run
>               ;; when invoked on the target outside of `guix build'.
> -             (unless ,(%current-target-system)
> +             (when tests?
>                 (setenv "HOME" "/tmp")
> -               (invoke "src/minetest" "--run-unittests"))
> -             #t)))))
> +               (invoke "src/minetest" "--run-unittests")))))))
>      (native-search-paths
>       (list (search-path-specification
>              (variable "MINETEST_SUBGAME_PATH")
M Aug. 2, 2021, 5:18 p.m. UTC | #2
Leo Prikler schreef op ma 02-08-2021 om 19:14 [+0200]:
> Hi Maxime,
> 
> Am Montag, den 02.08.2021, 17:50 +0200 schrieb Maxime Devos:
> > * gnu/packages/games.scm
> >   (minetest)[arguments]<#:phases>{check}: Use 'tests?' instead
> >   of ',(%current-target-system)'. Remove trailing #t.
> For context, (%current-target-system) is used because tests only work
> in native builds.  If this can't be reflected in the value of tests?,
> we should have both checks, imo.

'cmake-cross-build' sets '#:tests?' to #f by default, so I don't think
both checks are needed.

Greetings,
Maxime.
Leo Prikler Aug. 2, 2021, 5:22 p.m. UTC | #3
Am Montag, den 02.08.2021, 19:18 +0200 schrieb Maxime Devos:
> Leo Prikler schreef op ma 02-08-2021 om 19:14 [+0200]:
> > Hi Maxime,
> > 
> > Am Montag, den 02.08.2021, 17:50 +0200 schrieb Maxime Devos:
> > > * gnu/packages/games.scm
> > >   (minetest)[arguments]<#:phases>{check}: Use 'tests?' instead
> > >   of ',(%current-target-system)'. Remove trailing #t.
> > For context, (%current-target-system) is used because tests only
> > work in native builds.  If this can't be reflected in the value of
> > tests?, we should have both checks, imo.
> 
> 'cmake-cross-build' sets '#:tests?' to #f by default, so I don't
> think both checks are needed.
In that case nvm and thanks for clearing that up :)
diff mbox series

Patch

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 8c6b5523f1..3e7086b398 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3590,13 +3590,12 @@  match, cannon keep, and grave-itation pit.")
                      (string-append (getcwd) "/games")) ; for check
              #t))
          (replace 'check
-           (lambda _
+           (lambda* (#:key tests? #:allow-other-keys)
              ;; Thanks to our substitutions, the tests should also run
              ;; when invoked on the target outside of `guix build'.
-             (unless ,(%current-target-system)
+             (when tests?
                (setenv "HOME" "/tmp")
-               (invoke "src/minetest" "--run-unittests"))
-             #t)))))
+               (invoke "src/minetest" "--run-unittests")))))))
     (native-search-paths
      (list (search-path-specification
             (variable "MINETEST_SUBGAME_PATH")