From 40c2edf91bcbbacda9956970aced4ffa7400f419 Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Sun, 21 Sep 2025 21:03:38 +0200 Subject: [PATCH] build-system: mix: Allow passing test flags. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- guix/build-system/mix.scm | 3 +++ guix/build/mix-build-system.scm | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/guix/build-system/mix.scm b/guix/build-system/mix.scm index f6de26adac1..4bfa4dcf0cb 100644 --- a/guix/build-system/mix.scm +++ b/guix/build-system/mix.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Pierre-Henry Fröhring +;;; Copyright © 2025 Giacomo Leidi ;;; ;;; 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 diff --git a/guix/build/mix-build-system.scm b/guix/build/mix-build-system.scm index 6b7541cf56c..c521657704e 100644 --- a/guix/build/mix-build-system.scm +++ b/guix/build/mix-build-system.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Pierre-Henry Fröhring ;;; Copyright © 2024 Igor Goryachev -;;; Copyright © 2024 Giacomo Leidi +;;; Copyright © 2024, 2025 Giacomo Leidi ;;; ;;; 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 . _)