aboutsummaryrefslogtreecommitdiff
path: root/tests/modules/programs
diff options
context:
space:
mode:
authorNikita Uvarov <uv.nikita@gmail.com>2020-05-26 14:19:13 +0200
committerRobert Helgesson <robert@rycee.net>2020-05-26 19:04:25 +0200
commit09304026aecad607199bbc0cc4d7fb010820e22a (patch)
treeceae04469251b0a5cadc5089729078bfbf2303b9 /tests/modules/programs
parentb95ad632010bf1d135f7585c590f51f6c3dc2896 (diff)
autorandr: add basic configuration test
Diffstat (limited to 'tests/modules/programs')
-rw-r--r--tests/modules/programs/autorandr/basic-configuration.conf9
-rw-r--r--tests/modules/programs/autorandr/basic-configuration.nix47
-rw-r--r--tests/modules/programs/autorandr/default.nix1
3 files changed, 57 insertions, 0 deletions
diff --git a/tests/modules/programs/autorandr/basic-configuration.conf b/tests/modules/programs/autorandr/basic-configuration.conf
new file mode 100644
index 00000000000..980d4d7181e
--- /dev/null
+++ b/tests/modules/programs/autorandr/basic-configuration.conf
@@ -0,0 +1,9 @@
+output DP1
+off
+
+output DP2
+pos 0x0
+primary
+mode 1920x1080
+transform 0.600000,0.000000,0.000000,0.000000,0.600000,0.000000,0.000000,0.000000,1.000000
+scale 2x4 \ No newline at end of file
diff --git a/tests/modules/programs/autorandr/basic-configuration.nix b/tests/modules/programs/autorandr/basic-configuration.nix
new file mode 100644
index 00000000000..852094c03fa
--- /dev/null
+++ b/tests/modules/programs/autorandr/basic-configuration.nix
@@ -0,0 +1,47 @@
+{ config, pkgs, ... }:
+
+{
+ config = {
+ programs.autorandr = {
+ enable = true;
+ profiles = {
+ default = {
+ fingerprint = {
+ DP1 = "XXX";
+ DP2 = "YYY";
+ };
+ config = {
+ DP1.enable = false;
+ DP2 = {
+ primary = true;
+ position = "0x0";
+ mode = "1920x1080";
+ scale = {
+ x = 2;
+ y = 4;
+ };
+ transform = [
+ [ 0.6 0.0 0.0 ] # a b c
+ [ 0.0 0.6 0.0 ] # d e f
+ [ 0.0 0.0 1.0 ] # g h i
+ ];
+ };
+ };
+ };
+ };
+ };
+
+ nmt.script = ''
+ config=home-files/.config/autorandr/default/config
+ setup=home-files/.config/autorandr/default/setup
+
+ assertFileExists $setup
+ assertFileRegex $setup 'DP1 XXX'
+ assertFileRegex $setup 'DP2 YYY'
+
+ assertFileExists $config
+ assertFileContent $config \
+ ${./basic-configuration.conf}
+ '';
+ };
+}
diff --git a/tests/modules/programs/autorandr/default.nix b/tests/modules/programs/autorandr/default.nix
new file mode 100644
index 00000000000..5f12d409380
--- /dev/null
+++ b/tests/modules/programs/autorandr/default.nix
@@ -0,0 +1 @@
+{ autorandr-basic-configuration = ./basic-configuration.nix; }