move functions to lib/testing to allow easier use outside of nixos

svn path=/nixos/trunk/; revision=20072
This commit is contained in:
Rob Vermaas 2010-02-17 09:37:22 +00:00
parent c17a76279d
commit d79d934d85
2 changed files with 16 additions and 18 deletions

View file

@ -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;
};
}

View file

@ -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);