summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-01-12 16:37:45 +0100
committerLudovic Courtès <ludo@gnu.org>2016-01-12 17:47:36 +0100
commitbb251307642242bb9174e9c4d89909ca40926d67 (patch)
treeecc5106bdecbc4534d957c82165ae19f797fcc91
parent27ab3cee754d89135083b778a00675d9a2d00415 (diff)
build: 'make check' errors out if file name limits would be hit.
* Makefile.am (SCM_TESTS, SH_TESTS, TESTS, AM_TESTS_ENVIRONMENT) (SCM_LOG_COMPILER, SH_LOG_COMPILER, AM_SCM_LOG_FLAGS) (AM_SH_LOG_FLAGS): Move within 'if CAN_RUN_TESTS'. (check-local) [!CAN_RUN_TESTS]: New target. * daemon.am (AM_TESTS_ENVIRONMENT, TESTS): Ditto. * m4/guix.m4 (GUIX_CHECK_FILE_NAME_LIMITS): Add parameter and set it.
-rw-r--r--Makefile.am45
-rw-r--r--configure.ac3
-rw-r--r--daemon.am6
-rw-r--r--m4/guix.m47
4 files changed, 47 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am
index 760caed8596..6e9deeb3d89 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
1# GNU Guix --- Functional package management for GNU 1# GNU Guix --- Functional package management for GNU
2# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> 2# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3# Copyright © 2013 Andreas Enge <andreas@enge.fr> 3# Copyright © 2013 Andreas Enge <andreas@enge.fr>
4# Copyright © 2015 Alex Kost <alezost@gmail.com> 4# Copyright © 2015 Alex Kost <alezost@gmail.com>
5# 5#
@@ -135,6 +135,18 @@ MODULES = \
135 guix.scm \ 135 guix.scm \
136 $(GNU_SYSTEM_MODULES) 136 $(GNU_SYSTEM_MODULES)
137 137
138if HAVE_GUILE_JSON
139
140MODULES += \
141 guix/import/json.scm \
142 guix/import/pypi.scm \
143 guix/scripts/import/pypi.scm \
144 guix/import/cpan.scm \
145 guix/scripts/import/gem.scm \
146 guix/import/gem.scm
147
148endif
149
138if BUILD_SYSCALLS_MODULE 150if BUILD_SYSCALLS_MODULE
139 151
140MODULES += \ 152MODULES += \
@@ -191,6 +203,11 @@ clean-go:
191 -$(RM) -f $(GOBJECTS) 203 -$(RM) -f $(GOBJECTS)
192 204
193 205
206# Test extensions; has to be unconditional.
207TEST_EXTENSIONS = .scm .sh
208
209if CAN_RUN_TESTS
210
194SCM_TESTS = \ 211SCM_TESTS = \
195 tests/base32.scm \ 212 tests/base32.scm \
196 tests/base64.scm \ 213 tests/base64.scm \
@@ -233,14 +250,6 @@ SCM_TESTS = \
233 250
234if HAVE_GUILE_JSON 251if HAVE_GUILE_JSON
235 252
236MODULES += \
237 guix/import/json.scm \
238 guix/import/pypi.scm \
239 guix/scripts/import/pypi.scm \
240 guix/import/cpan.scm \
241 guix/scripts/import/gem.scm \
242 guix/import/gem.scm
243
244SCM_TESTS += \ 253SCM_TESTS += \
245 tests/pypi.scm \ 254 tests/pypi.scm \
246 tests/cpan.scm \ 255 tests/cpan.scm \
@@ -272,8 +281,6 @@ endif BUILD_DAEMON
272 281
273TESTS = $(SCM_TESTS) $(SH_TESTS) 282TESTS = $(SCM_TESTS) $(SH_TESTS)
274 283
275TEST_EXTENSIONS = .scm .sh
276
277AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" 284AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
278 285
279SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE) 286SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
@@ -289,6 +296,22 @@ tests/guix-gc.log: \
289 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \ 296 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
290 $(SCM_TESTS:%.scm=%.log) 297 $(SCM_TESTS:%.scm=%.log)
291 298
299else !CAN_RUN_TESTS
300
301TESTS =
302SH_TESTS =
303SCM_TESTS =
304
305# Automake always generates a 'check' target, so better not override it.
306check-local:
307 @echo
308 @echo "Cannot run tests because file name limits would be exceeded." >&2
309 @echo "Look for 'length' in the 'config.log' file for details." >&2
310 @echo
311 @exit 1
312
313endif !CAN_RUN_TESTS
314
292# Public key used to sign substitutes from hydra.gnu.org. 315# Public key used to sign substitutes from hydra.gnu.org.
293dist_pkgdata_DATA = hydra.gnu.org.pub 316dist_pkgdata_DATA = hydra.gnu.org.pub
294 317
diff --git a/configure.ac b/configure.ac
index 0d06592b534..f61c04cac86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,7 +60,8 @@ AC_SUBST([guix_localstatedir])
60AC_SUBST([guix_sysconfdir]) 60AC_SUBST([guix_sysconfdir])
61AC_SUBST([guix_sbindir]) 61AC_SUBST([guix_sbindir])
62 62
63GUIX_CHECK_FILE_NAME_LIMITS 63GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests])
64AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"])
64 65
65dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.) 66dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
66dnl Make sure they are available. 67dnl Make sure they are available.
diff --git a/daemon.am b/daemon.am
index 324164359c5..ba4be50068b 100644
--- a/daemon.am
+++ b/daemon.am
@@ -1,5 +1,5 @@
1# GNU Guix --- Functional package management for GNU 1# GNU Guix --- Functional package management for GNU
2# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> 2# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3# 3#
4# This file is part of GNU Guix. 4# This file is part of GNU Guix.
5# 5#
@@ -208,12 +208,16 @@ EXTRA_DIST += \
208 etc/guix-daemon.service.in \ 208 etc/guix-daemon.service.in \
209 etc/guix-daemon.conf.in 209 etc/guix-daemon.conf.in
210 210
211if CAN_RUN_TESTS
212
211AM_TESTS_ENVIRONMENT += \ 213AM_TESTS_ENVIRONMENT += \
212 top_builddir="$(abs_top_builddir)" 214 top_builddir="$(abs_top_builddir)"
213 215
214TESTS += \ 216TESTS += \
215 tests/guix-daemon.sh 217 tests/guix-daemon.sh
216 218
219endif CAN_RUN_TESTS
220
217clean-local: 221clean-local:
218 -if test -d "$(GUIX_TEST_ROOT)"; then \ 222 -if test -d "$(GUIX_TEST_ROOT)"; then \
219 find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \ 223 find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \
diff --git a/m4/guix.m4 b/m4/guix.m4
index 96319b2c148..563ce516998 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -215,7 +215,8 @@ AC_DEFUN([GUIX_TEST_HASH_BANG_LENGTH], [
215dnl GUIX_CHECK_FILE_NAME_LIMITS 215dnl GUIX_CHECK_FILE_NAME_LIMITS
216dnl 216dnl
217dnl GNU/Linux has a couple of silly limits that we can easily run into. 217dnl GNU/Linux has a couple of silly limits that we can easily run into.
218dnl Make sure everything is fine with the current settings. 218dnl Make sure everything is fine with the current settings. Set $1 to
219dnl 'yes' if tests can run, 'no' otherwise.
219AC_DEFUN([GUIX_CHECK_FILE_NAME_LIMITS], [ 220AC_DEFUN([GUIX_CHECK_FILE_NAME_LIMITS], [
220 AC_REQUIRE([GUIX_SOCKET_FILE_NAME_LENGTH]) 221 AC_REQUIRE([GUIX_SOCKET_FILE_NAME_LENGTH])
221 AC_REQUIRE([GUIX_TEST_SOCKET_FILE_NAME_LENGTH]) 222 AC_REQUIRE([GUIX_TEST_SOCKET_FILE_NAME_LENGTH])
@@ -228,10 +229,14 @@ AC_DEFUN([GUIX_CHECK_FILE_NAME_LIMITS], [
228 if test "$ac_cv_guix_test_socket_file_name_length" -ge ]SOCKET_FILE_NAME_LIMIT[; then 229 if test "$ac_cv_guix_test_socket_file_name_length" -ge ]SOCKET_FILE_NAME_LIMIT[; then
229 AC_MSG_WARN([socket file name limit may be exceeded when running tests]) 230 AC_MSG_WARN([socket file name limit may be exceeded when running tests])
230 fi 231 fi
232
233 $1=yes
231 if test "$ac_cv_guix_hash_bang_length" -ge ]LINUX_HASH_BANG_LIMIT[; then 234 if test "$ac_cv_guix_hash_bang_length" -ge ]LINUX_HASH_BANG_LIMIT[; then
235 $1=no
232 AC_MSG_ERROR([store directory '$storedir' would lead to overly long hash-bang lines]) 236 AC_MSG_ERROR([store directory '$storedir' would lead to overly long hash-bang lines])
233 fi 237 fi
234 if test "$ac_cv_guix_test_hash_bang_length" -ge ]LINUX_HASH_BANG_LIMIT[; then 238 if test "$ac_cv_guix_test_hash_bang_length" -ge ]LINUX_HASH_BANG_LIMIT[; then
239 $1=no
235 AC_MSG_WARN([test directory '$ac_cv_guix_test_root' may lead to overly long hash-bang lines]) 240 AC_MSG_WARN([test directory '$ac_cv_guix_test_root' may lead to overly long hash-bang lines])
236 fi 241 fi
237]) 242])