diff options
Diffstat (limited to 'tests/packages.scm')
| -rw-r--r-- | tests/packages.scm | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/packages.scm b/tests/packages.scm index 6deb21c3312..2a87f3f15d1 100644 --- a/tests/packages.scm +++ b/tests/packages.scm | |||
| @@ -281,9 +281,11 @@ | |||
| 281 | (s (build-system | 281 | (s (build-system |
| 282 | (name 'raw) | 282 | (name 'raw) |
| 283 | (description "Raw build system with direct store access") | 283 | (description "Raw build system with direct store access") |
| 284 | (lower (lambda* (name #:key source inputs #:allow-other-keys) | 284 | (lower (lambda* (name #:key source inputs system target |
| 285 | #:allow-other-keys) | ||
| 285 | (bag | 286 | (bag |
| 286 | (name name) | 287 | (name name) |
| 288 | (system system) (target target) | ||
| 287 | (build-inputs inputs) | 289 | (build-inputs inputs) |
| 288 | (build | 290 | (build |
| 289 | (lambda* (store name inputs | 291 | (lambda* (store name inputs |
| @@ -339,6 +341,38 @@ | |||
| 339 | (package-cross-derivation %store p "mips64el-linux-gnu") | 341 | (package-cross-derivation %store p "mips64el-linux-gnu") |
| 340 | #f))) | 342 | #f))) |
| 341 | 343 | ||
| 344 | (test-equal "package->bag" | ||
| 345 | `("foo86-hurd" #f (,(package-source gnu-make)) | ||
| 346 | (,(canonical-package glibc)) (,(canonical-package coreutils))) | ||
| 347 | (let ((bag (package->bag gnu-make "foo86-hurd"))) | ||
| 348 | (list (bag-system bag) (bag-target bag) | ||
| 349 | (assoc-ref (bag-build-inputs bag) "source") | ||
| 350 | (assoc-ref (bag-build-inputs bag) "libc") | ||
| 351 | (assoc-ref (bag-build-inputs bag) "coreutils")))) | ||
| 352 | |||
| 353 | (test-equal "package->bag, cross-compilation" | ||
| 354 | `(,(%current-system) "foo86-hurd" | ||
| 355 | (,(package-source gnu-make)) | ||
| 356 | (,(canonical-package glibc)) (,(canonical-package coreutils))) | ||
| 357 | (let ((bag (package->bag gnu-make (%current-system) "foo86-hurd"))) | ||
| 358 | (list (bag-system bag) (bag-target bag) | ||
| 359 | (assoc-ref (bag-build-inputs bag) "source") | ||
| 360 | (assoc-ref (bag-build-inputs bag) "libc") | ||
| 361 | (assoc-ref (bag-build-inputs bag) "coreutils")))) | ||
| 362 | |||
| 363 | (test-assert "bag->derivation" | ||
| 364 | (let ((bag (package->bag gnu-make)) | ||
| 365 | (drv (package-derivation %store gnu-make))) | ||
| 366 | (parameterize ((%current-system "foox86-hurd")) ;should have no effect | ||
| 367 | (equal? drv (bag->derivation %store bag))))) | ||
| 368 | |||
| 369 | (test-assert "bag->derivation, cross-compilation" | ||
| 370 | (let ((bag (package->bag gnu-make (%current-system) "mips64el-linux-gnu")) | ||
| 371 | (drv (package-cross-derivation %store gnu-make "mips64el-linux-gnu"))) | ||
| 372 | (parameterize ((%current-system "foox86-hurd") ;should have no effect | ||
| 373 | (%current-target-system "foo64-linux-gnu")) | ||
| 374 | (equal? drv (bag->derivation %store bag))))) | ||
| 375 | |||
| 342 | (unless (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)) | 376 | (unless (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)) |
| 343 | (test-skip 1)) | 377 | (test-skip 1)) |
| 344 | (test-assert "GNU Make, bootstrap" | 378 | (test-assert "GNU Make, bootstrap" |
