summaryrefslogtreecommitdiff
path: root/tests/utils.scm
diff options
context:
space:
mode:
authorMaxime Devos <maximedevos@telenet.be>2021-07-14 13:12:49 +0200
committerMathieu Othacehe <othacehe@gnu.org>2021-07-14 15:38:03 +0200
commitf54852be22c29a0d5b174d15ef6189c57cab2017 (patch)
tree94803e0923752cc5bc673338ca3c4ab0bf593095 /tests/utils.scm
parent42e41181502b1844263a9e0d50f6281444022576 (diff)
utils: Define a target-x86-32? and target-x86-64? predicate.
* guix/utils.scm (target-x86-32?, target-x86-64?): New predicates. * tests/utils.scm ("target-x86-32?", "target-x86-64?"): New tests. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Diffstat (limited to 'tests/utils.scm')
-rw-r--r--tests/utils.scm23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm
index e1700709070..648e91f242d 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -306,6 +306,29 @@ skip these tests."
306 '("i686-linux-gnu" "i686-pc-gnu" 306 '("i686-linux-gnu" "i686-pc-gnu"
307 "i686-w64-mingw32"))) 307 "i686-w64-mingw32")))
308 308
309(test-equal "target-x86-32?"
310 '(#f #f #f #t #t #t #t #f)
311 ;; These are (according to Wikipedia) two RISC architectures
312 ;; by Intel and presumably not compatible with the x86-32 series.
313 (map target-x86-32?
314 '("i860-gnu" "i960-gnu"
315 ;; This is a 16-bit architecture
316 "i286-gnu"
317 ;; These are part of the x86-32 series.
318 "i386-gnu" "i486-gnu" "i586-gnu" "i686-gnu"
319 ;; Maybe this one will exist some day, but not yet.
320 "i786-gnu")))
321
322(test-equal "target-x86-64?"
323 '(#t #f #f #f)
324 (map target-x86-64?
325 `("x86_64-linux-gnu" "i386-linux-gnu"
326 ;; Just because it includes "64" doesn't make it 64-bit.
327 "aarch64-linux-gnu"
328 ;; Note that (expt 2 109) in decimal notation starts with 64.
329 ;; However, it isn't 32-bit.
330 ,(format #f "x86_~a-linux-gnu" (expt 2 109)))))
331
309(test-end) 332(test-end)
310 333
311(false-if-exception (delete-file temp-file)) 334(false-if-exception (delete-file temp-file))