about summary refs log tree commit diff
path: root/tests/binary-patching.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tests/binary-patching.nix')
-rw-r--r--tests/binary-patching.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/binary-patching.nix b/tests/binary-patching.nix
new file mode 100644
index 000000000000..8ed474d1f27f
--- /dev/null
+++ b/tests/binary-patching.nix
@@ -0,0 +1,18 @@
+{ version }:
+
+with import ./config.nix;
+
+mkDerivation {
+  name = "foo-${toString version}";
+  builder = builtins.toFile "builder.sh"
+    ''
+      mkdir $out
+      (for ((n = 1; n < 100000; n++)); do echo $n; done) > $out/foo
+      ${if version != 1 then ''
+        (for ((n = 100000; n < 110000; n++)); do echo $n; done) >> $out/foo
+      '' else ""}
+      ${if version == 3 then ''
+        echo foobar >> $out/foo
+      '' else ""}
+    '';
+}