1 import ./make-test-python.nix ({ pkgs, ...} :
5 # Build Quake with coverage instrumentation.
8 quake3game = pkgs.quake3game.override (args: {
9 stdenv = pkgs.stdenvAdapters.addCoverageInstrumentation args.stdenv;
13 # Only allow the demo data to be used (only if it's unfreeRedistributable).
14 unfreePredicate = pkg: with pkgs.lib; let
15 allowPackageNames = [ "quake3-demodata" "quake3-pointrelease" ];
16 allowLicenses = [ pkgs.lib.licenses.unfreeRedistributable ];
17 in elem pkg.pname allowPackageNames &&
18 elem (pkg.meta.license or null) allowLicenses;
23 { imports = [ ./common/x11.nix ];
24 hardware.opengl.driSupport = true;
25 environment.systemPackages = [ pkgs.quake3demo ];
26 nixpkgs.config.packageOverrides = overrides;
27 nixpkgs.config.allowUnfreePredicate = unfreePredicate;
34 meta = with pkgs.stdenv.lib.maintainers; {
35 maintainers = [ domenkozar eelco ];
38 # TODO: lcov doesn't work atm
39 #makeCoverageReport = true;
45 { systemd.services.quake3-server =
46 { wantedBy = [ "multi-user.target" ];
48 "${pkgs.quake3demo}/bin/quake3-server +set g_gametype 0 " +
49 "+map q3dm7 +addbot grunt +addbot daemia 2> /tmp/log";
51 nixpkgs.config.packageOverrides = overrides;
52 nixpkgs.config.allowUnfreePredicate = unfreePredicate;
53 networking.firewall.allowedUDPPorts = [ 27960 ];
64 server.wait_for_unit("quake3-server")
68 client1.execute("quake3 +set r_fullscreen 0 +set name Foo +connect server &")
69 client2.execute("quake3 +set r_fullscreen 0 +set name Bar +connect server &")
71 server.wait_until_succeeds("grep -q 'Foo.*entered the game' /tmp/log")
72 server.wait_until_succeeds("grep -q 'Bar.*entered the game' /tmp/log")
74 server.sleep(10) # wait for a while to get a nice screenshot
80 client1.screenshot("screen1")
81 client2.screenshot("screen2")
87 client1.screenshot("screen3")
88 client2.screenshot("screen4")
92 server.stop_job("quake3-server")