| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 | (define-module (tests offload)
|
| 20 | #:use-module (guix scripts offload)
|
| 21 | #:use-module (srfi srfi-64))
|
| 22 |
|
| 23 |
|
| 24 | (test-begin "offload")
|
| 25 |
|
| 26 | (define-syntax-rule (expose-internal-definitions s1 s2 ...)
|
| 27 | (begin
|
| 28 | (define s1 (@@ (guix scripts offload) s1))
|
| 29 | (define s2 (@@ (guix scripts offload) s2)) ...))
|
| 30 |
|
| 31 | (expose-internal-definitions machine-matches?
|
| 32 | build-requirements-system
|
| 33 | build-requirements-features
|
| 34 | build-machine-system
|
| 35 | build-machine-systems
|
| 36 | %build-machine-system
|
| 37 | %build-machine-systems
|
| 38 | build-machine-features)
|
| 39 |
|
| 40 | (define (deprecated-build-machine system)
|
| 41 | (build-machine
|
| 42 | (name "m1")
|
| 43 | (user "dummy")
|
| 44 | (host-key "some-key")
|
| 45 | (system system)))
|
| 46 |
|
| 47 | (define (new-build-machine systems)
|
| 48 | (build-machine
|
| 49 | (name "m1")
|
| 50 | (user "dummy")
|
| 51 | (host-key "some-key")
|
| 52 | (systems systems)))
|
| 53 |
|
| 54 | |
| 55 | (test-assert (machine-matches? (deprecated-build-machine "i686-linux")
|
| 56 | (build-requirements
|
| 57 | (system "i686-linux"))))
|
| 58 |
|
| 59 |
|
| 60 | (test-assert (machine-matches? (new-build-machine '("i686-linux"))
|
| 61 | (build-requirements
|
| 62 | (system "i686-linux"))))
|
| 63 |
|
| 64 | |
| 65 | |
| 66 | (test-assert (machine-matches? (new-build-machine '("armhf-linux"
|
| 67 | "aarch64-linux"
|
| 68 | "i686-linux"
|
| 69 | "x86_64-linux"))
|
| 70 | (build-requirements
|
| 71 | (system "armhf-linux"))))
|