...
svn: r7001
This commit is contained in:
parent
f034fbe959
commit
3f58e02472
7
collects/tests/stepper/run-nightly-tests.ss
Normal file
7
collects/tests/stepper/run-nightly-tests.ss
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
(module run-nightly-tests mzscheme
|
||||||
|
(require "through-tests.ss")
|
||||||
|
|
||||||
|
(parameterize ([display-only-errors #t])
|
||||||
|
(if (run-all-tests-except '(prims qq-splice time set! local-set! lazy1 lazy2 lazy3))
|
||||||
|
(exit 1)
|
||||||
|
(exit 0))))
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
;;#!/bin/sh
|
||||||
#|
|
;;#|
|
||||||
exec mred -u "$0" "$@"
|
;;exec mred -u "$0" "$@"
|
||||||
|#
|
;;|#
|
||||||
|
|
||||||
(module through-tests mzscheme
|
(module through-tests mzscheme
|
||||||
(require (lib "shared.ss" "stepper" "private")
|
(require (lib "shared.ss" "stepper" "private")
|
||||||
|
@ -10,14 +10,22 @@ exec mred -u "$0" "$@"
|
||||||
(lib "match.ss")
|
(lib "match.ss")
|
||||||
(lib "sexp-diff.ss" "tests" "utils")
|
(lib "sexp-diff.ss" "tests" "utils")
|
||||||
"module-elaborator.ss"
|
"module-elaborator.ss"
|
||||||
|
(lib "list.ss")
|
||||||
|
(only (lib "13.ss" "srfi") string-contains)
|
||||||
;; for xml testing:
|
;; for xml testing:
|
||||||
;; (lib "class.ss")
|
;; (lib "class.ss")
|
||||||
;; (all-except (lib "xml-snipclass.ss" "xml") snip-class)
|
;; (all-except (lib "xml-snipclass.ss" "xml") snip-class)
|
||||||
;; (all-except (lib "scheme-snipclass.ss" "xml") snip-class)
|
;; (all-except (lib "scheme-snipclass.ss" "xml") snip-class)
|
||||||
;; (lib "mred.ss" "mred")
|
;; (lib "mred.ss" "mred")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(provide (all-defined))
|
||||||
|
|
||||||
(define test-directory (find-system-path 'temp-dir))
|
(define test-directory (find-system-path 'temp-dir))
|
||||||
|
|
||||||
|
(define display-only-errors (make-parameter #f))
|
||||||
|
|
||||||
|
(define error-has-occurred-box (make-parameter #f))
|
||||||
|
|
||||||
(define (stream-ify expr-list iter)
|
(define (stream-ify expr-list iter)
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
@ -26,6 +34,7 @@ exec mred -u "$0" "$@"
|
||||||
(iter (expand (car expr-list)) (stream-ify (cdr expr-list) iter)))))
|
(iter (expand (car expr-list)) (stream-ify (cdr expr-list) iter)))))
|
||||||
|
|
||||||
(define (warn who fmt . args)
|
(define (warn who fmt . args)
|
||||||
|
(set-box! (error-has-occurred-box) #t)
|
||||||
(fprintf (current-error-port) "~a: ~a\n" who (apply format fmt args)))
|
(fprintf (current-error-port) "~a: ~a\n" who (apply format fmt args)))
|
||||||
|
|
||||||
(define (test-sequence-core namespace-spec teachpack-specs render-settings
|
(define (test-sequence-core namespace-spec teachpack-specs render-settings
|
||||||
|
@ -78,7 +87,8 @@ exec mred -u "$0" "$@"
|
||||||
(call-with-output-file filename
|
(call-with-output-file filename
|
||||||
(lambda (port) (fprintf port "~a" exp-str))
|
(lambda (port) (fprintf port "~a" exp-str))
|
||||||
'truncate)
|
'truncate)
|
||||||
(printf "testing string: ~v\n" exp-str)
|
(unless (display-only-errors)
|
||||||
|
(printf "testing string: ~v\n" exp-str))
|
||||||
(letrec ([port (open-input-file filename)])
|
(letrec ([port (open-input-file filename)])
|
||||||
(test-sequence-core namespace-spec teachpack-specs render-settings
|
(test-sequence-core namespace-spec teachpack-specs render-settings
|
||||||
track-inferred-names? port expected-steps))))
|
track-inferred-names? port expected-steps))))
|
||||||
|
@ -164,7 +174,7 @@ exec mred -u "$0" "$@"
|
||||||
(list before after)))]
|
(list before after)))]
|
||||||
[`(error ,err-msg)
|
[`(error ,err-msg)
|
||||||
(and (error-result? actual)
|
(and (error-result? actual)
|
||||||
(equal? err-msg (error-result-err-msg actual)))]
|
(string-contains (error-result-err-msg actual) err-msg))]
|
||||||
[`(before-error ,before ,err-msg)
|
[`(before-error ,before ,err-msg)
|
||||||
(and (before-error-result? actual)
|
(and (before-error-result? actual)
|
||||||
(and (noisy-equal? (map syntax-object->hilite-datum
|
(and (noisy-equal? (map syntax-object->hilite-datum
|
||||||
|
@ -270,20 +280,43 @@ exec mred -u "$0" "$@"
|
||||||
(tester
|
(tester
|
||||||
;printf "exprs = ~s\n args = ~s\n"
|
;printf "exprs = ~s\n args = ~s\n"
|
||||||
(exprs->string `exprs) `(arg ...))))))]))
|
(exprs->string `exprs) `(arg ...))))))]))
|
||||||
|
|
||||||
|
;; run a test : (list symbol test-thunk) -> boolean
|
||||||
|
;; run the named test, return #t if a failure occurred during the test
|
||||||
|
(define (run-one-test test-pair)
|
||||||
|
(unless (display-only-errors)
|
||||||
|
(printf "running test: ~v\n" (car test-pair)))
|
||||||
|
(parameterize ([error-has-occurred-box (box #f)])
|
||||||
|
((cadr test-pair))
|
||||||
|
(if (unbox (error-has-occurred-box))
|
||||||
|
(begin (fprintf (current-error-port) "...Error has occurred during test: ~v\n" (car test-pair))
|
||||||
|
#t)
|
||||||
|
#f)))
|
||||||
|
|
||||||
(define (run-all-tests)
|
(define (run-all-tests)
|
||||||
(for-each (lambda (test-pair)
|
(ormap/no-shortcut
|
||||||
(printf "running test: ~v\n" (car test-pair))
|
run-one-test
|
||||||
((cadr test-pair)))
|
list-of-tests))
|
||||||
list-of-tests))
|
|
||||||
|
(define (run-all-tests-except nix-list)
|
||||||
|
(ormap/no-shortcut
|
||||||
|
run-one-test
|
||||||
|
(filter (lambda (pr) (not (member (car pr) nix-list)))
|
||||||
|
list-of-tests)))
|
||||||
|
|
||||||
(define (run-test name)
|
(define (run-test name)
|
||||||
(printf "running test: ~v\n" name)
|
(let ([maybe-test (assq name list-of-tests)])
|
||||||
((cadr (or (assq name list-of-tests)
|
(if maybe-test
|
||||||
(error 'run-test "test not found: ~e" name)))))
|
(run-one-test (cadr maybe-test))
|
||||||
|
(error 'run-test "test not found: ~e" name))))
|
||||||
|
|
||||||
(define (run-tests names)
|
(define (run-tests names)
|
||||||
(for-each run-test names))
|
(ormap/no-shortcut run-test names))
|
||||||
|
|
||||||
|
|
||||||
|
;; like an ormap, but without short-cutting
|
||||||
|
(define (ormap/no-shortcut f args)
|
||||||
|
(foldl (lambda (a b) (or a b)) #f (map f args)))
|
||||||
|
|
||||||
(t mz1 test-mz-sequence
|
(t mz1 test-mz-sequence
|
||||||
(for-each (lambda (x) x) '(1 2 3))
|
(for-each (lambda (x) x) '(1 2 3))
|
||||||
|
@ -1560,8 +1593,13 @@ exec mred -u "$0" "$@"
|
||||||
"(define (f2c x) x) (convert-gui f2c)" `() ; placeholder
|
"(define (f2c x) x) (convert-gui f2c)" `() ; placeholder
|
||||||
))
|
))
|
||||||
|
|
||||||
|
;; make sure to leave these off when saving, or the nightly tests will run these too...
|
||||||
|
#;(run-all-tests)
|
||||||
#;(run-tests '(mz1 empty-begin empty-begin0))
|
#;(run-tests '(mz1 empty-begin empty-begin0))
|
||||||
(run-all-tests)
|
#;(parameterize ([display-only-errors #t])
|
||||||
|
(run-all-tests-except '(prims qq-splice time set! local-set! lazy1 lazy2 lazy3)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
)
|
)
|
||||||
;; Local variables:
|
;; Local variables:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user