diff options
author | Ludovic Courtès <ludovic.courtes@inria.fr> | 2021-12-03 23:06:49 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-01-01 15:23:24 +0100 |
commit | d090e9c37d693f5a0f381482c17fb03462cb6a48 (patch) | |
tree | 59fc6ad56654fd2e74b49375f914088cc9f7cda5 /tests | |
parent | 0a767f02d408100b7f834586adb49b0091fef01d (diff) | |
download | guix-d090e9c37d693f5a0f381482c17fb03462cb6a48.tar guix-d090e9c37d693f5a0f381482c17fb03462cb6a48.tar.gz |
transformations: Add '--tune'.
* guix/transformations.scm (tuning-compiler)
(tuned-package, tunable-package?, package-tuning)
(transform-package-tuning)
(build-system-with-tuning-compiler): New procedures.
(%transformations): Add 'tune'.
(%transformation-options): Add "--tune".
* tests/transformations.scm ("options->transformation, tune")
("options->transformations, tune, wrong micro-architecture"): New
tests.
* doc/guix.texi (Package Transformation Options): Document '--tune'.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/transformations.scm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/transformations.scm b/tests/transformations.scm index 09839dc1c5..8db85b4305 100644 --- a/tests/transformations.scm +++ b/tests/transformations.scm @@ -38,12 +38,14 @@ #:use-module (guix utils) #:use-module (guix git) #:use-module (guix upstream) + #:use-module (guix diagnostics) #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages busybox) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) #:use-module (srfi srfi-64)) @@ -465,6 +467,39 @@ `((with-latest . "foo"))))) (package-version (t p))))) +(test-equal "options->transformation, tune" + '(cpu-tuning . "superfast") + (let* ((p0 (dummy-package "p0")) + (p1 (dummy-package "p1" + (inputs `(("p0" ,p0))) + (properties '((tunable? . #t))))) + (p2 (dummy-package "p2" + (inputs `(("p1" ,p1))))) + (t (options->transformation '((tune . "superfast")))) + (p3 (t p2))) + (and (not (package-replacement p3)) + (match (package-inputs p3) + ((("p1" tuned)) + (match (package-inputs tuned) + ((("p0" p0)) + (and (not (package-replacement p0)) + (assq 'cpu-tuning + (package-properties + (package-replacement tuned))))))))))) + +(test-assert "options->transformations, tune, wrong micro-architecture" + (let ((p (dummy-package "tunable" + (properties '((tunable? . #t))))) + (t (options->transformation '((tune . "nonexistent-superfast"))))) + ;; Because GCC used by P's build system does not support + ;; '-march=nonexistent-superfast', we should see an error when lowering + ;; the tuned package. + (guard (c ((formatted-message? c) + (member "nonexistent-superfast" + (formatted-message-arguments c)))) + (package->bag (t p)) + #f))) + (test-equal "options->transformation + package->manifest-entry" '((transformations . ((without-tests . "foo")))) (let* ((p (dummy-package "foo")) |