Commit e32988a7 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Add dll-op test on ECL.

parent e0f6b19d
Loading
Loading
Loading
Loading

test/dll-test.lisp

0 → 100644
+9 −0
Original line number Original line Diff line number Diff line
#+ecl
(ffi:clines "
extern int sample_function();

int sample_function()
{
	return 42;
}
")

test/dll-user.lisp

0 → 100644
+2 −0
Original line number Original line Diff line number Diff line
(in-package :test-package)
(ffi:def-function "sample_function" () :returning :int)
+2 −0
Original line number Original line Diff line number Diff line
(in-package :test-package)
(in-package :test-package)
(assert *file1*)
(assert *file1*)
(defvar *f2c* 0)
(incf *f2c*)
+4 −0
Original line number Original line Diff line number Diff line
@@ -70,3 +70,7 @@


(defsystem :test-asdf/bundle-2
(defsystem :test-asdf/bundle-2
  :depends-on (:test-asdf/bundle-1) :components ((:file "file2")))
  :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")))
+17 −3
Original line number Original line Diff line number Diff line
;;; -*- Lisp -*-
;;; -*- Lisp -*-


(in-package :asdf-test)
(in-package :asdf-test)


;;;---------------------------------------------------------------------------
;;;---------------------------------------------------------------------------
@@ -11,9 +9,17 @@
(asdf:clear-system :test-asdf/bundle-1)
(asdf:clear-system :test-asdf/bundle-1)
(asdf:clear-system :test-asdf/bundle-2)
(asdf:clear-system :test-asdf/bundle-2)
(when (find-package :test-package) (delete-package :test-package))
(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)
(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-1* (output-file 'fasl-op :test-asdf/bundle-1))
(defparameter *bundle-2* (output-file 'fasl-op :test-asdf/bundle-2))
(defparameter *bundle-2* (output-file 'fasl-op :test-asdf/bundle-2))
(defparameter *mono-bundle-2* (output-file 'monolithic-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")
(DBG "Now for the mono-fasl")
(operate 'monolithic-fasl-op :test-asdf/bundle-2)
(operate 'monolithic-fasl-op :test-asdf/bundle-2)
(assert (probe-file *mono-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)))