···
{ pkgs, lib, callPackage, runCommand }:
4
+
/* Checks that two packages produce the exact same build instructions.
6
+
This can be used to make sure that a certain difference of configuration,
7
+
such as the presence of an overlay does not cause a cache miss.
9
+
When the derivations are equal, the return value is an empty file.
10
+
Otherwise, the build log explains the difference via `nix-diff`.
15
+
"The hello package must stay the same when enabling checks."
17
+
(hello.overrideAttrs(o: { doCheck = true; }))
testEqualDerivation = callPackage ./test-equal-derivation.nix { };
/* Checks the command output contains the specified version
7
-
* Although simplistic, this test assures that the main program
8
-
* can run. While there's no substitute for a real test case,
9
-
* it does catch dynamic linking errors and such. It also provides
10
-
* some protection against accidentally building the wrong version,
11
-
* for example when using an 'old' hash in a fixed-output derivation.
15
-
* passthru.tests.version = testVersion { package = hello; };
17
-
* passthru.tests.version = testVersion {
18
-
* package = seaweedfs;
19
-
* command = "weed version";
22
-
* passthru.tests.version = testVersion {
24
-
* command = "KeY --help";
25
-
* # Wrong '2.5' version in the code. Drop on next version.
23
+
Although simplistic, this test assures that the main program
24
+
can run. While there's no substitute for a real test case,
25
+
it does catch dynamic linking errors and such. It also provides
26
+
some protection against accidentally building the wrong version,
27
+
for example when using an 'old' hash in a fixed-output derivation.
31
+
passthru.tests.version = testVersion { package = hello; };
33
+
passthru.tests.version = testVersion {
34
+
package = seaweedfs;
35
+
command = "weed version";
38
+
passthru.tests.version = testVersion {
40
+
command = "KeY --help";
41
+
# Wrong '2.5' version in the code. Drop on next version.
command ? "${package.meta.mainProgram or package.pname or package.name} --version",