[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/06: tests: Adjust Python "sanity" check tests.
From: |
guix-commits |
Subject: |
02/06: tests: Adjust Python "sanity" check tests. |
Date: |
Mon, 5 Jul 2021 10:58:29 -0400 (EDT) |
civodul pushed a commit to branch core-updates
in repository guix.
commit d8fdd1c74a59730d174577aa7c2c8de73715da8e
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jul 5 15:41:45 2021 +0200
tests: Adjust Python "sanity" check tests.
This is a followup to 09448c0994390697e876db235a3b773311795238.
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.
---
tests/builders.scm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/builders.scm b/tests/builders.scm
index f36a8c9..f609631 100644
--- a/tests/builders.scm
+++ b/tests/builders.scm
@@ -1,5 +1,5 @@
;;; 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>
;;;
;;; This file is part of GNU Guix.
@@ -38,6 +38,7 @@
#:use-module (ice-9 textual-ports)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
+ #:use-module (srfi srfi-34)
#:use-module (srfi srfi-64))
;; Test the higher-level builders.
@@ -178,7 +179,11 @@ setup(
(define (check-build-failure store p)
(unless store (test-skip 1))
(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
(for-each (lambda (p) (check-build-success store p))
- branch core-updates updated (5318bad -> 6265c00), guix-commits, 2021/07/05
- 02/06: tests: Adjust Python "sanity" check tests.,
guix-commits <=
- 03/06: ci: Change "core" subset to include the latest GCC and Guile., guix-commits, 2021/07/05
- 01/06: tests: Unset NIX_STORE_DIR when running external tests., guix-commits, 2021/07/05
- 05/06: tests: Fix typo in 'tests/store.scm'., guix-commits, 2021/07/05
- 04/06: build-system/trivial: Honor build inputs when cross-compiling., guix-commits, 2021/07/05
- 06/06: gnu: texlive: Fix Texinfo markup in descriptions., guix-commits, 2021/07/05