mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-27 04:59:27 -05:00
tests: Adjust Python "sanity" check tests.
This is a followup to 09448c0994
.
The 'check-build-failure' procedure would not actually check anything
since it did not call 'build-derivations'. However, it was throwing an
exception for unrelated reasons, so the tests would pass.
* tests/builders.scm (check-build-failure): Use 'guard' instead of
'false-if-exception'. Call 'build-derivations' to actually check for
build failures.
This commit is contained in:
parent
99ea6a2996
commit
d8fdd1c74a
1 changed files with 7 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2012, 2013, 2014, 2015, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2012, 2013, 2014, 2015, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net>
|
;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
|
@ -38,6 +38,7 @@ (define-module (tests builders)
|
||||||
#:use-module (ice-9 textual-ports)
|
#:use-module (ice-9 textual-ports)
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-11)
|
#:use-module (srfi srfi-11)
|
||||||
|
#:use-module (srfi srfi-34)
|
||||||
#:use-module (srfi srfi-64))
|
#:use-module (srfi srfi-64))
|
||||||
|
|
||||||
;; Test the higher-level builders.
|
;; Test the higher-level builders.
|
||||||
|
@ -178,7 +179,11 @@ (define (check-build-success store p)
|
||||||
(define (check-build-failure store p)
|
(define (check-build-failure store p)
|
||||||
(unless store (test-skip 1))
|
(unless store (test-skip 1))
|
||||||
(test-assert (string-append "python-build-system: " (package-name p))
|
(test-assert (string-append "python-build-system: " (package-name p))
|
||||||
(not (false-if-exception (package-derivation store python-dummy-fail-requirements)))))
|
(let ((drv (package-derivation store p)))
|
||||||
|
(guard (c ((store-protocol-error? c)
|
||||||
|
(pk 'failure c #t))) ;good!
|
||||||
|
(build-derivations store (list drv))
|
||||||
|
#f)))) ;bad: it should have failed
|
||||||
|
|
||||||
(with-external-store store
|
(with-external-store store
|
||||||
(for-each (lambda (p) (check-build-success store p))
|
(for-each (lambda (p) (check-build-success store p))
|
||||||
|
|
Loading…
Reference in a new issue