From fa89713c78749601b23d5de5df2d972a027894bf Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 23 May 2010 12:02:54 +0000 Subject: [PATCH] * Rename `apply' and `call'. svn path=/nixos/trunk/; revision=21944 --- lib/testing.nix | 11 ++++++----- tests/default.nix | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/testing.nix b/lib/testing.nix index f2cc29a33ebc..3486dd6fc9e8 100644 --- a/lib/testing.nix +++ b/lib/testing.nix @@ -84,10 +84,11 @@ rec { ''; # */ - # !!! Rename these functions to something more sensible. - call = f: f { inherit pkgs nixpkgs system; }; + makeTest = testFun: complete (call testFun); + makeTests = testsFun: lib.mapAttrs (name: complete) (call testsFun); - apply = testFun: complete (call testFun); + apply = makeTest; # compatibility + call = f: f { inherit pkgs nixpkgs system; }; complete = t: t // rec { nodes = @@ -173,10 +174,10 @@ rec { runInMachine ({ machine = client; preBuild = '' - $client->waitForX ; + $client->waitForX; '' ; } // args ); - simpleTest = as: (apply ({ ... }: as)).test; + simpleTest = as: (makeTest ({ ... }: as)).test; } diff --git a/tests/default.nix b/tests/default.nix index 21f9a66de08b..dfccce3851c3 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -6,16 +6,16 @@ with import ../lib/testing.nix { inherit nixpkgs services system; }; { - bittorrent = apply (import ./bittorrent.nix); - firefox = apply (import ./firefox.nix); - installer = pkgs.lib.mapAttrs (name: complete) (call (import ./installer.nix)); - kde4 = apply (import ./kde4.nix); - login = apply (import ./login.nix); - nat = apply (import ./nat.nix); - openssh = apply (import ./openssh.nix); - portmap = apply (import ./portmap.nix); - proxy = apply (import ./proxy.nix); - quake3 = apply (import ./quake3.nix); - subversion = apply (import ./subversion.nix); - trac = apply (import ./trac.nix); + bittorrent = makeTest (import ./bittorrent.nix); + firefox = makeTest (import ./firefox.nix); + installer = makeTests (import ./installer.nix); + kde4 = makeTest (import ./kde4.nix); + login = makeTest (import ./login.nix); + nat = makeTest (import ./nat.nix); + openssh = makeTest (import ./openssh.nix); + portmap = makeTest (import ./portmap.nix); + proxy = makeTest (import ./proxy.nix); + quake3 = makeTest (import ./quake3.nix); + subversion = makeTest (import ./subversion.nix); + trac = makeTest (import ./trac.nix); }