| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 |
|
| 20 | (define-module (test-scripts)
|
| 21 | #:use-module (guix scripts)
|
| 22 | #:use-module (guix tests)
|
| 23 | #:use-module ((guix scripts build)
|
| 24 | #:select (%standard-build-options))
|
| 25 | #:use-module (srfi srfi-64))
|
| 26 |
|
| 27 | |
| 28 |
|
| 29 |
|
| 30 | (test-begin "scripts")
|
| 31 |
|
| 32 | (test-equal "parse-command-line"
|
| 33 | '((argument . "bar") (argument . "foo")
|
| 34 | (cores . 10) |
| 35 | (substitutes? . #f) (keep-failed? . #t)
|
| 36 | (max-jobs . 77) (cores . 42))
|
| 37 |
|
| 38 | (with-environment-variable "GUIX_BUILD_OPTIONS" "-c 42 -M 77"
|
| 39 | (parse-command-line '("--keep-failed" "--no-substitutes"
|
| 40 | "--cores=10" "foo" "bar")
|
| 41 | %standard-build-options
|
| 42 | (list '()))))
|
| 43 |
|
| 44 | (test-equal "parse-command-line and --no options"
|
| 45 | '((argument . "foo")
|
| 46 | (substitutes? . #f)) |
| 47 |
|
| 48 | (with-environment-variable "GUIX_BUILD_OPTIONS" "--no-substitutes"
|
| 49 | (parse-command-line '("foo")
|
| 50 | %standard-build-options
|
| 51 | (list '((substitutes? . #t))))))
|
| 52 |
|
| 53 | (test-end "scripts")
|
| 54 |
|
| 55 | |
| 56 | |
| 57 | |