diff --git a/test/ecl-prebuilt-systems.script b/test/ecl-prebuilt-systems.script new file mode 100644 index 0000000000000000000000000000000000000000..62a8406a0b4cadac83dca087e32b89c977252e92 --- /dev/null +++ b/test/ecl-prebuilt-systems.script @@ -0,0 +1,9 @@ +;;; -*- Lisp -*- + +(DBG "Regression test: Test if dependencies on prebuilt libraries work. +Should load from ecl-prebuilt-systems/") + +#+(and ecl (not ecl-bytecmp)) +(progn + (chdir (subpathname *test-directory* "ecl-prebuilt-systems/")) + (load "readme.lisp")) diff --git a/test/ecl-prebuilt-systems/hello.lisp b/test/ecl-prebuilt-systems/hello.lisp new file mode 100644 index 0000000000000000000000000000000000000000..dba21f6e9c69388f9f71d5d1cda2e823a9e8f10f --- /dev/null +++ b/test/ecl-prebuilt-systems/hello.lisp @@ -0,0 +1,3 @@ +(in-package #:cl-user) + +(print `(:asdf-version ,(asdf:asdf-version))) diff --git a/test/ecl-prebuilt-systems/hellow.asd b/test/ecl-prebuilt-systems/hellow.asd new file mode 100644 index 0000000000000000000000000000000000000000..b418b325c074b34ca23cf084b509bce5001a68c9 --- /dev/null +++ b/test/ecl-prebuilt-systems/hellow.asd @@ -0,0 +1,4 @@ +(asdf:defsystem #:hellow + :serial t + :depends-on (#:asdf) + :components ((:file "hello"))) diff --git a/test/ecl-prebuilt-systems/readme.lisp b/test/ecl-prebuilt-systems/readme.lisp new file mode 100644 index 0000000000000000000000000000000000000000..e37e8ca9440a497dab921df3b90729882ed1be2a --- /dev/null +++ b/test/ecl-prebuilt-systems/readme.lisp @@ -0,0 +1,59 @@ +;;; +;;; DESCRIPTION: +;;; +;;; This file builds a standalone executable with a dependency on +;;; ASDF. +;;; +;;; +;;; USE: +;;; +;;; Launch a copy of ECL and load this file in it +;;; +;;; (load "readme.lisp") +;;; +(require 'asdf) + +(format t " +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; BUILDING A STANDALONE EXECUTABLE +;;; +") + +;; +;; * Combine files in a standalone executable. We reuse the files +;; from the previous example +;; + +(defconstant +standalone-exe+ (compile-file-pathname "hellow" :type :program)) + +(push (make-pathname :name nil :type nil :version nil + :defaults *load-truename*) + asdf:*central-registry*) + +(asdf:make-build :hellow + :type :program + :move-here "./" + :prologue-code "printf(\"Good morning sunshine!\");" + :epilogue-code '(progn + (format t "~%Good bye sunshine.~%") + (ext:quit 0))) + +;; +;; * Test the program +;; +(format t " +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; TESTING A STANDALONE EXECUTABLE +;;; + +") +(uiop:run-program (format nil "./~A" +standalone-exe+) :output *standard-output*) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; CLEAN UP +;;; + +(delete-file +standalone-exe+)