[usocket-cvs] r529 - in usocket/trunk: . test

Chun Tian (binghe) ctian at common-lisp.net
Tue Jun 29 12:27:32 UTC 2010


Author: ctian
Date: Tue Jun 29 08:27:32 2010
New Revision: 529

Log:
Tests: add support for calling tests by (asdf:test-system :usocket)

Modified:
   usocket/trunk/test/test-usocket.lisp
   usocket/trunk/usocket-test.asd
   usocket/trunk/usocket.asd

Modified: usocket/trunk/test/test-usocket.lisp
==============================================================================
--- usocket/trunk/test/test-usocket.lisp	(original)
+++ usocket/trunk/test/test-usocket.lisp	Tue Jun 29 08:27:32 2010
@@ -142,7 +142,7 @@
       (unwind-protect
           (usocket::get-peer-address sock)
         (usocket:socket-close sock))))
-  +common-lisp-net+)
+  #.+common-lisp-net+)
 
 (deftest socket-name.2
   (with-caught-conditions (nil nil)
@@ -158,18 +158,19 @@
       (unwind-protect
           (usocket::get-peer-name sock)
         (usocket:socket-close sock))))
-  +common-lisp-net+)
+  #.+common-lisp-net+ 80)
 
 #+ignore
 (deftest socket-name.4
   (with-caught-conditions (nil nil)
     (let ((sock (usocket:socket-connect +common-lisp-net+ 80)))
       (unwind-protect
-          (usocket::get-local-address sock)
+          (equal (usocket::get-local-address sock) *local-ip*)
         (usocket:socket-close sock))))
-  *local-ip*)
+  t)
 
-(defparameter *wait-for-input-timeout* 2)
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (defparameter *wait-for-input-timeout* 2))
 
 (deftest wait-for-input.1
   (with-caught-conditions (nil nil)
@@ -179,7 +180,7 @@
           (progn (usocket:wait-for-input sock :timeout *wait-for-input-timeout*)
             (- (get-universal-time) time))
         (usocket:socket-close sock))))
-  *wait-for-input-timeout*)
+  #.*wait-for-input-timeout*)
 
 (deftest wait-for-input.2
   (with-caught-conditions (nil nil)
@@ -189,7 +190,7 @@
           (progn (usocket:wait-for-input sock :timeout *wait-for-input-timeout* :ready-only t)
             (- (get-universal-time) time))
         (usocket:socket-close sock))))
-  *wait-for-input-timeout*)
+  #.*wait-for-input-timeout*)
 
 (defun run-usocket-tests ()
   (do-tests))

Modified: usocket/trunk/usocket-test.asd
==============================================================================
--- usocket/trunk/usocket-test.asd	(original)
+++ usocket/trunk/usocket-test.asd	Tue Jun 29 08:27:32 2010
@@ -24,3 +24,6 @@
 		  :components ((:file "package")
 			       (:file "test-usocket"
 				      :depends-on ("package"))))))
+
+(defmethod perform ((op test-op) (c (eql (find-system :usocket-test))))
+  (funcall (intern "DO-TESTS" "USOCKET-TEST")))

Modified: usocket/trunk/usocket.asd
==============================================================================
--- usocket/trunk/usocket.asd	(original)
+++ usocket/trunk/usocket.asd	Tue Jun 29 08:27:32 2010
@@ -35,3 +35,6 @@
 			       #+allegro	(:file "allegro")
 			       #+armedbear	(:file "armedbear")))
 		 (:file "server" :depends-on ("backend"))))
+
+(defmethod perform ((op test-op) (c (eql (find-system :usocket))))
+  (oos 'test-op :usocket-test))




More information about the usocket-cvs mailing list