misc reformatting
svn: r9733
This commit is contained in:
parent
807dd0436f
commit
f818c88a33
|
@ -1,5 +1,4 @@
|
|||
|
||||
(module main mzscheme
|
||||
#lang mzscheme
|
||||
(require launcher
|
||||
mzlib/cmdline
|
||||
mzlib/list
|
||||
|
@ -11,15 +10,14 @@
|
|||
|
||||
(define preferences-file (find-system-path 'pref-file))
|
||||
|
||||
(define old-preferences-file (let-values ([(base name _2) (split-path preferences-file)])
|
||||
(define old-preferences-file
|
||||
(let-values ([(base name _2) (split-path preferences-file)])
|
||||
(build-path base (string-append (path->string name) ".save"))))
|
||||
|
||||
|
||||
(define all-files
|
||||
(map symbol->string
|
||||
(call-with-input-file (build-path
|
||||
(collection-path "tests" "framework")
|
||||
"README")
|
||||
(call-with-input-file
|
||||
(build-path (collection-path "tests" "framework") "README")
|
||||
read)))
|
||||
|
||||
(define all? #f)
|
||||
|
@ -44,11 +42,12 @@
|
|||
`("Names of the tests; defaults to all tests"))
|
||||
|
||||
(when (file-exists? preferences-file)
|
||||
(debug-printf admin " saving preferences file ~s to ~s~n" preferences-file old-preferences-file)
|
||||
(debug-printf admin " saving preferences file ~s to ~s\n"
|
||||
preferences-file old-preferences-file)
|
||||
(if (file-exists? old-preferences-file)
|
||||
(debug-printf admin " backup preferences file exists, using that one~n")
|
||||
(debug-printf admin " backup preferences file exists, using that one\n")
|
||||
(begin (copy-file preferences-file old-preferences-file)
|
||||
(debug-printf admin " saved preferences file~n"))))
|
||||
(debug-printf admin " saved preferences file\n"))))
|
||||
|
||||
(define jumped-out-tests '())
|
||||
|
||||
|
@ -66,25 +65,28 @@
|
|||
(lambda ()
|
||||
(with-handlers ([(lambda (x) #t)
|
||||
(lambda (exn)
|
||||
(debug-printf schedule "~a~n" (if (exn? exn) (exn-message exn) exn)))])
|
||||
|
||||
(debug-printf schedule "beginning ~a test suite~n" x)
|
||||
(debug-printf schedule "~a\n"
|
||||
(if (exn? exn)
|
||||
(exn-message exn)
|
||||
exn)))])
|
||||
(debug-printf schedule "beginning ~a test suite\n" x)
|
||||
(dynamic-require `(lib ,x "tests" "framework") #f)
|
||||
(set! jumped-out-tests (remq x jumped-out-tests))
|
||||
(debug-printf schedule "PASSED ~a test suite~n" x)))
|
||||
(debug-printf schedule "PASSED ~a test suite\n" x)))
|
||||
(lambda ()
|
||||
(reset-section-name!)
|
||||
(reset-section-jump!))))))
|
||||
files-to-process)
|
||||
|
||||
(debug-printf admin " restoring preferences file ~s to ~s~n" old-preferences-file preferences-file)
|
||||
(debug-printf admin " restoring preferences file ~s to ~s\n"
|
||||
old-preferences-file preferences-file)
|
||||
(when (file-exists? preferences-file)
|
||||
(unless (file-exists? old-preferences-file)
|
||||
(error 'framework-test "lost preferences file backup!"))
|
||||
(delete-file preferences-file)
|
||||
(copy-file old-preferences-file preferences-file)
|
||||
(delete-file old-preferences-file))
|
||||
(debug-printf admin " restored preferences file~n")
|
||||
(debug-printf admin " restored preferences file\n")
|
||||
|
||||
(shutdown-listener)
|
||||
|
||||
|
@ -92,9 +94,10 @@
|
|||
[(not (null? jumped-out-tests))
|
||||
(printf "Test suites ended with exns ~s\n" jumped-out-tests)]
|
||||
[(null? failed-tests)
|
||||
(printf "All tests passed.~n")]
|
||||
(printf "All tests passed.\n")]
|
||||
[else
|
||||
(debug-printf schedule "FAILED tests:~n")
|
||||
(debug-printf schedule "FAILED tests:\n")
|
||||
(for-each (lambda (failed-test)
|
||||
(debug-printf schedule " ~a // ~a~n" (car failed-test) (cdr failed-test)))
|
||||
failed-tests)]))
|
||||
(debug-printf schedule " ~a // ~a\n"
|
||||
(car failed-test) (cdr failed-test)))
|
||||
failed-tests)])
|
||||
|
|
Loading…
Reference in New Issue
Block a user