diff --git a/tests/dependencies.nix b/tests/dependencies.nix index e320d81c9..45aca1793 100644 --- a/tests/dependencies.nix +++ b/tests/dependencies.nix @@ -27,6 +27,8 @@ let { input1 = input1 + "/."; input2 = "${input2}/."; input1_drv = input1; + input2_drv = input2; + input0_drv = input0; meta.description = "Random test package"; }; diff --git a/tests/local.mk b/tests/local.mk index 8580ecac9..93cf20d43 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -61,7 +61,8 @@ nix_tests = \ ca/concurrent-builds.sh \ ca/nix-copy.sh \ eval-store.sh \ - readfile-context.sh + readfile-context.sh \ + why-depends.sh # parallel.sh ifeq ($(HAVE_LIBCPUID), 1) diff --git a/tests/why-depends.sh b/tests/why-depends.sh new file mode 100644 index 000000000..11b54b5b6 --- /dev/null +++ b/tests/why-depends.sh @@ -0,0 +1,13 @@ +source common.sh + +clearStore + +cp ./dependencies.nix ./dependencies.builder0.sh ./config.nix $TEST_HOME + +cd $TEST_HOME + +nix-build ./dependencies.nix -A input0_drv -o dep +nix-build ./dependencies.nix -o toplevel + +nix why-depends ./toplevel ./dep | + grep input-2