From: Nikodemus Siivola Date: Tue, 7 Jun 2011 11:42:59 +0000 (+0300) Subject: fix whitespace in tests X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=69fe69971242dba6905e9c55f8ce6a9a93c9e403;p=sbcl.git fix whitespace in tests --- diff --git a/tests/deadline.impure.lisp b/tests/deadline.impure.lisp index 88171e0..32f14f3 100644 --- a/tests/deadline.impure.lisp +++ b/tests/deadline.impure.lisp @@ -68,11 +68,11 @@ (with-test (:name (:deadline :get-mutex) :skipped-on '(not (and :sb-thread (not :sb-lutex)))) (assert-timeout (let ((lock (sb-thread:make-mutex)) - (waitp t)) + (waitp t)) (sb-thread:make-thread (lambda () - (sb-thread:get-mutex lock) - (setf waitp nil) - (sleep 5))) + (sb-thread:get-mutex lock) + (setf waitp nil) + (sleep 5))) (loop while waitp do (sleep 0.01)) (sb-sys:with-deadline (:seconds 1) (sb-thread:get-mutex lock))))) @@ -91,26 +91,26 @@ (with-test (:name (:deadline :futex-wait-eintr) :skipped-on '(not (and :sb-thread (not :sb-lutex)))) (let ((lock (sb-thread:make-mutex)) - (waitp t)) + (waitp t)) (sb-thread:make-thread (lambda () - (sb-thread:get-mutex lock) - (setf waitp nil) - (sleep 5))) + (sb-thread:get-mutex lock) + (setf waitp nil) + (sleep 5))) (loop while waitp do (sleep 0.01)) (let ((thread (sb-thread:make-thread - (lambda () - (let ((start (get-internal-real-time))) - (handler-case - (sb-sys:with-deadline (:seconds 1) - (sb-thread:get-mutex lock)) - (sb-sys:deadline-timeout (x) - (declare (ignore x)) - (let ((end (get-internal-real-time))) - (float (/ (- end start) - internal-time-units-per-second) - 0.0))))))))) + (lambda () + (let ((start (get-internal-real-time))) + (handler-case + (sb-sys:with-deadline (:seconds 1) + (sb-thread:get-mutex lock)) + (sb-sys:deadline-timeout (x) + (declare (ignore x)) + (let ((end (get-internal-real-time))) + (float (/ (- end start) + internal-time-units-per-second) + 0.0))))))))) (sleep 0.3) (sb-thread:interrupt-thread thread (lambda () 42)) (let ((seconds-passed (sb-thread:join-thread thread))) - (format t "Deadline in ~S~%" seconds-passed) - (assert (< seconds-passed 1.2)))))) + (format t "Deadline in ~S~%" seconds-passed) + (assert (< seconds-passed 1.2)))))) diff --git a/tests/debug.impure.lisp b/tests/debug.impure.lisp index df70a78..308d3d6 100644 --- a/tests/debug.impure.lisp +++ b/tests/debug.impure.lisp @@ -430,7 +430,7 @@ ;;; on that platform. (with-test (:name (trace :encapsulate nil) :fails-on '(or (and :ppc (not :linux)) :sparc :mips) - :broken-on '(or :darwin :sunos)) + :broken-on '(or :darwin :sunos)) (let ((out (with-output-to-string (*trace-output*) (trace trace-this :encapsulate nil) (assert (eq 'ok (trace-this))) @@ -440,7 +440,7 @@ (with-test (:name (trace-recursive :encapsulate nil) :fails-on '(or (and :ppc (not :linux)) :sparc :mips :sunos) - :broken-on '(or :darwin (and :x86 :sunos))) + :broken-on '(or :darwin (and :x86 :sunos))) (let ((out (with-output-to-string (*trace-output*) (trace trace-fact :encapsulate nil) (assert (= 120 (trace-fact 5))) diff --git a/tests/exhaust.impure.lisp b/tests/exhaust.impure.lisp index 1bd6d81..e8957a0 100644 --- a/tests/exhaust.impure.lisp +++ b/tests/exhaust.impure.lisp @@ -38,27 +38,27 @@ ;;; Base-case: detecting exhaustion (with-test (:name (:exhaust :basic) :broken-on '(and :sunos :x86-64)) (assert (eq :exhausted - (handler-case - (recurse) - (storage-condition (c) - (declare (ignore c)) - :exhausted))))) + (handler-case + (recurse) + (storage-condition (c) + (declare (ignore c)) + :exhausted))))) ;;; Check that non-local control transfers restore the stack ;;; exhaustion checking after unwinding -- and that previous test ;;; didn't break it. (with-test (:name (:exhaust :non-local-control) :broken-on '(and :sunos :x86-64)) (let ((exhaust-count 0) - (recurse-count 0)) + (recurse-count 0)) (tagbody :retry (handler-bind ((storage-condition (lambda (c) - (declare (ignore c)) - (if (= *count* (incf exhaust-count)) - (go :stop) - (go :retry))))) - (incf recurse-count) - (recurse)) + (declare (ignore c)) + (if (= *count* (incf exhaust-count)) + (go :stop) + (go :retry))))) + (incf recurse-count) + (recurse)) :stop) (assert (= exhaust-count recurse-count *count*)))) @@ -66,17 +66,17 @@ ;;; unwind. (with-test (:name (:exhaust :restarts) :broken-on '(and :sunos :x86-64)) (let ((exhaust-count 0) - (recurse-count 0)) + (recurse-count 0)) (block nil (handler-bind ((storage-condition (lambda (c) - (declare (ignore c)) - (if (= *count* (incf exhaust-count)) - (return) - (invoke-restart (find-restart 'ok)))))) - (loop - (with-simple-restart (ok "ok") - (incf recurse-count) - (recurse))))) + (declare (ignore c)) + (if (= *count* (incf exhaust-count)) + (return) + (invoke-restart (find-restart 'ok)))))) + (loop + (with-simple-restart (ok "ok") + (incf recurse-count) + (recurse))))) (assert (= exhaust-count recurse-count *count*)))) (with-test (:name (:exhaust :binding-stack)) diff --git a/tests/run-tests.lisp b/tests/run-tests.lisp index 92808c0..80e28ac 100644 --- a/tests/run-tests.lisp +++ b/tests/run-tests.lisp @@ -43,33 +43,33 @@ (format t "Finished running tests.~%") (let ((skipcount 0)) (cond (*all-failures* - (format t "Status:~%") - (dolist (fail (reverse *all-failures*)) - (cond ((eq (car fail) :unhandled-error) - (format t " ~20a ~a~%" - "Unhandled error" - (enough-namestring (second fail)))) - ((eq (car fail) :invalid-exit-status) - (format t " ~20a ~a~%" - "Invalid exit status:" - (enough-namestring (second fail)))) - ((eq (car fail) :skipped-disabled) - (incf skipcount)) - (t - (format t " ~20a ~a / ~a~%" - (ecase (first fail) - (:expected-failure "Expected failure:") - (:unexpected-failure "Failure:") - (:unexpected-success "Unexpected success:") - (:skipped-broken "Skipped (broken):") - (:skipped-disabled "Skipped (irrelevant):")) - (enough-namestring (second fail)) - (third fail))))) - (when (> skipcount 0) - (format t " (~a tests skipped for this combination of platform and features)~%" - skipcount))) - (t - (format t "All tests succeeded~%"))))) + (format t "Status:~%") + (dolist (fail (reverse *all-failures*)) + (cond ((eq (car fail) :unhandled-error) + (format t " ~20a ~a~%" + "Unhandled error" + (enough-namestring (second fail)))) + ((eq (car fail) :invalid-exit-status) + (format t " ~20a ~a~%" + "Invalid exit status:" + (enough-namestring (second fail)))) + ((eq (car fail) :skipped-disabled) + (incf skipcount)) + (t + (format t " ~20a ~a / ~a~%" + (ecase (first fail) + (:expected-failure "Expected failure:") + (:unexpected-failure "Failure:") + (:unexpected-success "Unexpected success:") + (:skipped-broken "Skipped (broken):") + (:skipped-disabled "Skipped (irrelevant):")) + (enough-namestring (second fail)) + (third fail))))) + (when (> skipcount 0) + (format t " (~a tests skipped for this combination of platform and features)~%" + skipcount))) + (t + (format t "All tests succeeded~%"))))) (defun pure-runner (files test-fun) (format t "// Running pure tests (~a)~%" test-fun) @@ -174,8 +174,8 @@ (remove-if (lambda (x) (or (eq (car x) :expected-failure) (eq (car x) :unexpected-success) - (eq (car x) :skipped-broken) - (eq (car x) :skipped-disabled))) + (eq (car x) :skipped-broken) + (eq (car x) :skipped-disabled))) *all-failures*)) (defun setup-cl-user () diff --git a/tests/test-util.lisp b/tests/test-util.lisp index 7021342..2e278ae 100644 --- a/tests/test-util.lisp +++ b/tests/test-util.lisp @@ -23,23 +23,23 @@ `(progn (start-test) (cond - ((broken-p ,broken-on) - (fail-test :skipped-broken ',name "Test broken on this platform")) - ((skipped-p ,skipped-on) - (fail-test :skipped-disabled ',name "Test disabled for this combination of platform and features")) - (t - (block ,block-name - (handler-bind ((error (lambda (error) - (if (expected-failure-p ,fails-on) - (fail-test :expected-failure ',name error) - (fail-test :unexpected-failure ',name error)) - (return-from ,block-name)))) - (progn - (log-msg "Running ~S" ',name) - ,@body - (if (expected-failure-p ,fails-on) - (fail-test :unexpected-success ',name nil) - (log-msg "Success ~S" ',name)))))))))) + ((broken-p ,broken-on) + (fail-test :skipped-broken ',name "Test broken on this platform")) + ((skipped-p ,skipped-on) + (fail-test :skipped-disabled ',name "Test disabled for this combination of platform and features")) + (t + (block ,block-name + (handler-bind ((error (lambda (error) + (if (expected-failure-p ,fails-on) + (fail-test :expected-failure ',name error) + (fail-test :unexpected-failure ',name error)) + (return-from ,block-name)))) + (progn + (log-msg "Running ~S" ',name) + ,@body + (if (expected-failure-p ,fails-on) + (fail-test :unexpected-success ',name nil) + (log-msg "Success ~S" ',name)))))))))) (defun report-test-status () (with-standard-io-syntax diff --git a/tests/threads.pure.lisp b/tests/threads.pure.lisp index 26c70f1..983ace8 100644 --- a/tests/threads.pure.lisp +++ b/tests/threads.pure.lisp @@ -53,7 +53,7 @@ (with-test (:name without-interrupts+condition-wait :fails-on :sb-lutex - :skipped-on '(not :sb-thread)) + :skipped-on '(not :sb-thread)) (let* ((lock (make-mutex)) (queue (make-waitqueue)) (thread (make-thread (lambda () diff --git a/tests/timer.impure.lisp b/tests/timer.impure.lisp index bca8805..a610eb9 100644 --- a/tests/timer.impure.lisp +++ b/tests/timer.impure.lisp @@ -89,7 +89,7 @@ (with-test (:name (:timer :relative) :fails-on '(and :sparc :linux) - :skipped-on :win32) + :skipped-on :win32) (let* ((has-run-p nil) (timer (make-timer (lambda () (setq has-run-p t)) :name "simple timer"))) @@ -102,7 +102,7 @@ (with-test (:name (:timer :absolute) :fails-on '(and :sparc :linux) - :skipped-on :win32) + :skipped-on :win32) (let* ((has-run-p nil) (timer (make-timer (lambda () (setq has-run-p t)) :name "simple timer"))) @@ -131,7 +131,7 @@ (with-test (:name (:timer :repeat-and-unschedule) :fails-on '(and :sparc :linux) - :skipped-on :win32) + :skipped-on :win32) (let* ((run-count 0) timer) (setq timer