* Use scrot to make screenshots.

* Another X11 test (running Quake 3).

svn path=/nixos/trunk/; revision=16949
This commit is contained in:
Eelco Dolstra 2009-09-02 23:16:33 +00:00
parent 05cb34c6d0
commit 497760b444
4 changed files with 51 additions and 8 deletions

View File

@ -138,11 +138,9 @@ rec {
mv $i $out/coverage-data/$(dirname $i)
done
for i in $out/*.xwd; do
j=$out/$(basename $i .xwd).png
${pkgs.imagemagick}/bin/convert $i $j
for i in $out/*.png; do
ensureDir $out/nix-support
echo "report screenshot $j" >> $out/nix-support/hydra-build-products
echo "report screenshot $i" >> $out/nix-support/hydra-build-products
done
''; # */
};

View File

@ -114,6 +114,14 @@ let
system = "i686-linux";
}).test;
tests.quake3 =
{ services ? ../services }:
(import ./tests/quake3.nix {
inherit nixpkgs services;
system = "i686-linux";
}).test;
};

View File

@ -27,8 +27,6 @@ rec {
services.xserver.desktopManager.default = "kde4";
services.xserver.desktopManager.kde4.enable = true;
services.sshd.enable = true;
users.extraUsers = pkgs.lib.singleton
{ name = "alice";
description = "Alice Foobar";
@ -38,7 +36,7 @@ rec {
password = "foobar";
};
environment.systemPackages = [ pkgs.xorg.xclock pkgs.xorg.xwd ];
environment.systemPackages = [ pkgs.scrot ];
};
};
@ -52,7 +50,7 @@ rec {
sleep 60;
print STDERR $client->execute("DISPLAY=:0.0 xwd -root > /hostfs/$ENV{out}/screen.xwd");
print STDERR $client->execute("DISPLAY=:0.0 scrot /hostfs/$ENV{out}/screen.png");
'';
}

39
tests/quake3.nix Normal file
View File

@ -0,0 +1,39 @@
{ nixos ? ./..
, nixpkgs ? /etc/nixos/nixpkgs
, services ? /etc/nixos/services
, system ? builtins.currentSystem
}:
with import ../lib/build-vms.nix { inherit nixos nixpkgs services system; };
rec {
nodes =
{ client =
{ config, pkgs, ... }:
{ services.xserver.enable = true;
services.xserver.driSupport = true;
environment.systemPackages = [ pkgs.scrot pkgs.xorg.twm pkgs.quake3demo ];
};
};
vms = buildVirtualNetwork { inherit nodes; };
test = runTests vms
''
startAll;
$client->waitForFile("/tmp/.X11-unix/X0");
sleep 20;
print STDERR $client->execute("DISPLAY=:0.0 quake3 &");
sleep 20;
print STDERR $client->execute("DISPLAY=:0.0 scrot /hostfs/$ENV{out}/screen.png");
'';
}