~ruther/guix-local

40c2edf91bcbbacda9956970aced4ffa7400f419 — Giacomo Leidi 5 months ago 6e4ac11
build-system: mix: Allow passing test flags.

* guix/build-system/mix.scm (mix-build): Add test-flags keyword
argument and pass it on.
* guix/build/mix-build-system.scm (check): Add test-flags keyword
argument and pass it to Mix.

Change-Id: Ib8243aaaf7a7d02df993cee44f33b36566049e83
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2 files changed, 8 insertions(+), 4 deletions(-)

M guix/build-system/mix.scm
M guix/build/mix-build-system.scm
M guix/build-system/mix.scm => guix/build-system/mix.scm +3 -0
@@ 1,5 1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2023 Pierre-Henry Fröhring <contact@phfrohring.com>
;;; Copyright © 2025 Giacomo Leidi <goodoldpaul@autistici.org>
;;;
;;; This file is part of GNU Guix.
;;;


@@ 73,6 74,7 @@ See: https://github.com/hexpm/specifications/blob/main/endpoints.md"
                    #:key
                    source
                    (tests? #t)
                    (test-flags ''())
                    (mix-path #f) ;See MIX_PATH.
                    (mix-exs "mix.exs") ;See MIX_EXS.
                    (build-per-environment #t) ;See :build_per_environment.


@@ 107,6 109,7 @@ See: https://github.com/hexpm/specifications/blob/main/endpoints.md"
                           #:source #+source
                           #:system #$system
                           #:tests? #$tests?
                           #:test-flags #$test-flags
                           #:mix-path #$mix-path
                           #:mix-exs #$mix-exs
                           #:mix-environments '#$mix-environments

M guix/build/mix-build-system.scm => guix/build/mix-build-system.scm +5 -4
@@ 1,7 1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2023 Pierre-Henry Fröhring <contact@phfrohring.com>
;;; Copyright © 2024 Igor Goryachev <igor@goryachev.org>
;;; Copyright © 2024 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2024, 2025 Giacomo Leidi <goodoldpaul@autistici.org>
;;;
;;; This file is part of GNU Guix.
;;;


@@ 119,13 119,14 @@ See: https://hexdocs.pm/mix/1.15.7/Mix.html#module-environment-variables"
                      "--no-prune-code-paths"))
            mix-environments))

(define* (check #:key (tests? #t) #:allow-other-keys)
(define* (check #:key (tests? #t) (test-flags '()) #:allow-other-keys)
  "Test the Mix project."
  (if tests?
      (begin
        (setenv "MIX_ENV" "test")
        (invoke "mix" "do" "compile" "--no-deps-check" "--no-prune-code-paths" "+"
                "test" "--no-deps-check"))
        (apply invoke "mix" "do" "compile" "--no-deps-check"
                       "--no-prune-code-paths" "+" "test"
                       "--no-deps-check" test-flags))
      (format #t "tests? = ~a~%" tests?)))

(define* (remove-mix-dirs . _)