1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (tests offload)
20 #:use-module (guix scripts offload)
21 #:use-module (srfi srfi-64))
24 (test-begin "offload")
26 (define-syntax-rule (expose-internal-definitions s1 s2 ...)
28 (define s1 (@@ (guix scripts offload) s1))
29 (define s2 (@@ (guix scripts offload) s2)) ...))
31 (expose-internal-definitions machine-matches?
32 build-requirements-system
33 build-requirements-features
37 %build-machine-systems
38 build-machine-features)
40 (define (deprecated-build-machine system)
47 (define (new-build-machine systems)
54 ;;; Test that deprecated build-machine definitions still work.
55 (test-assert (machine-matches? (deprecated-build-machine "i686-linux")
57 (system "i686-linux"))))
60 (test-assert (machine-matches? (new-build-machine '("i686-linux"))
62 (system "i686-linux"))))
64 ;;; A build machine can act as more than one system type, thanks to QEMU
66 (test-assert (machine-matches? (new-build-machine '("armhf-linux"
71 (system "armhf-linux"))))