diff options
author | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2023-09-15 18:20:38 +0200 |
---|---|---|
committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2023-09-15 18:47:00 +0200 |
commit | e9ff5d51e3297089e66c124195e1f1b42dbded65 (patch) | |
tree | ce3993c90b76a2275b57bf3231628966897ee122 /tests | |
parent | 43cdc8a07517e936812782c313fe145bcf5c7ed3 (diff) | |
parent | b696fb41bc0dfcb7130a5aa6d69aff2ae191c283 (diff) |
Merge branch 'master' into gnome-team.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lint.scm | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/lint.scm b/tests/lint.scm index b91bd053c5..a52a82237b 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -10,7 +10,7 @@ ;;; Copyright © 2020 Timothy Sample <samplet@ngyro.com> ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz> -;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be> +;;; Copyright © 2021, 2023 Maxime Devos <maximedevos@telenet.be> ;;; ;;; This file is part of GNU Guix. ;;; @@ -342,6 +342,36 @@ `(#:tests? ,(not (%current-target-system))))))) (check-tests-true pkg))) +(test-equal "compiler-for-target: unconditional CC=gcc is unacceptable" + "'CC' should be set to '(cc-for-target)' instead of 'gcc'" + (single-lint-warning-message + (check-compiler-for-target + (dummy-package "x" (arguments '(#:make-flags '("CC=gcc"))))))) + + +(test-equal "compiler-for-target: looks through G-expressions" + "'CC' should be set to '(cc-for-target)' instead of 'gcc'" + (single-lint-warning-message + (check-compiler-for-target + (dummy-package "x" (arguments '(#:make-flags #~'("CC=gcc"))))))) + +(test-equal "compiler-for-target: (cc-for-target) is acceptable" + '() + (check-compiler-for-target + (dummy-package "x" + (arguments + (list #:make-flags + #~(list (string-append "CC=" (cc-for-target)))))))) + +(test-equal "compiler-for-target: CC=gcc is acceptable when target=#false" + '() + (check-compiler-for-target + ;; This (dummy) package consists purely of architecture-independent data. + (dummy-package "tzdata" + (arguments + (list #:target #false + #:make-flags #~(list "CC=gcc")))))) + ;; The emacs-build-system sets #:tests? #f by default. (test-equal "tests-true: #:tests? #t acceptable for emacs packages" '() |