teachpacks/testing.scm
;; DV 3/23/2007: Made this export a unit to conform to new teachpack protocol.
;; Also included the three form names to src/language/event-form.scm.
(module testing mzscheme
  (require (lib "unit.ss")
           (prefix htdp: test-engine/scheme-tests))
  
  (provide teachpack^ teachpack@)
  
  (define-signature teachpack^ 
    [generate-report
     (define-syntaxes (check-expect check-within check-error)
       (values (lambda (stx) (syntax-case stx () 
                               [(_ x ...) 
                                #`(begin
                                    #,(syntax/loc stx (htdp:check-expect x ...))
                                    'check-expect-finished)]))
               (lambda (stx) (syntax-case stx ()
                               [(_ x ...)
                                #`(begin
                                    #,(syntax/loc stx (htdp:check-within x ...))
                                    'check-within-finished)]))
               (lambda (stx) (syntax-case stx ()
                               [(_ x ...) 
                                #`(begin
                                    #,(syntax/loc stx (htdp:check-error x ...))
                                    'check-error-finished)]))))])
  
  (define-unit teachpack@
    (import)
    (export teachpack^)
    (define (generate-report) (htdp:run-tests) (htdp:display-results) 't))
  )