#!/usr/bin/make -f
pkg := uffi
-pkg-tests := $(pkg)-tests
+pkg-tests := $(pkg)-tests
debpkg := cl-$(pkg)
debpkg-tests := $(debpkg)-tests
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:
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
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)
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
;;;; 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
;;;;
;;;; (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))
(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)
;;;; Programmer: Kevin M. Rosenberg\r
;;;; Date Started: Feb 2002\r
;;;;\r
-;;;; $Id: compress.lisp,v 1.4 2003/03/10 17:37:05 kevin Exp $\r
+;;;; $Id: compress.lisp,v 1.5 2003/04/29 12:57:10 kevin Exp $\r
;;;;\r
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg\r
;;;;\r
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.\r
;;;; *************************************************************************\r
\r
-(in-package :cl-user)\r
+(in-package :uffi-tests)\r
\r
(eval-when (:load-toplevel :execute)\r
(unless (uffi:load-foreign-library\r
(uffi:free-foreign-object destlen)\r
(uffi:free-foreign-object dest)))))))\r
\r
-#+examples-uffi\r
-(progn\r
- (flet ((print-results (str)\r
- (multiple-value-bind (compressed len) (compress str)\r
- (let ((*print-length* nil))\r
- (format t "~&(compress ~S) => " str)\r
- (format t "~S~%" (map 'list #'char-code compressed))))))\r
- (print-results "")\r
- (print-results "test")\r
- (print-results "test2")))\r
-\r
#+test-uffi\r
(progn\r
(flet ((test-compress (str)\r
;;;; 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)
;;;; 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
;;;;
;;;; (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))
(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))))
;;;; 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
(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")))
-