summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-build.sh14
-rw-r--r--tests/scripts-build.scm23
2 files changed, 36 insertions, 1 deletions
diff --git a/tests/guix-build.sh b/tests/guix-build.sh
index f7fb3c5b64..347cdfa4e4 100644
--- a/tests/guix-build.sh
+++ b/tests/guix-build.sh
@@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2012, 2013, 2014, 2016 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
@@ -147,6 +147,18 @@ rm -f "$result"
# Cross building.
guix build coreutils --target=mips64el-linux-gnu --dry-run --no-substitutes
+# Replacements.
+drv1=`guix build guix --with-input=guile=guile-next -d`
+drv2=`guix build guix -d`
+test "$drv1" != "$drv2"
+
+drv1=`guix build guile -d`
+drv2=`guix build guile --with-input=gimp=ruby -d`
+test "$drv1" = "$drv2"
+
+if guix build guile --with-input=libunistring=something-really-silly
+then false; else true; fi
+
# Parsing package names and versions.
guix build -n time # PASS
guix build -n time-1.7 # PASS, version found
diff --git a/tests/scripts-build.scm b/tests/scripts-build.scm
index 75dc119e88..94ddaf447b 100644
--- a/tests/scripts-build.scm
+++ b/tests/scripts-build.scm
@@ -22,6 +22,9 @@
#:use-module (guix packages)
#:use-module (guix scripts build)
#:use-module (guix ui)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages busybox)
+ #:use-module (ice-9 match)
#:use-module (srfi srfi-64))
@@ -59,6 +62,26 @@
(string-contains (get-output-string port)
"had no effect"))))))
+(test-assert "options->transformation, with-input"
+ (let* ((p (dummy-package "guix.scm"
+ (inputs `(("foo" ,coreutils)
+ ("bar" ,grep)
+ ("baz" ,(dummy-package "chbouib"
+ (native-inputs `(("x" ,grep)))))))))
+ (t (options->transformation '((with-input . "coreutils=busybox")
+ (with-input . "grep=findutils")))))
+ (with-store store
+ (let ((new (t store p)))
+ (and (not (eq? new p))
+ (match (package-inputs new)
+ ((("foo" dep1) ("bar" dep2) ("baz" dep3))
+ (and (eq? dep1 busybox)
+ (eq? dep2 findutils)
+ (string=? (package-name dep3) "chbouib")
+ (match (package-native-inputs dep3)
+ ((("x" dep))
+ (eq? dep findutils)))))))))))
+
(test-end)