move functions to lib/testing to allow easier use outside of nixos
svn path=/nixos/trunk/; revision=20072
This commit is contained in:
parent
c17a76279d
commit
d79d934d85
@ -80,5 +80,19 @@ rec {
|
|||||||
ensureDir $out/nix-support
|
ensureDir $out/nix-support
|
||||||
echo "report coverage $out/coverage" >> $out/nix-support/hydra-build-products
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,23 +9,7 @@ let
|
|||||||
(import ../lib/build-vms.nix { inherit nixpkgs services system; }) //
|
(import ../lib/build-vms.nix { inherit nixpkgs services system; }) //
|
||||||
(import ../lib/testing.nix { inherit nixpkgs services system; });
|
(import ../lib/testing.nix { inherit nixpkgs services system; });
|
||||||
|
|
||||||
in with testLib; let
|
in with testLib;
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
{
|
{
|
||||||
firefox = apply (import ./firefox.nix);
|
firefox = apply (import ./firefox.nix);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user