-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
26 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- | ||
;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*- | ||
;;; | ||
;;; io.streams-tests.asd --- ASDF system definition. | ||
;;; pkgdcl.lisp --- Package definition. | ||
;;; | ||
;;; Copyright (C) 2007, Luis Oliveira <[email protected]> | ||
;;; | ||
|
@@ -24,12 +24,8 @@ | |
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
;;; DEALINGS IN THE SOFTWARE. | ||
|
||
(asdf:defsystem io.streams-tests | ||
:description "Test suite for io-streams." | ||
:author "Luis Oliveira <[email protected]>" | ||
:licence "BSD" | ||
:depends-on (:rt :io.streams :alexandria) | ||
:pathname (merge-pathnames (make-pathname :directory '(:relative "tests")) | ||
*load-truename*) | ||
:components | ||
((:file "io.streams-tests"))) | ||
(in-package #:cl-user) | ||
|
||
(defpackage #:iolib-tests | ||
(:use #:common-lisp #:rtest #:net.sockets #:io.streams | ||
#:trivial-gray-streams #:alexandria)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Indent-tabs-mode: NIL -*- | ||
;;; | ||
;;; tests.lisp --- net.sockets test suite. | ||
;;; sockets.lisp --- net.sockets test suite. | ||
;;; | ||
;;; Copyright (C) 2007, Luis Oliveira <[email protected]> | ||
;;; | ||
|
@@ -31,13 +31,7 @@ | |
;;; released into the public domain in jurisdictions where this is | ||
;;; possible, or under the FreeBSD licence where not. | ||
|
||
(in-package #:common-lisp-user) | ||
|
||
(defpackage #:net.sockets-tests | ||
(:nicknames #:sockets-tests) | ||
(:use #:common-lisp #:rtest :net.sockets)) | ||
|
||
(in-package #:net.sockets-tests) | ||
(in-package #:iolib-tests) | ||
|
||
;;; A couple of these tests require an echo server. You can either | ||
;;; compile and run the provided tests/echo-server.c or enabled the | ||
|
@@ -424,7 +418,7 @@ | |
:type nil | ||
:defaults | ||
(asdf:system-definition-pathname | ||
(asdf:find-system '#:net.sockets-tests)))))) | ||
(asdf:find-system '#:iolib-tests)))))) | ||
(ignore-errors (delete-file file)) | ||
(with-socket (p :family :local :connect :passive :local-filename file) | ||
(with-socket (a :family :local :remote-filename file) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- | ||
;;; | ||
;;; tests.lisp --- IO.STREAMS test suite. | ||
;;; streams.lisp --- IO.STREAMS test suite. | ||
;;; | ||
;;; Copyright (c) 2006-2007, Dr. Edmund Weitz. All rights reserved. | ||
;;; Copyright (c) 2007, Luis Oliveira <[email protected]> | ||
|
@@ -29,13 +29,7 @@ | |
;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
(in-package :common-lisp-user) | ||
|
||
(defpackage #:io.streams-tests | ||
(:use #:common-lisp :rt :io.streams :alexandria | ||
:trivial-gray-streams)) | ||
|
||
(in-package #:io.streams-tests) | ||
(in-package #:iolib-tests) | ||
|
||
(defclass my-file-stream (dual-channel-single-fd-gray-stream) | ||
((path :initarg :path :reader file-stream-path))) | ||
|
@@ -56,6 +50,7 @@ | |
(:input :error) | ||
((:io :output) :create))) | ||
(external-format :default)) | ||
(declare (ignore if-does-not-exist)) | ||
;; move OPEN to INITIALIZE-INSTANCE | ||
(let ((fd (nix:open path | ||
(logior (ecase direction | ||
|
@@ -80,10 +75,11 @@ | |
(with-open-stream (,var ,stream) | ||
,@body)))) | ||
|
||
(defvar *this-dir* | ||
(defvar *data-dir* | ||
(let ((sys-pn (asdf:system-definition-pathname | ||
(asdf:find-system 'io.streams-tests)))) | ||
(make-pathname :directory (append (pathname-directory sys-pn) '("tests")) | ||
(asdf:find-system 'iolib-tests)))) | ||
(make-pathname :directory (append (pathname-directory sys-pn) | ||
'("tests" "data")) | ||
:defaults sys-pn))) | ||
|
||
(defvar *test-dir* | ||
|
@@ -171,9 +167,9 @@ | |
;;; check if the outcome is as expected. Uses various variants of the | ||
;;; :DIRECTION keyword when opening the files." | ||
(defun compare-files (path-in external-format-in path-out external-format-out) | ||
(let ((full-path-in (merge-pathnames path-in *this-dir*)) | ||
(let ((full-path-in (merge-pathnames path-in *data-dir*)) | ||
(full-path-out (merge-pathnames path-out *test-dir*)) | ||
(full-path-orig (merge-pathnames path-out *this-dir*))) | ||
(full-path-orig (merge-pathnames path-out *data-dir*))) | ||
(dolist (direction-out '(:output :io) t) | ||
(dolist (direction-in '(:input :io)) | ||
(let ((description (format nil "Test ~S ~A [~A] --> ~A [~A]" | ||
|
@@ -188,7 +184,7 @@ | |
(format *error-output* "~&;; Test failed!!!~%") | ||
(return-from compare-files nil))))))) | ||
|
||
(deftest big-comparision-test | ||
(deftest big-stream-comparision-test | ||
(let ((args-list (loop for (file-name symbols) in *test-files* | ||
nconc (create-test-combinations file-name symbols)))) | ||
(loop for args in args-list | ||
|