From d79d934d85ac340b8792cc6398c69256d9f46277 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Wed, 17 Feb 2010 09:37:22 +0000 Subject: [PATCH] move functions to lib/testing to allow easier use outside of nixos svn path=/nixos/trunk/; revision=20072 --- lib/testing.nix | 16 +++++++++++++++- tests/default.nix | 18 +----------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/lib/testing.nix b/lib/testing.nix index 834fa04ec0b0..1b0c3889190e 100644 --- a/lib/testing.nix +++ b/lib/testing.nix @@ -80,5 +80,19 @@ rec { ensureDir $out/nix-support echo "report coverage $out/coverage" >> $out/nix-support/hydra-build-products ''; # */ - + + call = f: f { inherit pkgs nixpkgs system; }; + + apply = testFun: complete (call testFun); + + complete = t: t // rec { + nodes = + if t ? nodes then t.nodes else + if t ? machine then { machine = t.machine; } + else { }; + vms = buildVirtualNetwork { inherit nodes; }; + test = runTests vms t.testScript; + report = makeReport test; + }; + } diff --git a/tests/default.nix b/tests/default.nix index a9661d339573..9c058ccadcc3 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -9,23 +9,7 @@ let (import ../lib/build-vms.nix { inherit nixpkgs services system; }) // (import ../lib/testing.nix { inherit nixpkgs services system; }); -in with testLib; let - - call = f: f { inherit pkgs nixpkgs system testLib; }; - - apply = testFun: complete (call testFun); - - complete = t: t // rec { - nodes = - if t ? nodes then t.nodes else - if t ? machine then { machine = t.machine; } - else { }; - vms = buildVirtualNetwork { inherit nodes; }; - test = runTests vms t.testScript; - report = makeReport test; - }; - -in +in with testLib; { firefox = apply (import ./firefox.nix);