diff options
| author | Marius Bakke <mbakke@fastmail.com> | 2019-03-23 23:16:55 +0100 |
|---|---|---|
| committer | Marius Bakke <mbakke@fastmail.com> | 2019-03-23 23:16:55 +0100 |
| commit | 8c14f7f8a7ab0722bf4c9f92fd28ae85514d564f (patch) | |
| tree | adc5d29e9c2dcda5befa0ca81f1af8df23294947 /tests/graph.scm | |
| parent | 2f33a7321e5e37d37f57c229c8079cb4ffd10834 (diff) | |
| parent | 3374e9207f5244c20402a3c5513fe562140fef47 (diff) | |
Merge branch 'staging' into core-updates
Diffstat (limited to 'tests/graph.scm')
| -rw-r--r-- | tests/graph.scm | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/graph.scm b/tests/graph.scm index 2a0f6757179..b7732ec7099 100644 --- a/tests/graph.scm +++ b/tests/graph.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -191,6 +191,32 @@ edges." | |||
| 191 | (string=? target (derivation-file-name g))))) | 191 | (string=? target (derivation-file-name g))))) |
| 192 | edges))))))))) | 192 | edges))))))))) |
| 193 | 193 | ||
| 194 | (test-assert "reverse bag DAG" | ||
| 195 | (let-values (((dune bap ocaml-base) | ||
| 196 | (values (specification->package "dune") | ||
| 197 | (specification->package "bap") | ||
| 198 | (specification->package "ocaml-base"))) | ||
| 199 | ((backend nodes+edges) (make-recording-backend))) | ||
| 200 | (run-with-store %store | ||
| 201 | (export-graph (list dune) 'port | ||
| 202 | #:node-type %reverse-bag-node-type | ||
| 203 | #:backend backend)) | ||
| 204 | |||
| 205 | (run-with-store %store | ||
| 206 | (mlet %store-monad ((dune-drv (package->derivation dune)) | ||
| 207 | (bap-drv (package->derivation bap)) | ||
| 208 | (ocaml-base-drv (package->derivation ocaml-base))) | ||
| 209 | ;; OCAML-BASE uses 'dune-build-system' so DUNE is a direct dependency. | ||
| 210 | ;; BAP is much higher in the stack but it should be there. | ||
| 211 | (let-values (((nodes edges) (nodes+edges))) | ||
| 212 | (return | ||
| 213 | (and (member `(,(derivation-file-name bap-drv) | ||
| 214 | ,(package-full-name bap)) | ||
| 215 | nodes) | ||
| 216 | (->bool (member (map derivation-file-name | ||
| 217 | (list dune-drv ocaml-base-drv)) | ||
| 218 | edges))))))))) | ||
| 219 | |||
| 194 | (test-assert "derivation DAG" | 220 | (test-assert "derivation DAG" |
| 195 | (let-values (((backend nodes+edges) (make-recording-backend))) | 221 | (let-values (((backend nodes+edges) (make-recording-backend))) |
| 196 | (run-with-store %store | 222 | (run-with-store %store |
