From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 19 05:52:42 2018 Received: (at submit) by debbugs.gnu.org; 19 Mar 2018 09:52:42 +0000 Received: from localhost ([127.0.0.1]:40776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exrT8-00024I-2W for submit@debbugs.gnu.org; Mon, 19 Mar 2018 05:52:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45629) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exrT6-000246-KG for submit@debbugs.gnu.org; Mon, 19 Mar 2018 05:52:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exrT0-0002yq-PA for submit@debbugs.gnu.org; Mon, 19 Mar 2018 05:52:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51370) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1exrT0-0002yf-LT for submit@debbugs.gnu.org; Mon, 19 Mar 2018 05:52:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exrSz-000741-EL for guix-patches@gnu.org; Mon, 19 Mar 2018 05:52:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exrSy-0002wl-LK for guix-patches@gnu.org; Mon, 19 Mar 2018 05:52:33 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exrSs-0002s7-Li; Mon, 19 Mar 2018 05:52:26 -0400 Received: from [193.50.110.92] (port=55586 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1exrSs-0002aq-4s; Mon, 19 Mar 2018 05:52:26 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH core-updates] build-system/gnu: Dump test suite logs upon 'check' failure. Date: Mon, 19 Mar 2018 10:52:18 +0100 Message-Id: <20180319095218.9744-1-ludo@gnu.org> X-Mailer: git-send-email 2.16.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: mhw@netris.org, =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Suggested by Mark H Weaver . * guix/build/gnu-build-system.scm (dump-file-contents): New procedure. (%test-suite-log-regexp): New variable. (check): Add #:test-suite-log-regexp. Catch 'invoke-error?' and call 'dump-file-contents' upon error. --- guix/build/gnu-build-system.scm | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 8fe6fa8d6..2c0f60c9b 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -33,6 +33,7 @@ #:use-module (rnrs io ports) #:export (%standard-phases %license-file-regexp + dump-file-contents gnu-build)) ;; Commentary: @@ -335,15 +336,44 @@ makefiles." '()) ,@make-flags))) +(define* (dump-file-contents directory file-regexp + #:optional (port (current-error-port))) + "Dump to PORT the contents of files in DIRECTORY that match FILE-REGEXP." + (define (dump file) + (let ((prefix (string-append "\n--- " file " "))) + (display (if (< (string-length prefix) 78) + (string-pad-right prefix 78 #\---) + prefix) + port) + (display "\n\n" port) + (call-with-input-file file + (lambda (log) + (dump-port log port))) + (display "\n" port))) + + (for-each dump (find-files directory file-regexp))) + +(define %test-suite-log-regexp + ;; Name of test suite log files as commonly found in GNU-based build systems + ;; and CMake. + "^(test-?suite\\.log|LastTestFailed\\.log)$") + (define* (check #:key target (make-flags '()) (tests? (not target)) (test-target "check") (parallel-tests? #t) + (test-suite-log-regexp %test-suite-log-regexp) #:allow-other-keys) (if tests? - (apply invoke "make" test-target - `(,@(if parallel-tests? - `("-j" ,(number->string (parallel-job-count))) - '()) - ,@make-flags)) + (guard (c ((invoke-error? c) + ;; Dump the test suite log to facilitate debugging. + (display "\nTest suite failed, dumping logs.\n" + (current-error-port)) + (dump-file-contents "." test-suite-log-regexp) + (raise c))) + (apply invoke "make" test-target + `(,@(if parallel-tests? + `("-j" ,(number->string (parallel-job-count))) + '()) + ,@make-flags))) (format #t "test suite not run~%")) #t) -- 2.16.2 From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 19 12:05:49 2018 Received: (at submit) by debbugs.gnu.org; 19 Mar 2018 16:05:49 +0000 Received: from localhost ([127.0.0.1]:42059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exxID-0004h0-Bu for submit@debbugs.gnu.org; Mon, 19 Mar 2018 12:05:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exxIB-0004gn-M7 for submit@debbugs.gnu.org; Mon, 19 Mar 2018 12:05:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exxI1-0001JY-Pv for submit@debbugs.gnu.org; Mon, 19 Mar 2018 12:05:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53938) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1exxI1-0001JJ-N4 for submit@debbugs.gnu.org; Mon, 19 Mar 2018 12:05:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exxHv-0004On-UK for guix-patches@gnu.org; Mon, 19 Mar 2018 12:05:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exxHp-00015j-Tm for guix-patches@gnu.org; Mon, 19 Mar 2018 12:05:31 -0400 Received: from world.peace.net ([50.252.239.5]:39952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1exxHp-0000qM-O1; Mon, 19 Mar 2018 12:05:25 -0400 Received: from pool-72-93-29-2.bstnma.east.verizon.net ([72.93.29.2] helo=jojen) by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1exxHd-0008TE-Gx; Mon, 19 Mar 2018 12:05:13 -0400 From: Mark H Weaver To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [PATCH core-updates] build-system/gnu: Dump test suite logs upon 'check' failure. References: <20180319095218.9744-1-ludo@gnu.org> Date: Mon, 19 Mar 2018 12:04:25 -0400 In-Reply-To: <20180319095218.9744-1-ludo@gnu.org> ("Ludovic \=\?utf-8\?Q\?Cour\?\= \=\?utf-8\?Q\?t\=C3\=A8s\=22's\?\= message of "Mon, 19 Mar 2018 10:52:18 +0100") Message-ID: <87a7v4dpbq.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: guix-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Ludovic Court=C3=A8s writes: > Suggested by Mark H Weaver . > > * guix/build/gnu-build-system.scm (dump-file-contents): New procedure. > (%test-suite-log-regexp): New variable. > (check): Add #:test-suite-log-regexp. Catch 'invoke-error?' and call > 'dump-file-contents' upon error. Looks good to me. Thank you! Mark From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 20 08:30:15 2018 Received: (at 30853-done) by debbugs.gnu.org; 20 Mar 2018 12:30:15 +0000 Received: from localhost ([127.0.0.1]:42822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eyGP9-0000Dy-Gl for submit@debbugs.gnu.org; Tue, 20 Mar 2018 08:30:15 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:42064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eyGP8-0000Dq-B7 for 30853-done@debbugs.gnu.org; Tue, 20 Mar 2018 08:30:14 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 261261260F; Tue, 20 Mar 2018 13:30:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uo3AT7oYTcnP; Tue, 20 Mar 2018 13:30:12 +0100 (CET) Received: from ribbon (nat-eduroam-36-gw-01-bso.bordeaux.inria.fr [194.199.1.36]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 010501260C; Tue, 20 Mar 2018 13:30:10 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Mark H Weaver Subject: Re: [bug#30853] [PATCH core-updates] build-system/gnu: Dump test suite logs upon 'check' failure. References: <20180319095218.9744-1-ludo@gnu.org> <87a7v4dpbq.fsf@netris.org> Date: Tue, 20 Mar 2018 13:30:08 +0100 In-Reply-To: <87a7v4dpbq.fsf@netris.org> (Mark H. Weaver's message of "Mon, 19 Mar 2018 12:04:25 -0400") Message-ID: <87h8pb6ib3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30853-done Cc: 30853-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Mark H Weaver skribis: > Ludovic Court=C3=A8s writes: > >> Suggested by Mark H Weaver . >> >> * guix/build/gnu-build-system.scm (dump-file-contents): New procedure. >> (%test-suite-log-regexp): New variable. >> (check): Add #:test-suite-log-regexp. Catch 'invoke-error?' and call >> 'dump-file-contents' upon error. > > Looks good to me. Thank you! Pushed, thanks! Ludo=E2=80=99. From unknown Fri Jun 20 07:24:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 18 Apr 2018 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator