GNU bug report logs -
#30853
[PATCH core-updates] build-system/gnu: Dump test suite logs upon 'check' failure.
Previous Next
Reported by: Ludovic Courtès <ludo <at> gnu.org>
Date: Mon, 19 Mar 2018 09:53:01 UTC
Severity: normal
Tags: patch
Done: ludo <at> gnu.org (Ludovic Courtès)
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30853 in the body.
You can then email your comments to 30853 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#30853
; Package
guix-patches
.
(Mon, 19 Mar 2018 09:53:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Mon, 19 Mar 2018 09:53:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Suggested by Mark H Weaver <mhw <at> netris.org>.
* 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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#30853
; Package
guix-patches
.
(Mon, 19 Mar 2018 16:06:01 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
Ludovic Courtès <ludo <at> gnu.org> writes:
> Suggested by Mark H Weaver <mhw <at> netris.org>.
>
> * 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
Reply sent
to
ludo <at> gnu.org (Ludovic Courtès)
:
You have taken responsibility.
(Tue, 20 Mar 2018 12:31:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
bug acknowledged by developer.
(Tue, 20 Mar 2018 12:31:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 30853-done <at> debbugs.gnu.org (full text, mbox):
Mark H Weaver <mhw <at> netris.org> skribis:
> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Suggested by Mark H Weaver <mhw <at> netris.org>.
>>
>> * 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’.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 18 Apr 2018 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 7 years and 63 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.