about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-04-03 03:50:55 +0200
committeraszlig <aszlig@nix.build>2018-04-03 03:50:55 +0200
commite603e0fd1ed6e919beb8d31d3c69ad70f002f539 (patch)
treed29472f08baf477ffc0cb615fe9eb4835d0f89be /tests
parent2cde2ae48b0e8c4cc2d73b4fd2e40c1a8a7006ad (diff)
tests: Pass in nixpkgs source from release.nix
Another point where we rely on nixpkgs-path.nix from within release.nix,
where we already have the correct path to nixpkgs passed as an argument.

So let's simply pass that argument along to the actual test.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'tests')
-rw-r--r--tests/default.nix7
-rw-r--r--tests/make-test.nix12
2 files changed, 13 insertions, 6 deletions
diff --git a/tests/default.nix b/tests/default.nix
index c9cafe6c..44167e07 100644
--- a/tests/default.nix
+++ b/tests/default.nix
@@ -1,8 +1,11 @@
-{ system ? builtins.currentSystem, ... }:
+{ system ? builtins.currentSystem
+, nixpkgsPath ? import ../nixpkgs-path.nix
+, ...
+}:
 
 let
   callTest = path: import ./make-test.nix (import path) {
-    inherit system;
+    inherit system nixpkgsPath;
   };
 
 in {
diff --git a/tests/make-test.nix b/tests/make-test.nix
index d98ff87f..6015023d 100644
--- a/tests/make-test.nix
+++ b/tests/make-test.nix
@@ -1,5 +1,9 @@
-f: { system ? builtins.currentSystem, ... } @ args: let
-  nixpkgsPath = import ../nixpkgs-path.nix;
+testFun:
+
+{ system ? builtins.currentSystem
+, nixpkgsPath ? import ../nixpkgs-path.nix
+, ...
+}@args: let
 
   lib = import "${nixpkgsPath}/lib";
 
@@ -9,11 +13,11 @@ f: { system ? builtins.currentSystem, ... } @ args: let
 
   pkgs = import nixpkgsPath { inherit system; };
 
-  testArgs = if builtins.isFunction f then f (args // {
+  testArgs = if builtins.isFunction testFun then testFun (args // {
     pkgs = pkgs // {
       vuizvui = import ../pkgs { inherit pkgs; };
     };
-  }) else f;
+  }) else testFun;
 
   nodes = testArgs.nodes or (if testArgs ? machine then {
     inherit (testArgs) machine;