about summary refs log tree commit diff
path: root/nixos/tests/chromium.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-11-19 15:48:14 +0100
committeraszlig <aszlig@redmoonstudios.org>2014-11-19 15:54:19 +0100
commitad87aef2ab46423fca575aa99194bb6192c43a26 (patch)
tree768fdc16d43db716bdb026389b86054ca42327fc /nixos/tests/chromium.nix
parent3a77a2e409c967d609a1ad5e77f32fec9d0bb937 (diff)
nixos/tests/chromium: Allow to override packages.
Of course, this could be done via packageOverrides, but this is more
explicit and makes it possible to run the tests with various Chromium
overrides.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos/tests/chromium.nix')
-rw-r--r--nixos/tests/chromium.nix19
1 files changed, 13 insertions, 6 deletions
diff --git a/nixos/tests/chromium.nix b/nixos/tests/chromium.nix
index 71fa1e5268f30..d571a43581648 100644
--- a/nixos/tests/chromium.nix
+++ b/nixos/tests/chromium.nix
@@ -1,4 +1,12 @@
-import ./make-test.nix ({ pkgs, ... }: rec {
+import ./make-test.nix (
+{ pkgs
+, channelMap ? {
+    stable = pkgs.chromium;
+    beta   = pkgs.chromiumBeta;
+    dev    = pkgs.chromiumDev;
+  }
+, ...
+}: rec {
   name = "chromium";
 
   machine.imports = [ ./common/x11.nix ];
@@ -116,11 +124,10 @@ import ./make-test.nix ({ pkgs, ... }: rec {
       $machine->shutdown;
     }
 
-    for (
-      ["stable", "${pkgs.chromium}"],
-      ["beta",   "${pkgs.chromiumBeta}"],
-      ["dev",    "${pkgs.chromiumDev}"]
-    ) {
+    for (${let
+      mkArray = name: pkg: "[\"${name}\", \"${pkg}\"]";
+      chanArrays = pkgs.lib.mapAttrsToList mkArray channelMap;
+    in pkgs.lib.concatStringsSep ", " chanArrays}) {
       my ($channel, $pkg) = @$_;
       chromiumTest $channel, $pkg, sub {
         testNewWin "check sandbox", sub {