From d65c8dc6afa16cf62a809d9d2c689da85e64d720 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Tue, 23 Jan 2024 16:52:02 -0600 Subject: [PATCH] Test that buildapp does not see `--dynamic-space-size` Running the `tests/runtime-args-test.sh` on this branch (after `make`) as cd tests BUILDAPP=../buildapp ./runtime-args-test.sh will `describe` the `dumper` object after parsing the command line, demonstrating that the `dynamic-space-size` slot is unset. --- command-line.lisp | 5 +---- tests/runtime-args-test.sh | 8 ++++++++ tests/src.lisp | 6 ++++++ tests/test-system.asd | 2 ++ 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100755 tests/runtime-args-test.sh create mode 100644 tests/src.lisp create mode 100644 tests/test-system.asd diff --git a/command-line.lisp b/command-line.lisp index 41cb9c8..bda9bf8 100644 --- a/command-line.lisp +++ b/command-line.lisp @@ -109,6 +109,7 @@ (unless (output plan) (error 'missing-output-argument)) (setf (asdf-directives plan) (reverse (asdf-directives plan))) + (describe plan) (return plan)) (let* ((argument (pop args)) (value (pop args)) @@ -162,7 +163,3 @@ (setf (dynamic-space-size plan) (parse-integer value))) (t (error 'unknown-argument :flag argument))))))) - - - - diff --git a/tests/runtime-args-test.sh b/tests/runtime-args-test.sh new file mode 100755 index 0000000..30c0d88 --- /dev/null +++ b/tests/runtime-args-test.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +THIS_DIR=$(realpath $(dirname ${BASH_SOURCE})) +BUILDAPP=${BUILDAPP:-buildapp} + + +${BUILDAPP} --output test-app --dynamic-space-size 100000 --asdf-path ${THIS_DIR}/ --load-system test-system --entry 'cl-user::main' --dumpfile-copy ./dumpfile.lisp + diff --git a/tests/src.lisp b/tests/src.lisp new file mode 100644 index 0000000..ed9e900 --- /dev/null +++ b/tests/src.lisp @@ -0,0 +1,6 @@ +(in-package :cl-user) + +(defun main (argv) + (declare (ignore argv)) + (format t "~&This is the test application~%") + (uiop:quit 0)) diff --git a/tests/test-system.asd b/tests/test-system.asd new file mode 100644 index 0000000..0abce62 --- /dev/null +++ b/tests/test-system.asd @@ -0,0 +1,2 @@ +(defsystem test-system + :components ((:file "src")))