summaryrefslogtreecommitdiff
path: root/tests/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-05-27 23:41:35 +0200
committerLudovic Courtès <ludo@gnu.org>2013-05-27 23:43:00 +0200
commit9b222abe0349701280d48e4830f98aa07c947517 (patch)
treeb76c83e97f1c232fae4621ee288ef6ea2016744b /tests/packages.scm
parentea84ec7711a9935f28af3b392d43fe340c7919d0 (diff)
packages: Raise an error condition a cross builder is needed but unavailable.
* guix/packages.scm (&package-cross-build-system-error): New condition type. (package-cross-derivation): Raise &package-cross-build-system-error when the build system doesn't support cross builds. * guix/ui.scm (call-with-error-handling): Add package-cross-build-system-error? case. * tests/packages.scm ("package-cross-derivation, no cross builder"): New test.
Diffstat (limited to 'tests/packages.scm')
-rw-r--r--tests/packages.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index bec9de5b45..a4bb7fbd31 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -30,6 +30,7 @@
#:use-module (gnu packages bootstrap)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
+ #:use-module (srfi srfi-34)
#:use-module (srfi srfi-64)
#:use-module (rnrs io ports)
#:use-module (ice-9 match))
@@ -212,6 +213,16 @@
(and (derivation-path? drv-path)
(derivation? drv)))))
+(test-assert "package-cross-derivation, no cross builder"
+ (let* ((b (build-system (inherit trivial-build-system)
+ (cross-build #f)))
+ (p (package (inherit (dummy-package "p"))
+ (build-system b))))
+ (guard (c ((package-cross-build-system-error? c)
+ (eq? (package-error-package c) p)))
+ (package-cross-derivation %store p "mips64el-linux-gnu")
+ #f)))
+
(unless (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV))
(test-skip 1))
(test-assert "GNU Make, bootstrap"