diff options
| -rw-r--r-- | tests/gexp.scm | 7 | ||||
| -rw-r--r-- | tests/size.scm | 19 |
2 files changed, 20 insertions, 6 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm index 5c9a4fc031a..740d74620ee 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm | |||
| @@ -536,6 +536,9 @@ | |||
| 536 | (guix build utils)))) | 536 | (guix build utils)))) |
| 537 | (ok? (built-derivations (list drv))) | 537 | (ok? (built-derivations (list drv))) |
| 538 | (guile-drv (package->derivation %bootstrap-guile)) | 538 | (guile-drv (package->derivation %bootstrap-guile)) |
| 539 | (bash (interned-file (search-bootstrap-binary "bash" | ||
| 540 | (%current-system)) | ||
| 541 | "bash" #:recursive? #t)) | ||
| 539 | (g-one -> (derivation->output-path drv "one")) | 542 | (g-one -> (derivation->output-path drv "one")) |
| 540 | (g-two -> (derivation->output-path drv "two")) | 543 | (g-two -> (derivation->output-path drv "two")) |
| 541 | (g-guile -> (derivation->output-path drv))) | 544 | (g-guile -> (derivation->output-path drv))) |
| @@ -543,8 +546,10 @@ | |||
| 543 | (equal? (call-with-input-file g-one read) (list one)) | 546 | (equal? (call-with-input-file g-one read) (list one)) |
| 544 | (equal? (call-with-input-file g-two read) | 547 | (equal? (call-with-input-file g-two read) |
| 545 | (list one (derivation->output-path two "chbouib"))) | 548 | (list one (derivation->output-path two "chbouib"))) |
| 549 | |||
| 550 | ;; Note: %BOOTSTRAP-GUILE depends on the bootstrap Bash. | ||
| 546 | (equal? (call-with-input-file g-guile read) | 551 | (equal? (call-with-input-file g-guile read) |
| 547 | (list (derivation->output-path guile-drv))))))) | 552 | (list (derivation->output-path guile-drv) bash)))))) |
| 548 | 553 | ||
| 549 | (test-assertm "gexp->derivation #:allowed-references" | 554 | (test-assertm "gexp->derivation #:allowed-references" |
| 550 | (mlet %store-monad ((drv (gexp->derivation "allowed-refs" | 555 | (mlet %store-monad ((drv (gexp->derivation "allowed-refs" |
diff --git a/tests/size.scm b/tests/size.scm index 95b99a88ef7..a1106045f84 100644 --- a/tests/size.scm +++ b/tests/size.scm | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #:use-module (guix gexp) | 24 | #:use-module (guix gexp) |
| 25 | #:use-module (guix tests) | 25 | #:use-module (guix tests) |
| 26 | #:use-module (guix scripts size) | 26 | #:use-module (guix scripts size) |
| 27 | #:use-module (gnu packages) | ||
| 27 | #:use-module (gnu packages bootstrap) | 28 | #:use-module (gnu packages bootstrap) |
| 28 | #:use-module (ice-9 match) | 29 | #:use-module (ice-9 match) |
| 29 | #:use-module (srfi srfi-1) | 30 | #:use-module (srfi srfi-1) |
| @@ -54,9 +55,15 @@ | |||
| 54 | (built-derivations (list file2)) | 55 | (built-derivations (list file2)) |
| 55 | (mlet %store-monad ((profiles (store-profile | 56 | (mlet %store-monad ((profiles (store-profile |
| 56 | (derivation->output-path file2))) | 57 | (derivation->output-path file2))) |
| 58 | (bash (interned-file | ||
| 59 | (search-bootstrap-binary | ||
| 60 | "bash" (%current-system)) "bash" | ||
| 61 | #:recursive? #t)) | ||
| 57 | (guile (package->derivation %bootstrap-guile))) | 62 | (guile (package->derivation %bootstrap-guile))) |
| 58 | (define (lookup-profile drv) | 63 | (define (lookup-profile item) |
| 59 | (find (matching-profile (derivation->output-path drv)) | 64 | (find (matching-profile (if (derivation? item) |
| 65 | (derivation->output-path item) | ||
| 66 | item)) | ||
| 60 | profiles)) | 67 | profiles)) |
| 61 | 68 | ||
| 62 | (letrec-syntax ((match* (syntax-rules (=>) | 69 | (letrec-syntax ((match* (syntax-rules (=>) |
| @@ -67,15 +74,17 @@ | |||
| 67 | ((_ () body) | 74 | ((_ () body) |
| 68 | body)))) | 75 | body)))) |
| 69 | ;; Make sure we get all three profiles with sensible values. | 76 | ;; Make sure we get all three profiles with sensible values. |
| 70 | (return (and (= (length profiles) 3) | 77 | (return (and (= (length profiles) 4) |
| 71 | (match* ((file1 => profile1) | 78 | (match* ((file1 => profile1) |
| 72 | (file2 => profile2) | 79 | (file2 => profile2) |
| 73 | (guile => profile3)) | 80 | (guile => profile3) |
| 81 | (bash => profile4)) ;dependency of GUILE | ||
| 74 | (and (> (profile-closure-size profile2) 0) | 82 | (and (> (profile-closure-size profile2) 0) |
| 75 | (= (profile-closure-size profile2) | 83 | (= (profile-closure-size profile2) |
| 76 | (+ (profile-self-size profile1) | 84 | (+ (profile-self-size profile1) |
| 77 | (profile-self-size profile2) | 85 | (profile-self-size profile2) |
| 78 | (profile-self-size profile3)))))))))))) | 86 | (profile-self-size profile3) |
| 87 | (profile-self-size profile4)))))))))))) | ||
| 79 | 88 | ||
| 80 | (test-end "size") | 89 | (test-end "size") |
| 81 | 90 | ||
