(define-library (cuprate) (import (scheme base) (scheme write) (scheme process-context) (srfi 225) (cuprate rewriters)) (export ;; test info test-info test-info? modify-test-info! inspect-test-info test-info-dict test-dto default-test-info-dict default-test-dto ;; test accessors and setters test-set! test-update! test-update/default! test-delete! test-contains? test-ref test-ref/default test-set test-update/default ;; Default test procedures setup-name! display-report default-skip-test? default-when-test-skipped default-before-test! default-setup-test! default-cleanup-test! default-after-test default-report-test default-on-exception-in-test default-skip-group? default-when-group-skipped default-before-group! default-setup-group! default-cleanup-group! default-after-group default-report-group default-on-exception-in-group ;; SRFI-64 style assertions call-as-test call-as-group define-test-application test-predicate test-binary test-named-application test-application test-body define-test-application test-equal test-eqv test-eq test-approximate test-error expect-to-fail test-skip-all test-group with-test-group-cleanup test-exit pretty-print) (begin (define-record-type (wrap-test-info dict) test-info? (dict unwrap-test-info set-test-info!)) (define assertion-violation error)) (cond-expand ((or foment chicken-5) (include "cuprate.simple-define-test-application.scm")) (else (include "cuprate.define-test-application.scm"))) ;; Pretty printing (cond-expand (chicken (import (only (chicken pretty-print) pretty-print))) ((or foment chibi) (import (srfi 166)) (begin (define (pretty-print obj) (show #t (pretty obj)) (newline)))) (gauche (import (scheme show)) (begin (define (pretty-print obj) (show #t (pretty obj))))) (else (begin (define (pretty-print x) (write x) (newline))))) ;; Better containers for the test info than alists, if available. (cond-expand ((or chicken skint) (import (srfi 128) (srfi 146 hash)) (begin (define default-test-dto hash-mapping-dto) (define (alist->default-dictionary x) (alist->hashmap (make-default-comparator) x)))) (else (begin (define default-test-dto eqv-alist-dto) (define (alist->default-dictionary x) x)))) (include "cuprate-impl.scm"))