diff options
author | Rob Vermaas <rob.vermaas@gmail.com> | 2010-02-17 09:37:22 +0000 |
---|---|---|
committer | Rob Vermaas <rob.vermaas@gmail.com> | 2010-02-17 09:37:22 +0000 |
commit | d79d934d85ac340b8792cc6398c69256d9f46277 (patch) | |
tree | 55984bc7f2469a3dd28d779a8a6a03a5c7bdd27c /lib | |
parent | c17a76279dab7dd8dca83b6245757a6265fef80f (diff) | |
download | nixlib-d79d934d85ac340b8792cc6398c69256d9f46277.tar nixlib-d79d934d85ac340b8792cc6398c69256d9f46277.tar.gz nixlib-d79d934d85ac340b8792cc6398c69256d9f46277.tar.bz2 nixlib-d79d934d85ac340b8792cc6398c69256d9f46277.tar.lz nixlib-d79d934d85ac340b8792cc6398c69256d9f46277.tar.xz nixlib-d79d934d85ac340b8792cc6398c69256d9f46277.tar.zst nixlib-d79d934d85ac340b8792cc6398c69256d9f46277.zip |
move functions to lib/testing to allow easier use outside of nixos
svn path=/nixos/trunk/; revision=20072
Diffstat (limited to 'lib')
-rw-r--r-- | lib/testing.nix | 16 |
1 files changed, 15 insertions, 1 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; + }; + } |