diff options
| -rw-r--r-- | Makefile.am | 45 | ||||
| -rw-r--r-- | configure.ac | 3 | ||||
| -rw-r--r-- | daemon.am | 6 | ||||
| -rw-r--r-- | m4/guix.m4 | 7 |
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 | ||
| 138 | if HAVE_GUILE_JSON | ||
| 139 | |||
| 140 | MODULES += \ | ||
| 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 | |||
| 148 | endif | ||
| 149 | |||
| 138 | if BUILD_SYSCALLS_MODULE | 150 | if BUILD_SYSCALLS_MODULE |
| 139 | 151 | ||
| 140 | MODULES += \ | 152 | MODULES += \ |
| @@ -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. | ||
| 207 | TEST_EXTENSIONS = .scm .sh | ||
| 208 | |||
| 209 | if CAN_RUN_TESTS | ||
| 210 | |||
| 194 | SCM_TESTS = \ | 211 | SCM_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 | ||
| 234 | if HAVE_GUILE_JSON | 251 | if HAVE_GUILE_JSON |
| 235 | 252 | ||
| 236 | MODULES += \ | ||
| 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 | |||
| 244 | SCM_TESTS += \ | 253 | SCM_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 | ||
| 273 | TESTS = $(SCM_TESTS) $(SH_TESTS) | 282 | TESTS = $(SCM_TESTS) $(SH_TESTS) |
| 274 | 283 | ||
| 275 | TEST_EXTENSIONS = .scm .sh | ||
| 276 | |||
| 277 | AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" | 284 | AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" |
| 278 | 285 | ||
| 279 | SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE) | 286 | SCM_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 | ||
| 299 | else !CAN_RUN_TESTS | ||
| 300 | |||
| 301 | TESTS = | ||
| 302 | SH_TESTS = | ||
| 303 | SCM_TESTS = | ||
| 304 | |||
| 305 | # Automake always generates a 'check' target, so better not override it. | ||
| 306 | check-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 | |||
| 313 | endif !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. |
| 293 | dist_pkgdata_DATA = hydra.gnu.org.pub | 316 | dist_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]) | |||
| 60 | AC_SUBST([guix_sysconfdir]) | 60 | AC_SUBST([guix_sysconfdir]) |
| 61 | AC_SUBST([guix_sbindir]) | 61 | AC_SUBST([guix_sbindir]) |
| 62 | 62 | ||
| 63 | GUIX_CHECK_FILE_NAME_LIMITS | 63 | GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests]) |
| 64 | AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"]) | ||
| 64 | 65 | ||
| 65 | dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.) | 66 | dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.) |
| 66 | dnl Make sure they are available. | 67 | dnl Make sure they are available. |
| @@ -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 | ||
| 211 | if CAN_RUN_TESTS | ||
| 212 | |||
| 211 | AM_TESTS_ENVIRONMENT += \ | 213 | AM_TESTS_ENVIRONMENT += \ |
| 212 | top_builddir="$(abs_top_builddir)" | 214 | top_builddir="$(abs_top_builddir)" |
| 213 | 215 | ||
| 214 | TESTS += \ | 216 | TESTS += \ |
| 215 | tests/guix-daemon.sh | 217 | tests/guix-daemon.sh |
| 216 | 218 | ||
| 219 | endif CAN_RUN_TESTS | ||
| 220 | |||
| 217 | clean-local: | 221 | clean-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], [ | |||
| 215 | dnl GUIX_CHECK_FILE_NAME_LIMITS | 215 | dnl GUIX_CHECK_FILE_NAME_LIMITS |
| 216 | dnl | 216 | dnl |
| 217 | dnl GNU/Linux has a couple of silly limits that we can easily run into. | 217 | dnl GNU/Linux has a couple of silly limits that we can easily run into. |
| 218 | dnl Make sure everything is fine with the current settings. | 218 | dnl Make sure everything is fine with the current settings. Set $1 to |
| 219 | dnl 'yes' if tests can run, 'no' otherwise. | ||
| 219 | AC_DEFUN([GUIX_CHECK_FILE_NAME_LIMITS], [ | 220 | AC_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 | ]) |
