summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Eure <ian@retrospec.tv>2025-12-31 10:22:03 -0800
committerEfraim Flashner <efraim@flashner.co.il>2026-01-01 13:36:38 +0200
commit68e9cb0d21b49a728581ab41f9de0a14025329f5 (patch)
tree3e4e25d446449482a373d1074082119ec8664aa7
parent7d4db1a37c39019c0840fe074f90df0b7be3c120 (diff)
gnu: services: Name xorg tests.
* tests/services/xorg.scm: Name tests. Change-Id: I7be7438a69a5d55d5904c3b76a2888393291b6bb Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
-rw-r--r--tests/services/xorg.scm62
1 files changed, 26 insertions, 36 deletions
diff --git a/tests/services/xorg.scm b/tests/services/xorg.scm
index d778d0c269b..5a97c89945e 100644
--- a/tests/services/xorg.scm
+++ b/tests/services/xorg.scm
@@ -59,16 +59,14 @@
59 (xorg-configuration 59 (xorg-configuration
60 (keyboard-layout (keyboard-layout "us" #:options '("ctrl:esc"))))) 60 (keyboard-layout (keyboard-layout "us" #:options '("ctrl:esc")))))
61 61
62;; Later keyboard layouts replace earlier defaults 62(test-equal "later keyboard layouts replace earlier defaults"
63(test-equal 63 (keyboard-layout "us" #:options '("ctrl:nocaps"))
64 (keyboard-layout "us" #:options '("ctrl:nocaps"))
65 (xorg-configuration-keyboard-layout 64 (xorg-configuration-keyboard-layout
66 (merge-xorg-configurations 65 (merge-xorg-configurations
67 (list %config-empty %config-xorg-keyboard-layout-1)))) 66 (list %config-empty %config-xorg-keyboard-layout-1))))
68 67
69;; Later keyboard layouts replace earlier customizations. 68(test-equal "later keyboard layouts replace earlier customizations"
70(test-equal 69 (keyboard-layout "us" #:options '("ctrl:esc"))
71 (keyboard-layout "us" #:options '("ctrl:esc"))
72 (xorg-configuration-keyboard-layout 70 (xorg-configuration-keyboard-layout
73 (merge-xorg-configurations (list %config-empty 71 (merge-xorg-configurations (list %config-empty
74 %config-xorg-keyboard-layout-1 72 %config-xorg-keyboard-layout-1
@@ -110,16 +108,14 @@
110 (inherit %config-custom-server-2) 108 (inherit %config-custom-server-2)
111 (server-arguments %custom-server-2-arguments))) 109 (server-arguments %custom-server-2-arguments)))
112 110
113;; Custom server is prioritized over earlier default. 111(test-equal "custom server is prioritized over earlier default"
114(test-equal 112 %custom-server-1
115 %custom-server-1
116 (xorg-configuration-server 113 (xorg-configuration-server
117 (merge-xorg-configurations (list %config-empty 114 (merge-xorg-configurations (list %config-empty
118 %config-custom-server-1)))) 115 %config-custom-server-1))))
119 116
120;; Custom server preserves arguments. 117(test-equal "custom server preserves arguments"
121(test-equal 118 (list %custom-server-1 %custom-server-1-arguments)
122 (list %custom-server-1 %custom-server-1-arguments)
123 (let ((cfg (merge-xorg-configurations 119 (let ((cfg (merge-xorg-configurations
124 (list 120 (list
125 %config-empty 121 %config-empty
@@ -127,9 +123,8 @@
127 (list (xorg-configuration-server cfg) 123 (list (xorg-configuration-server cfg)
128 (xorg-configuration-server-arguments cfg)))) 124 (xorg-configuration-server-arguments cfg))))
129 125
130;; Later custom arguments replace earlier. 126(test-equal "later custom arguments replace earlier"
131(test-equal 127 (list %custom-server-2 %custom-server-2-arguments)
132 (list %custom-server-2 %custom-server-2-arguments)
133 (let ((cfg (merge-xorg-configurations 128 (let ((cfg (merge-xorg-configurations
134 (list 129 (list
135 %config-empty 130 %config-empty
@@ -138,46 +133,42 @@
138 (list (xorg-configuration-server cfg) 133 (list (xorg-configuration-server cfg)
139 (xorg-configuration-server-arguments cfg)))) 134 (xorg-configuration-server-arguments cfg))))
140 135
141;; Custom server is prioritized over later default. 136(test-equal "custom server is prioritized over later default"
142(test-equal 137 %custom-server-1
143 %custom-server-1
144 (xorg-configuration-server 138 (xorg-configuration-server
145 (merge-xorg-configurations (list %config-custom-server-1 139 (merge-xorg-configurations (list %config-custom-server-1
146 %config-empty)))) 140 %config-empty))))
147 141
148;; Custom arguments are prioritized over earlier custom server. 142(test-equal "custom arguments are prioritized over earlier custom server"
149(test-equal 143 %custom-server-2-arguments
150 %custom-server-2-arguments
151 (xorg-configuration-server-arguments 144 (xorg-configuration-server-arguments
152 (merge-xorg-configurations 145 (merge-xorg-configurations
153 (list 146 (list
154 (xorg-configuration (server %custom-server-1)) 147 (xorg-configuration (server %custom-server-1))
155 (xorg-configuration (server-arguments %custom-server-2-arguments)))))) 148 (xorg-configuration (server-arguments %custom-server-2-arguments))))))
156 149
157;; Later custom servers are prioritized over earlier. 150(test-equal "later custom servers are prioritized over earlier 1/3"
158(test-equal 151 %custom-server-2
159 %custom-server-2
160 (xorg-configuration-server 152 (xorg-configuration-server
161 (merge-xorg-configurations (list %config-custom-server-1 153 (merge-xorg-configurations (list %config-custom-server-1
162 %config-empty 154 %config-empty
163 %config-custom-server-2)))) 155 %config-custom-server-2))))
164 156
165(test-equal 157(test-equal "later custom servers are prioritized over earlier 2/3"
166 %custom-server-2 158 %custom-server-2
167 (xorg-configuration-server 159 (xorg-configuration-server
168 (merge-xorg-configurations (list %config-empty 160 (merge-xorg-configurations (list %config-empty
169 %config-custom-server-1 161 %config-custom-server-1
170 %config-custom-server-2)))) 162 %config-custom-server-2))))
171 163
172(test-equal 164(test-equal "later custom servers are prioritized over earlier 3/3"
173 %custom-server-1 165 %custom-server-1
174 (xorg-configuration-server 166 (xorg-configuration-server
175 (merge-xorg-configurations (list %config-empty 167 (merge-xorg-configurations (list %config-empty
176 %config-custom-server-1)))) 168 %config-custom-server-1))))
177 169
178;; Make sure it works in the context of an operating-system. 170(test-equal "in the context of an operating-system"
179(test-equal 171 %custom-server-2
180 %custom-server-2
181 (let ((os (operating-system 172 (let ((os (operating-system
182 (host-name "test") 173 (host-name "test")
183 (bootloader 174 (bootloader
@@ -208,11 +199,10 @@
208 199
209;; extra-config tests. 200;; extra-config tests.
210 201
211;; Extra configurations append.
212(let ((snippet-one "# First") 202(let ((snippet-one "# First")
213 (snippet-two "# Second")) 203 (snippet-two "# Second"))
214 (test-equal 204 (test-equal "extra configurations append"
215 (list snippet-one snippet-two) 205 (list snippet-one snippet-two)
216 (xorg-configuration-extra-config 206 (xorg-configuration-extra-config
217 (merge-xorg-configurations 207 (merge-xorg-configurations
218 (list (xorg-configuration (extra-config (list snippet-one))) 208 (list (xorg-configuration (extra-config (list snippet-one)))
@@ -223,8 +213,8 @@
223(define %drivers-custom-1 '("done")) 213(define %drivers-custom-1 '("done"))
224(define %drivers-custom-2 '("dtwo")) 214(define %drivers-custom-2 '("dtwo"))
225 215
226(test-equal 216(test-equal "drivers append"
227 (append %drivers-custom-1 %drivers-custom-2) 217 (append %drivers-custom-1 %drivers-custom-2)
228 (xorg-configuration-drivers 218 (xorg-configuration-drivers
229 (merge-xorg-configurations 219 (merge-xorg-configurations
230 (list 220 (list