More options for test runner.

original commit: 5b1118d514ca8cc7f0071bfa531f8268401fc531
This commit is contained in:
Sam Tobin-Hochstadt 2010-06-24 16:46:31 -04:00
parent 7f6da53efa
commit 8e76e34368
2 changed files with 23 additions and 7 deletions

View File

@ -86,8 +86,14 @@
(test-suite "Typed Scheme Tests"
unit-tests int-tests))
(define (go [unit? #f]) (test/gui (if unit? unit-tests tests)))
(define (go/text [unit? #f]) (run-tests (if unit? unit-tests tests) 'verbose))
(define (go [unit? #f] [int? #f]) (test/gui (cond [unit? unit-tests]
[int? int-tests]
[else tests])))
(define (go/text [unit? #f] [int? #f]) (run-tests
(cond [unit? unit-tests]
[int? int-tests]
[else tests])
'verbose))
(provide go go/text)

View File

@ -2,14 +2,24 @@
(require racket/vector racket/gui/dynamic)
(require "main.ss")
(current-namespace (make-base-namespace))
(define exec (make-parameter go/text))
(define unit-only? (make-parameter #f))
(define int-only? (make-parameter #f))
(define skip-all? #f)
(current-namespace (make-base-namespace))
(command-line
#:once-each
["--unit" "run just the unit tests" (unit-only? #t)]
["--int" "run just the integration tests" (int-only? #t)]
["--nightly" "for the nightly builds" (when (eq? 'cgc (system-type 'gc))
(set! skip-all? #t))]
["--gui" "run using the gui"
(current-namespace ((gui-dynamic-require 'make-gui-namespace)))
(exec go)])
(unless (= 0 ((exec) (unit-only?)))
(error "Typed Scheme Tests did not pass."))
(if (gui-available?)
(begin (exec go))
(error "GUI not available"))])
(if skip-all?
(printf "Skipping Typed Racket tests.\n")
(unless (= 0 ((exec) (unit-only?) (int-only?)))
(error "Typed Racket Tests did not pass.")))