srfi-64.test 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ;;;; srfi-64.test --- Test suite for SRFI-64. -*- scheme -*-
  2. ;;;;
  3. ;;;; Copyright (C) 2014 Free Software Foundation, Inc.
  4. ;;;;
  5. ;;;; This library is free software; you can redistribute it and/or
  6. ;;;; modify it under the terms of the GNU Lesser General Public
  7. ;;;; License as published by the Free Software Foundation; either
  8. ;;;; version 3 of the License, or (at your option) any later version.
  9. ;;;;
  10. ;;;; This library is distributed in the hope that it will be useful,
  11. ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. ;;;; Lesser General Public License for more details.
  14. ;;;;
  15. ;;;; You should have received a copy of the GNU Lesser General Public
  16. ;;;; License along with this library; if not, write to the Free Software
  17. ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. (define-module (test-srfi-64)
  19. #:use-module (srfi srfi-64))
  20. (define report (@@ (test-suite lib) report))
  21. (define (guile-test-runner)
  22. (let ((runner (test-runner-null)))
  23. (test-runner-on-test-end! runner
  24. (lambda (runner)
  25. (let* ((result-alist (test-result-alist runner))
  26. (result-kind (assq-ref result-alist 'result-kind))
  27. (test-name (list (assq-ref result-alist 'test-name))))
  28. (case result-kind
  29. ((pass) (report 'pass test-name))
  30. ((xpass) (report 'upass test-name))
  31. ((skip) (report 'untested test-name))
  32. ((fail xfail)
  33. (apply report result-kind test-name result-alist))
  34. (else #t)))))
  35. runner))
  36. (test-with-runner
  37. (guile-test-runner)
  38. (primitive-load-path "tests/srfi-64-test.scm"))
  39. ;;; Local Variables:
  40. ;;; eval: (put 'test-runner-on-test-end! 'scheme-indent-function 1)
  41. ;;; End: