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