From 0bf8fb658b7a8181a42792f7cb0de08b91f7a8d3 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Tue, 29 Apr 2003 12:57:10 +0000 Subject: [PATCH] r4701: *** empty log message *** --- debian/rules | 98 +++++++++++++++++++++++++++------------------ tests/atoifl.lisp | 24 +++-------- tests/compress.lisp | 15 +------ tests/package.lisp | 5 ++- tests/strtol.lisp | 28 +++---------- uffi-tests.asd | 14 +++++-- 6 files changed, 86 insertions(+), 98 deletions(-) diff --git a/debian/rules b/debian/rules index 36ea0d7..c83af85 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f pkg := uffi -pkg-tests := $(pkg)-tests +pkg-tests := $(pkg)-tests debpkg := cl-$(pkg) debpkg-tests := $(debpkg)-tests @@ -25,7 +25,7 @@ build: build-stamp build-stamp: configure-stamp dh_testdir # Add here commands to compile the package. - (cd examples; make linux) + (cd tests; make linux) touch build-stamp clean: @@ -34,8 +34,7 @@ clean: rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. -$(MAKE) clean - cd examples - make clean + (cd tests; make clean) rm -f debian/$(debpkg).postinst.* debian/$(debpkg).prerm.* dh_clean @@ -44,19 +43,13 @@ install: build dh_testroot dh_clean -k dh_installdirs --all $(clc-systems) $(clc-source) - dh_installdirs -p $(debpkg) $(doc-dir) $(clc-files)/src # Add here commands to install the package into debian/uffi. + dh_installdirs -p $(debpkg) $(doc-dir) $(clc-files)/src dh_install $(pkg).asd $(clc-files) dh_install "src/*.lisp" $(clc-files)/src dh_link $(clc-files)/$(pkg).asd $(clc-systems)/$(pkg).asd - dh_installdirs -p $(debpkg-tests) $(clc-tests)/tests $(lib-dir) - dh_install $(debpkg-tests) $(pkg-tests).asd $(clc-tests) - dh_install $(debpkg-tests) "examples/*.lisp" $(clc-tests)/tests - dh_install $(debpkg-tests) "examples/c-test-fns.so" $(lib-dir) - dh_link $(debpkg-tests) $(clc-tests)/$(pkg-tests).asd $(clc-systems)/$(clc-tests).$(pkg-tests)asd - rm -rf doc/html (cd doc; tar xzf html.tar.gz; cd ..) dh_install doc/html $(doc-dir) @@ -65,38 +58,67 @@ install: build gzip -9 doc/cl-uffi.pdf dh_install doc/cl-uffi.pdf.gz $(doc-dir) + dh_installdirs -p $(debpkg-tests) $(clc-tests)/tests $(lib-dir) + dh_install -p $(debpkg-tests) $(pkg-tests).asd $(clc-tests) + dh_install -p $(debpkg-tests) "tests/*.lisp" $(clc-tests)/tests + dh_install -p $(debpkg-tests) "tests/c-test-fns.so" $(lib-dir) + dh_link -p $(debpkg-tests) $(clc-tests)/$(pkg-tests).asd $(clc-systems)/$(pkg-tests).asd + # Build architecture-independent files here. binary-indep: build install - + dh_testdir -i + dh_testroot -i +# dh_installdebconf -i + dh_installdocs -i + dh_installexamples -i examples/*.lisp + dh_installmenu -i +# dh_installlogrotate -i +# dh_installemacsen -i +# dh_installpam -i +# dh_installmime -i +# dh_installinit -i + dh_installcron -i +# dh_installman -i + dh_installinfo -i +# dh_undocumented -i + dh_installchangelogs ChangeLog -i + dh_link -i + dh_compress -i + dh_fixperms -i + dh_installdeb -i +# dh_perl -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i # Build architecture-dependent files here. binary-arch: build install - dh_testdir - dh_testroot -# dh_installdebconf - dh_installdocs - dh_installexamples examples/*.lisp -# dh_installmenu -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installman -# dh_installinfo -# dh_undocumented - dh_installchangelogs ChangeLog - dh_strip - dh_compress - dh_fixperms -# dh_makeshlibs - dh_installdeb -# dh_perl - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb + dh_testdir -a + dh_testroot -a +# dh_installdebconf -a + dh_installdocs -a +# dh_installlogrotate -a +# dh_installemacsen -a +# dh_installpam -a +# dh_installmime -a +# dh_installinit -a +# dh_installcron -a +# dh_installman -a +# dh_installinfo -a +# dh_undocumented -a +# dh_makeshlibs -a +# dh_perl -a + dh_installchangelogs ChangeLog -a + dh_strip -a + dh_link -a + dh_compress -a + dh_fixperms -a + dh_installmenu -a + dh_installdeb -a + dh_gencontrol -a + dh_shlibdeps -a + dh_md5sums -a + dh_builddeb -a binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/tests/atoifl.lisp b/tests/atoifl.lisp index 47c194c..23bbda0 100644 --- a/tests/atoifl.lisp +++ b/tests/atoifl.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: atoifl.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $Id: atoifl.lisp,v 1.2 2003/04/29 12:57:10 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -16,7 +16,7 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(in-package :cl-user) +(in-package :uffi-tests) (uffi:def-function ("atoi" c-atoi) ((str :cstring)) @@ -40,20 +40,6 @@ (uffi:with-cstring (str-cstring str) (c-atof str-cstring))) -#+examples-uffi -(progn - (flet ((print-results (str) - (format t "~&(atoi ~S) => ~S" str (atoi str)))) - (print-results "55"))) - - -#+test-uffi -(progn - (util.test:test (atoi "123") 123 :test #'eql - :fail-info "Error with atoi") - (util.test:test (atoi "") 0 :test #'eql - :fail-info "Error with atoi") - (util.test:test (atof "2.23") 2.23d0 :test #'eql - :fail-info "Error with atof") - ) - +(deftest atoi.1 (atoi "123") 123) +(deftest atoi.2 (atoi "") 0) +(deftest atof.3 (atof "2.23") 2.23d0) diff --git a/tests/compress.lisp b/tests/compress.lisp index 02c8cd2..86d840d 100644 --- a/tests/compress.lisp +++ b/tests/compress.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: compress.lisp,v 1.4 2003/03/10 17:37:05 kevin Exp $ +;;;; $Id: compress.lisp,v 1.5 2003/04/29 12:57:10 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -16,7 +16,7 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(in-package :cl-user) +(in-package :uffi-tests) (eval-when (:load-toplevel :execute) (unless (uffi:load-foreign-library @@ -91,17 +91,6 @@ (uffi:free-foreign-object destlen) (uffi:free-foreign-object dest))))))) -#+examples-uffi -(progn - (flet ((print-results (str) - (multiple-value-bind (compressed len) (compress str) - (let ((*print-length* nil)) - (format t "~&(compress ~S) => " str) - (format t "~S~%" (map 'list #'char-code compressed)))))) - (print-results "") - (print-results "test") - (print-results "test2"))) - #+test-uffi (progn (flet ((test-compress (str) diff --git a/tests/package.lisp b/tests/package.lisp index 7db77f2..97f56a5 100644 --- a/tests/package.lisp +++ b/tests/package.lisp @@ -7,11 +7,12 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Apr 2003 ;;;; -;;;; $Id: package.lisp,v 1.1 2003/04/29 12:42:03 kevin Exp $ +;;;; $Id: package.lisp,v 1.2 2003/04/29 12:57:10 kevin Exp $ ;;;; ************************************************************************* (defpackage #:uffi-tests - (:use #:asdf #:cl #:uffi #:rtest)) + (:use #:asdf #:cl #:uffi #:rtest) + (:shadowing-import-from #:uffi #:run-shell-command)) (in-package #:uffi-tests) diff --git a/tests/strtol.lisp b/tests/strtol.lisp index c2956e3..1cb1be9 100644 --- a/tests/strtol.lisp +++ b/tests/strtol.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: strtol.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $Id: strtol.lisp,v 1.2 2003/04/29 12:57:10 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -16,7 +16,7 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(in-package :cl-user) +(in-package :uffi-tests) (uffi:def-foreign-type char-ptr (* :unsigned-char)) @@ -57,27 +57,11 @@ of first non-valid character" (uffi:free-foreign-object str-native) (uffi:free-foreign-object endptr))))) - - -#+examples-uffi -(progn - (flet ((print-results (str) - (multiple-value-bind (result flag) (strtol str) - (format t "~&(strtol ~S) => ~S,~S" str result flag)))) - (print-results "55") - (print-results "55.3") - (print-results "a"))) +(deftest strtol.1 (strtol "123") 123 t) +(deftest strtol.2 (strtol "0") 0 t) +(deftest strtol.3 (strtol "55a") 55 2) +(deftest strtol.4 (strtol "a") nil nil) -#+test-uffi -(progn - (flet ((test-strtol (str results) - (util.test:test (multiple-value-list (strtol str)) results - :test #'equal - :fail-info "Error testing strtol"))) - (test-strtol "123" '(123 t)) - (test-strtol "0" '(0 t)) - (test-strtol "55a" '(55 2)) - (test-strtol "a" '(nil nil)))) diff --git a/uffi-tests.asd b/uffi-tests.asd index 37a3e9f..d3c9ccc 100644 --- a/uffi-tests.asd +++ b/uffi-tests.asd @@ -7,7 +7,7 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Apr 2003 ;;;; -;;;; $Id: uffi-tests.asd,v 1.1 2003/04/29 12:09:36 kevin Exp $ +;;;; $Id: uffi-tests.asd,v 1.2 2003/04/29 12:57:10 kevin Exp $ ;;;; ************************************************************************* (defpackage #:uffi-tests-system @@ -15,11 +15,17 @@ (in-package #:uffi-tests-system) (defsystem uffi-tests - :depends-on (:rt :uffi) - :components ((:file "tests"))) + :depends-on (:uffi) + :components + ((:module tests + :components + ((:file "rt") + (:file "package" :depends-on ("rt")) + (:file "strtol" :depends-on ("package")) + (:file "atoifl" :depends-on ("package")) + )))) (defmethod perform ((o test-op) (c (eql (find-system :uffi-tests)))) (or (funcall (intern (symbol-name '#:do-tests) (find-package '#:regression-test))) (error "test-op failed"))) - -- 2.34.1