me
/
guix
Archived
1
0
Fork 0

tests: Skip tests that would hit the shebang length limitation.

* tests/gexp.scm (shebang): New variable.
  Skip "gexp->script" when SHEBANG is longer than 127 chars.
* guix/gexp.scm (gexp->script): Add comment on the issue.
master
Ludovic Courtès 2014-06-04 17:26:54 +02:00
parent d3bbe992ec
commit c17b5ab4db
2 changed files with 12 additions and 0 deletions

View File

@ -351,6 +351,10 @@ its search path."
(gexp (gexp
(call-with-output-file (ungexp output) (call-with-output-file (ungexp output)
(lambda (port) (lambda (port)
;; Note: that makes a long shebang. When the store
;; is /gnu/store, that fits within the 128-byte
;; limit imposed by Linux, but that may go beyond
;; when running tests.
(format port (format port
"#!~a/bin/guile --no-auto-compile~%!#~%" "#!~a/bin/guile --no-auto-compile~%!#~%"
(ungexp guile)) (ungexp guile))

View File

@ -211,6 +211,14 @@
(return (string=? (readlink (string-append out "/foo")) (return (string=? (readlink (string-append out "/foo"))
guile)))) guile))))
(define shebang
(string-append (derivation->output-path guile-for-build)
"/bin/guile --no-auto-compile"))
;; If we're going to hit the silly shebang limit (128 chars on Linux-based
;; systems), then skip the following test.
(test-skip (if (> (string-length shebang) 127) 1 0))
(test-assertm "gexp->script" (test-assertm "gexp->script"
(mlet* %store-monad ((n -> (random (expt 2 50))) (mlet* %store-monad ((n -> (random (expt 2 50)))
(exp -> (gexp (exp -> (gexp