aboutsummaryrefslogtreecommitdiff
path: root/tests/multiple-outputs.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tests/multiple-outputs.nix')
-rw-r--r--tests/multiple-outputs.nix46
1 files changed, 43 insertions, 3 deletions
diff --git a/tests/multiple-outputs.nix b/tests/multiple-outputs.nix
index 624a5dade..413d392e4 100644
--- a/tests/multiple-outputs.nix
+++ b/tests/multiple-outputs.nix
@@ -31,6 +31,15 @@ rec {
helloString = "Hello, world!";
};
+ use-a = mkDerivation {
+ name = "use-a";
+ inherit (a) first second;
+ builder = builtins.toFile "builder.sh"
+ ''
+ cat $first/file $second/file >$out
+ '';
+ };
+
b = mkDerivation {
defaultOutput = assert a.second.helloString == "Hello, world!"; a;
firstOutput = assert a.outputName == "first"; a.first.first;
@@ -82,9 +91,40 @@ rec {
e = mkDerivation {
name = "multiple-outputs-e";
- outputs = [ "a" "b" "c" ];
- meta.outputsToInstall = [ "a" "b" ];
- buildCommand = "mkdir $a $b $c";
+ outputs = [ "a_a" "b" "c" ];
+ meta.outputsToInstall = [ "a_a" "b" ];
+ buildCommand = "mkdir $a_a $b $c";
+ };
+
+ independent = mkDerivation {
+ name = "multiple-outputs-independent";
+ outputs = [ "first" "second" ];
+ builder = builtins.toFile "builder.sh"
+ ''
+ mkdir $first $second
+ test -z $all
+ echo "first" > $first/file
+ echo "second" > $second/file
+ '';
+ };
+
+ use-independent = mkDerivation {
+ name = "use-independent";
+ inherit (a) first second;
+ builder = builtins.toFile "builder.sh"
+ ''
+ cat $first/file $second/file >$out
+ '';
+ };
+
+ invalid-output-name-1 = mkDerivation {
+ name = "invalid-output-name-1";
+ outputs = [ "out/"];
+ };
+
+ invalid-output-name-2 = mkDerivation {
+ name = "invalid-output-name-2";
+ outputs = [ "x" "foo$"];
};
}