added flag to disable adding test exps

svn: r9268
This commit is contained in:
John Clements 2008-04-11 22:38:21 +00:00
parent 19a9048590
commit 25cbdca6da

View File

@ -12,10 +12,10 @@
any/c any/c
(listof any/c) (listof any/c)
(or/c false/c (object-contract [display-results/void (-> (listof any/c) any)]))) (or/c false/c (object-contract [display-results/void (-> (listof any/c) any)])))
(symbol?) (symbol? boolean?)
any)]) any)])
(define (expand-teaching-program port reader language-module teachpacks rep [module-name '#%htdp]) (define (expand-teaching-program port reader language-module teachpacks rep [module-name '#%htdp] [enable-testing? #t])
(let ([state 'init] (let ([state 'init]
;; state : 'init => 'require => 'done-or-exn ;; state : 'init => 'require => 'done-or-exn
@ -57,7 +57,9 @@
`(,#'module ,module-name ,language-module `(,#'module ,module-name ,language-module
,@(map (λ (x) `(require ,x)) teachpacks) ,@(map (λ (x) `(require ,x)) teachpacks)
,@body-exps ,@body-exps
,@(if (null? body-exps) '() '((run-tests) (display-results)))))) ,@(if enable-testing?
(if (null? body-exps) '() '((run-tests) (display-results)))
'()))))
rep)))] rep)))]
[(require) [(require)
(set! state 'done-or-exn) (set! state 'done-or-exn)