diff --git a/test/dll-test.lisp b/test/dll-test.lisp new file mode 100644 index 0000000000000000000000000000000000000000..60a6f9884964b482cb56b4c9e50a5d3772aa6c2f --- /dev/null +++ b/test/dll-test.lisp @@ -0,0 +1,9 @@ +#+ecl +(ffi:clines " +extern int sample_function(); + +int sample_function() +{ + return 42; +} +") diff --git a/test/dll-user.lisp b/test/dll-user.lisp new file mode 100644 index 0000000000000000000000000000000000000000..8e8d033ddcbaf2ee0f3940fb6be17789ce7ac597 --- /dev/null +++ b/test/dll-user.lisp @@ -0,0 +1,2 @@ +(in-package :test-package) +(ffi:def-function "sample_function" () :returning :int) diff --git a/test/file2.lisp b/test/file2.lisp index a8192bbd06204c9e62f5d976bed6d32ff69c9fc6..839f82d42114898cb89f4c07b476b65b4e359f29 100644 --- a/test/file2.lisp +++ b/test/file2.lisp @@ -1,2 +1,4 @@ (in-package :test-package) (assert *file1*) +(defvar *f2c* 0) +(incf *f2c*) diff --git a/test/test-asdf.asd b/test/test-asdf.asd index bc0a98df531a90c42747c348ff9400c8814f248e..39c1e21de68a9a20fbe2c3800e5af98949907742 100644 --- a/test/test-asdf.asd +++ b/test/test-asdf.asd @@ -70,3 +70,7 @@ (defsystem :test-asdf/bundle-2 :depends-on (:test-asdf/bundle-1) :components ((:file "file2"))) + +(defsystem :test-asdf/dll-test :components ((:file "dll-test"))) + +(defsystem :test-asdf/dll-user :components ((:file "dll-user"))) diff --git a/test/test-bundle.script b/test/test-bundle.script index b19bee9c1fef7bb7441430ddc5abe38a8259561b..209f80efcb145251673dffccf956b19282113d90 100644 --- a/test/test-bundle.script +++ b/test/test-bundle.script @@ -1,6 +1,4 @@ ;;; -*- Lisp -*- - - (in-package :asdf-test) ;;;--------------------------------------------------------------------------- @@ -11,9 +9,17 @@ (asdf:clear-system :test-asdf/bundle-1) (asdf:clear-system :test-asdf/bundle-2) (when (find-package :test-package) (delete-package :test-package)) -#+(or abcl (and ecl ecl-bytecmp) gcl) + +#+(or (and ecl ecl-bytecmp) gcl) ;; actually available on ABCL 1.2.0 and later. (leave-test "bundles not on this implementation" 0) +#+abcl +(let* ((version (lisp-implementation-version)) + (version-nums (subseq version 0 (position-if-not (lambda (x) (find x "0123456789.")) version)))) + (when (version< version-nums "1.2.0") + (leave-test "Your old ABCL is known to fail this test script, so skipping it." 0))) + + (defparameter *bundle-1* (output-file 'fasl-op :test-asdf/bundle-1)) (defparameter *bundle-2* (output-file 'fasl-op :test-asdf/bundle-2)) (defparameter *mono-bundle-2* (output-file 'monolithic-fasl-op :test-asdf/bundle-2)) @@ -33,3 +39,11 @@ (DBG "Now for the mono-fasl") (operate 'monolithic-fasl-op :test-asdf/bundle-2) (assert (probe-file *mono-bundle-2*)) + +;;; Test DLL-op on ECL. +#+ecl +(progn + (operate 'dll-op :test-asdf/dll-test) + (si:load-foreign-module (first (output-files 'dll-op :test-asdf/dll-test))) + (operate 'load-op :test-asdf/dll-user) + (assert (= (test-package::sample-function) 42)))