3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/tests/default.nix
Eelco Dolstra 51097933ab * Moved test-related stuff from lib/build-vms.nix to lib/testing.nix.
* Factored out some commonality between tests to make them a bit
  simpler to write.  A test is a function { pkgs, ... }: -> { nodes,
  testScript } or { machine, testScript }.  So it's no longer
  necessary to have a "vms" attribute in every test.

svn path=/nixos/trunk/; revision=19220
2010-01-05 11:18:43 +00:00

30 lines
698 B
Nix

{ nixpkgs ? ../../nixpkgs
, services ? ../../services
, system ? builtins.currentSystem
}:
let
testLib =
(import ../lib/build-vms.nix { inherit nixpkgs services system; }) //
(import ../lib/testing.nix { inherit nixpkgs services system; });
apply = testFun:
with testLib;
let
t = testFun { inherit pkgs testLib; };
in t // rec {
nodes = if t ? nodes then t.nodes else { machine = t.machine; };
vms = buildVirtualNetwork { inherit nodes; };
test = runTests vms t.testScript;
report = makeReport test;
};
in
{
kde4 = apply (import ./kde4.nix);
quake3 = apply (import ./quake3.nix);
subversion = apply (import ./subversion.nix);
}