adjusted the exercising of parsing to let me know what files fail

This commit is contained in:
Danny Yoo 2011-05-20 12:11:44 -04:00
parent 3a6f525c32
commit 87d1149c75

View File

@ -7,6 +7,7 @@
;; read-syntax: cannot load snip-class reader ;; read-syntax: cannot load snip-class reader
(require "../parse-bytecode.rkt" (require "../parse-bytecode.rkt"
racket/list
racket/path) racket/path)
(define collects-dir (define collects-dir
@ -19,12 +20,19 @@
[else [else
p])))) p]))))
(define failures '())
(for ([path (in-directory collects-dir)]) (for ([path (in-directory collects-dir)])
(when (regexp-match? #rx"[.]rkt$" path) (when (regexp-match? #rx"[.]rkt$" path)
(printf "parsing file: ~a... " path) (printf "parsing file: ~a... " path)
(flush-output) (flush-output)
(let ([start-time (current-inexact-milliseconds)]) (let ([start-time (current-inexact-milliseconds)])
(void (parse-bytecode path)) (with-handlers ((exn:fail? (lambda (exn)
(let ([end-time (current-inexact-milliseconds)]) (set! failures (cons path failures))
(printf "~a msecs\n" (inexact->exact (floor (- end-time start-time)))))))) (printf "FAILED! ~a" (exn-message exn)))))
(void (parse-bytecode path))
(let ([end-time (current-inexact-milliseconds)])
(printf "~a msecs\n" (inexact->exact (floor (- end-time start-time)))))))))
(unless (empty? failures)
(printf "Failed on: ~s" failures))