Commit 7ee04bd1 authored by Daniel Kochmański's avatar Daniel Kochmański Committed by Francois-Rene Rideau
Browse files

bundle: add regression test for prebuilt systems

parent 6475bce3
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
;;; -*- 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"))
+3 −0
Original line number Original line Diff line number Diff line
(in-package #:cl-user)

(print `(:asdf-version ,(asdf:asdf-version)))
+4 −0
Original line number Original line Diff line number Diff line
(asdf:defsystem #:hellow
  :serial t
  :depends-on (#:asdf)
  :components ((:file "hello")))
+59 −0
Original line number Original line Diff line number Diff line
;;;
;;; 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+)