[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error in test runner example


There seems to be an error in the example of a custom test-runner.  It
tries to use a nonexistent test-runner-on-test! procedure (should
probably be test-runner-on-test-end!) with a slightly different
interface (maybe older version).  Working version is given below.

(define (my-simple-runner filename)
  (let ((runner (test-runner-null))
	(port (open-output-file filename))
        (num-passed 0)
        (num-failed 0))
    (test-runner-on-test-end! runner
      (lambda (runner)
        (case (test-result-kind runner)
          ((pass xpass) (set! num-passed (+ num-passed 1)))
          ((fail xfail) (set! num-failed (+ num-failed 1)))
          (else #t))))
    (test-runner-on-final! runner
       (lambda (runner)
          (format port "Passing tests: ~d.~%Failing tests: ~d.~%"
                  num-passed num-failed)
	  (close-output-port port)))

 (lambda () (my-simple-runner "/tmp/my-test.log")))

David Banks  <amoebae@xxxxxxxxx>