From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Changes to SRFI-64 testing.scm to support Guile 2, etc. Date: Thu, 30 Jan 2014 10:18:59 -0500 Message-ID: <87r47pebvg.fsf@netris.org> References: <87fvodi3rt.fsf@netris.org> <52E2CE1E.40109@bothner.com> <87a9eff9n6.fsf_-_@netris.org> <52E9224B.9090600@bothner.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1391095181 15501 80.91.229.3 (30 Jan 2014 15:19:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Jan 2014 15:19:41 +0000 (UTC) Cc: guile-devel@gnu.org To: Per Bothner Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jan 30 16:19:48 2014 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W8tP9-0004ke-5I for guile-devel@m.gmane.org; Thu, 30 Jan 2014 16:19:47 +0100 Original-Received: from localhost ([::1]:50832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8tP8-0004MR-Mm for guile-devel@m.gmane.org; Thu, 30 Jan 2014 10:19:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8tOy-0004At-Oq for guile-devel@gnu.org; Thu, 30 Jan 2014 10:19:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8tOr-0007Xp-B6 for guile-devel@gnu.org; Thu, 30 Jan 2014 10:19:36 -0500 Original-Received: from world.peace.net ([96.39.62.75]:40172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8tOr-0007WM-6E for guile-devel@gnu.org; Thu, 30 Jan 2014 10:19:29 -0500 Original-Received: from ip72-221-68-65.ri.ri.cox.net ([72.221.68.65] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1W8tOY-0002gf-UT; Thu, 30 Jan 2014 10:19:11 -0500 In-Reply-To: <52E9224B.9090600@bothner.com> (Per Bothner's message of "Wed, 29 Jan 2014 07:46:19 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16857 Archived-At: --=-=-= Content-Type: text/plain Hi Per, I've attached some more fixes for SRFI-64 testing.scm: * Improved Guile's implementation of '%test-evaluate-with-catch' to record 'actual-error' if there's an error. * Fix typo '%test-approximimate=' -> '%test-approximate='. * In the default implementation of 'test-error', '%test-report-result' was being called twice: once by '%test-error', and once by 'test-assert'. This caused the test suite to fail on Guile 1.8. Now, Guile 1.8 passes srfi-64-test.scm (after removing the R6RS block comment at the end, which Guile 1.8 is unable to read). Regards, Mark --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=srfi-64-testing-guile-2-more.diff Content-Description: More fixes for SRFI-64 testing.scm --- testing.scm-ORIG2 2014-01-30 09:45:05.114667941 -0500 +++ testing.scm 2014-01-30 10:10:14.303999879 -0500 @@ -573,7 +573,12 @@ (define-syntax %test-evaluate-with-catch (syntax-rules () ((%test-evaluate-with-catch test-expression) - (catch #t (lambda () test-expression) (lambda (key . args) #f)))))) + (catch #t + (lambda () test-expression) + (lambda (key . args) + (test-result-set! (test-runner-current) 'actual-error + (cons key args)) + #f)))))) (kawa (define-syntax %test-evaluate-with-catch (syntax-rules () @@ -661,7 +666,7 @@ (%test-on-test-end r (comp exp res))))) (%test-report-result))))) -(define (%test-approximimate= error) +(define (%test-approximate= error) (lambda (value expected) (let ((rval (real-part value)) (ival (imag-part value)) @@ -737,12 +742,12 @@ (let* ((r (test-runner-get)) (name tname)) (test-result-alist! r (cons (cons 'test-name tname) line)) - (%test-comp2body r (%test-approximimate= error) expected expr)))) + (%test-comp2body r (%test-approximate= error) expected expr)))) (((mac expected expr error) line) (syntax (let* ((r (test-runner-get))) (test-result-alist! r line) - (%test-comp2body r (%test-approximimate= error) expected expr)))))))) + (%test-comp2body r (%test-approximate= error) expected expr)))))))) (else (define-syntax test-end (syntax-rules () @@ -787,9 +792,9 @@ (define-syntax test-approximate (syntax-rules () ((test-approximate tname expected expr error) - (%test-comp2 (%test-approximimate= error) tname expected expr)) + (%test-comp2 (%test-approximate= error) tname expected expr)) ((test-approximate expected expr error) - (%test-comp2 (%test-approximimate= error) expected expr)))))) + (%test-comp2 (%test-approximate= error) expected expr)))))) (cond-expand (guile @@ -908,13 +913,16 @@ (syntax-rules () ((test-error name etype expr) (let ((r (test-runner-get))) - (test-assert name (%test-error r etype expr)))) + (test-result-alist! r `((test-name . ,name))) + (%test-error r etype expr))) ((test-error etype expr) (let ((r (test-runner-get))) - (test-assert (%test-error r etype expr)))) + (test-result-alist! r '()) + (%test-error r etype expr))) ((test-error expr) (let ((r (test-runner-get))) - (test-assert (%test-error r #t expr)))))))) + (test-result-alist! r '()) + (%test-error r #t expr))))))) (define (test-apply first . rest) (if (test-runner? first) --=-=-=--