guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 99cce67f7be654af240f2d74dc63f5c756a5bb80
Author: Jelle Licht <[email protected]>
AuthorDate: Thu Oct 15 14:28:10 2026 +0200

    build: Distribute the tests even when they cannot be run.
    
    With long build directory names, test files were not included in a tarball.
    
    * Makefile.am (SCM_TESTS, SH_TESTS): Define unconditionally.
    [!CAN_RUN_TESTS] (SCM_TESTS, SH_TESTS): Remove.
    [!CAN_RUN_TESTS] (EXTRA_DIST): Add $(SCM_TESTS) and $(SH_TESTS).
    * nix/local.mk (EXTRA_DIST) [!CAN_RUN_TESTS]: Add tests/guix-daemon.sh.
---
 Makefile.am  | 9 +++++----
 nix/local.mk | 8 +++++++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 99fa90a923a..6e067ab8c22 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -537,8 +537,6 @@ clean-go:
 # Test extensions; has to be unconditional.
 TEST_EXTENSIONS = .scm .sh
 
-if CAN_RUN_TESTS
-
 SCM_TESTS =                                    \
   tests/accounts.scm                           \
   tests/base16.scm                             \
@@ -694,6 +692,8 @@ SH_TESTS =                                  \
   tests/guix-repl.sh                           \
   tests/guix-lint.sh
 
+if CAN_RUN_TESTS
+
 TESTS = $(SCM_TESTS) $(SH_TESTS)
 
 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
@@ -720,8 +720,9 @@ tests/store.log: $(filter-out tests/guix-gc.log 
tests/store.log,$(TEST_LOGS))
 else !CAN_RUN_TESTS
 
 TESTS =
-SH_TESTS =
-SCM_TESTS =
+
+# 'TESTS' is empty: distribute the tests explicitly.
+EXTRA_DIST += $(SCM_TESTS) $(SH_TESTS)
 
 # Automake always generates a 'check' target, so better not override it.
 check-local:
diff --git a/nix/local.mk b/nix/local.mk
index 9a529da0000..c7544417e1a 100644
--- a/nix/local.mk
+++ b/nix/local.mk
@@ -226,7 +226,13 @@ AM_TESTS_ENVIRONMENT +=                            \
 TESTS +=                                       \
   tests/guix-daemon.sh
 
-endif CAN_RUN_TESTS
+else !CAN_RUN_TESTS
+
+# Distribute it anyway; see 'Makefile.am'.
+EXTRA_DIST +=                                  \
+  tests/guix-daemon.sh
+
+endif !CAN_RUN_TESTS
 
 clean-local:
        -if test -d "$(GUIX_TEST_ROOT)"; then           \

Reply via email to