aux.sld 668 B

1234567891011121314151617181920212223
  1. (define-library (srfi-tests aux)
  2. (export define-tests)
  3. (import
  4. (scheme base)
  5. (scheme write)
  6. (scheme case-lambda)
  7. (srfi 64))
  8. (begin
  9. (define-syntax define-tests
  10. (syntax-rules ()
  11. ((_ proc-name suite-name form ...)
  12. (define proc-name
  13. (case-lambda
  14. (() (proc-name (test-runner-create)))
  15. ((runner)
  16. (parameterize ((test-runner-current runner))
  17. (test-begin suite-name)
  18. form ...
  19. (test-end suite-name)
  20. (and (= 0 (test-runner-xpass-count runner))
  21. (= 0 (test-runner-fail-count runner))))))))))
  22. ))