# GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
# Copyright © 2013 Andreas Enge <andreas@enge.fr>
# Copyright © 2015 Alex Kost <alezost@gmail.com>
#
guix.scm \
$(GNU_SYSTEM_MODULES)
+if HAVE_GUILE_JSON
+
+MODULES += \
+ guix/import/json.scm \
+ guix/import/pypi.scm \
+ guix/scripts/import/pypi.scm \
+ guix/import/cpan.scm \
+ guix/scripts/import/gem.scm \
+ guix/import/gem.scm
+
+endif
+
if BUILD_SYSCALLS_MODULE
MODULES += \
-$(RM) -f $(GOBJECTS)
+# Test extensions; has to be unconditional.
+TEST_EXTENSIONS = .scm .sh
+
+if CAN_RUN_TESTS
+
SCM_TESTS = \
tests/base32.scm \
tests/base64.scm \
if HAVE_GUILE_JSON
-MODULES += \
- guix/import/json.scm \
- guix/import/pypi.scm \
- guix/scripts/import/pypi.scm \
- guix/import/cpan.scm \
- guix/scripts/import/gem.scm \
- guix/import/gem.scm
-
SCM_TESTS += \
tests/pypi.scm \
tests/cpan.scm \
TESTS = $(SCM_TESTS) $(SH_TESTS)
-TEST_EXTENSIONS = .scm .sh
-
AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
$(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
$(SCM_TESTS:%.scm=%.log)
+else !CAN_RUN_TESTS
+
+TESTS =
+SH_TESTS =
+SCM_TESTS =
+
+# Automake always generates a 'check' target, so better not override it.
+check-local:
+ @echo
+ @echo "Cannot run tests because file name limits would be exceeded." >&2
+ @echo "Look for 'length' in the 'config.log' file for details." >&2
+ @echo
+ @exit 1
+
+endif !CAN_RUN_TESTS
+
# Public key used to sign substitutes from hydra.gnu.org.
dist_pkgdata_DATA = hydra.gnu.org.pub
AC_SUBST([guix_sysconfdir])
AC_SUBST([guix_sbindir])
-GUIX_CHECK_FILE_NAME_LIMITS
+GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests])
+AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"])
dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
dnl Make sure they are available.
# GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
etc/guix-daemon.service.in \
etc/guix-daemon.conf.in
+if CAN_RUN_TESTS
+
AM_TESTS_ENVIRONMENT += \
top_builddir="$(abs_top_builddir)"
TESTS += \
tests/guix-daemon.sh
+endif CAN_RUN_TESTS
+
clean-local:
-if test -d "$(GUIX_TEST_ROOT)"; then \
find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \
dnl GUIX_CHECK_FILE_NAME_LIMITS
dnl
dnl GNU/Linux has a couple of silly limits that we can easily run into.
-dnl Make sure everything is fine with the current settings.
+dnl Make sure everything is fine with the current settings. Set $1 to
+dnl 'yes' if tests can run, 'no' otherwise.
AC_DEFUN([GUIX_CHECK_FILE_NAME_LIMITS], [
AC_REQUIRE([GUIX_SOCKET_FILE_NAME_LENGTH])
AC_REQUIRE([GUIX_TEST_SOCKET_FILE_NAME_LENGTH])
if test "$ac_cv_guix_test_socket_file_name_length" -ge ]SOCKET_FILE_NAME_LIMIT[; then
AC_MSG_WARN([socket file name limit may be exceeded when running tests])
fi
+
+ $1=yes
if test "$ac_cv_guix_hash_bang_length" -ge ]LINUX_HASH_BANG_LIMIT[; then
+ $1=no
AC_MSG_ERROR([store directory '$storedir' would lead to overly long hash-bang lines])
fi
if test "$ac_cv_guix_test_hash_bang_length" -ge ]LINUX_HASH_BANG_LIMIT[; then
+ $1=no
AC_MSG_WARN([test directory '$ac_cv_guix_test_root' may lead to overly long hash-bang lines])
fi
])