summaryrefslogtreecommitdiff
path: root/tests/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-09-28 17:36:42 +0200
committerLudovic Courtès <ludo@gnu.org>2020-10-12 18:23:47 +0200
commit46135ce4cefab9e164d75697d7ea0c8359b842e4 (patch)
treec3b9377edff08b149b46ab1a11332542c5ff7181 /tests/packages.scm
parentb668450716f0949e6a66550c38b6ba738f66bba7 (diff)
packages: Add 'package-with-c-toolchain'.
* guix/build-system.scm (build-system-with-c-toolchain): New procedure. * guix/packages.scm (package-with-c-toolchain): New procedure. * tests/packages.scm ("package-with-c-toolchain"): New test. * doc/guix.texi (package Reference): Document 'package-with-c-toolchain'. (Build Systems): Mention it.
Diffstat (limited to 'tests/packages.scm')
-rw-r--r--tests/packages.scm20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index 5d5abcbd761..2d13d913442 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -1430,6 +1430,26 @@
1430 (derivation-file-name 1430 (derivation-file-name
1431 (package-derivation %store coreutils)))))))) 1431 (package-derivation %store coreutils))))))))
1432 1432
1433(test-assert "package-with-c-toolchain"
1434 (let* ((dep (dummy-package "chbouib"
1435 (build-system gnu-build-system)
1436 (native-inputs `(("x" ,grep)))))
1437 (p0 (dummy-package "thingie"
1438 (build-system gnu-build-system)
1439 (inputs `(("foo" ,grep)
1440 ("bar" ,dep)))))
1441 (tc (dummy-package "my-toolchain"))
1442 (p1 (package-with-c-toolchain p0 `(("toolchain" ,tc)))))
1443 (define toolchain-packages
1444 '("gcc" "binutils" "glibc" "ld-wrapper"))
1445
1446 (match (bag-build-inputs (package->bag p1))
1447 ((("foo" foo) ("bar" bar) (_ (= package-name packages) . _) ...)
1448 (and (not (any (cut member <> packages) toolchain-packages))
1449 (member "my-toolchain" packages)
1450 (eq? foo grep)
1451 (eq? bar dep))))))
1452
1433(test-equal "package-patched-vulnerabilities" 1453(test-equal "package-patched-vulnerabilities"
1434 '(("CVE-2015-1234") 1454 '(("CVE-2015-1234")
1435 ("CVE-2016-1234" "CVE-2018-4567") 1455 ("CVE-2016-1234" "CVE-2018-4567")