On 03/23/2018 03:13 PM, Jeremy Korwin-Zmijowski wrote:
I am using the SRFI-64 to build that test harness for my software. I evaluate the (load
"main-test.scm") expression in the REPL to run my tests. By doing so, I can see the
number of "expected passes" incrementing over the last runs.
scheme@(guile-user)> (load "main-test.scm")
%%%% Starting test main
# of expected passes 2
scheme@(guile-user)> (load "main-test.scm")
%%%% Starting test main
# of expected passes 4
scheme@(guile-user)> (load "main-test.scm")
%%%% Starting test main
# of expected passes 6
I would like to have this behavior :
scheme@(guile-user)> (load "main-test.scm")
%%%% Starting test main
# of expected passes 2
scheme@(guile-user)> (load "main-test.scm")
%%%% Starting test main
# of expected passes 2
scheme@(guile-user)> (load "main-test.scm")
%%%% Starting test main
# of expected passes 2
I agree that would be more natural.
The specification of test-end says:
Additionally, if the matching test-begin installed a new test-runner, then
the test-end will de-install it, after reporting the accumulated test
results in an implementation-defined manner.
So this seems like a bug.
I'm evaluating the attached patch.
--
--Per Bothner
p...@bothner.com http://per.bothner.com/
diff --git a/gnu/kawa/slib/testing.scm b/gnu/kawa/slib/testing.scm
index 99dda0d48..2c0687658 100644
--- a/gnu/kawa/slib/testing.scm
+++ b/gnu/kawa/slib/testing.scm
@@ -443,8 +443,9 @@
(%test-runner-fail-list! r (car (%test-runner-fail-save r)))
(%test-runner-fail-save! r (cdr (%test-runner-fail-save r)))
(%test-runner-count-list! r (cdr count-list))
- (if (null? (test-runner-group-stack r))
- ((test-runner-on-final r) r)))))
+ (cond ((null? (test-runner-group-stack r))
+ ((test-runner-on-final r) r)
+ (test-runner-current #f))))))
(define-syntax test-group
(syntax-rules ()