From 9ac9614e85d2fc6eed0505c5c758aaa2cb77bc3a Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Tue, 8 Mar 2016 11:49:59 -0700 Subject: [PATCH] Use new --prepend-library option to build and test the plugins. --- src/blowfish/Makefile.am | 7 ++++--- src/blowfish/blowfish-check.sh | 9 +++++++++ src/blowfish/check-scm | 2 -- src/blowfish/check.scm | 9 --------- src/blowfish/compile.scm | 9 ++------- src/blowfish/optiondb.scm | 11 +++++++++++ src/gdbm/Makefile.am | 7 ++++--- src/gdbm/check-scm | 2 -- src/gdbm/check.scm | 9 --------- src/gdbm/compile.scm | 9 ++------- src/gdbm/gdbm-check.sh | 9 +++++++++ src/gdbm/optiondb.scm | 9 +++++++++ src/mcrypt/Makefile.am | 7 ++++--- src/mcrypt/check-scm | 2 -- src/mcrypt/check.scm | 9 --------- src/mcrypt/compile.scm | 9 ++------- src/mcrypt/mcrypt-check.sh | 9 +++++++++ src/mcrypt/optiondb.scm | 9 +++++++++ src/md5/Makefile.am | 7 ++++--- src/md5/check-scm | 2 -- src/md5/check.scm | 9 --------- src/md5/compile.scm | 9 ++------- src/md5/md5-check.sh | 9 +++++++++ src/md5/optiondb.scm | 9 +++++++++ src/mhash/Makefile.am | 7 ++++--- src/mhash/check-scm | 2 -- src/mhash/check.scm | 9 --------- src/mhash/compile.scm | 9 ++------- src/mhash/mhash-check.sh | 9 +++++++++ src/mhash/optiondb.scm | 9 +++++++++ tests/ffi/Makefile.am | 2 -- tests/ffi/optiondb.scm | 8 ++++++++ tests/ffi/test-ffi | 3 --- tests/ffi/test-ffi-wrapper.scm | 15 ++++++++------- tests/ffi/test-ffi.scm | 24 +++++++++++------------- tests/ffi/test-ffi.sh | 11 +++++++++++ 36 files changed, 160 insertions(+), 130 deletions(-) create mode 100755 src/blowfish/blowfish-check.sh delete mode 100755 src/blowfish/check-scm delete mode 100644 src/blowfish/check.scm create mode 100644 src/blowfish/optiondb.scm delete mode 100755 src/gdbm/check-scm delete mode 100644 src/gdbm/check.scm create mode 100755 src/gdbm/gdbm-check.sh create mode 100644 src/gdbm/optiondb.scm delete mode 100755 src/mcrypt/check-scm delete mode 100644 src/mcrypt/check.scm create mode 100755 src/mcrypt/mcrypt-check.sh create mode 100644 src/mcrypt/optiondb.scm delete mode 100755 src/md5/check-scm delete mode 100644 src/md5/check.scm create mode 100755 src/md5/md5-check.sh create mode 100644 src/md5/optiondb.scm delete mode 100755 src/mhash/check-scm delete mode 100644 src/mhash/check.scm create mode 100755 src/mhash/mhash-check.sh create mode 100644 src/mhash/optiondb.scm create mode 100644 tests/ffi/optiondb.scm delete mode 100755 tests/ffi/test-ffi create mode 100755 tests/ffi/test-ffi.sh diff --git a/src/blowfish/Makefile.am b/src/blowfish/Makefile.am index c8fdbde84..34591f9d8 100644 --- a/src/blowfish/Makefile.am +++ b/src/blowfish/Makefile.am @@ -58,13 +58,14 @@ blowfish-const.scm: blowfish-const blowfish.bin blowfish.bci blowfish.com blowfish-@MIT_SCHEME_OS_SUFFIX@.pkd: \ blowfish.scm blowfish-const.bin blowfish-types.bin - echo '(load "compile.scm")' | $(MIT_SCHEME_EXE) --batch-mode + echo '(load "compile.scm")' \ + | $(MIT_SCHEME_EXE) --prepend-library . --batch-mode CLEANFILES = blowfish-const* blowfish-shim.c CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd -CLEANFILES += test -TESTS = check-scm +TESTS = blowfish-check.sh +CLEANFILES += test install-data-hook: echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \ diff --git a/src/blowfish/blowfish-check.sh b/src/blowfish/blowfish-check.sh new file mode 100755 index 000000000..470c8d64e --- /dev/null +++ b/src/blowfish/blowfish-check.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Test the BLOWFISH option. + +set -e +${MIT_SCHEME_EXE} --prepend-library . <environment '(blowfish))) +EOF diff --git a/src/blowfish/check-scm b/src/blowfish/check-scm deleted file mode 100755 index 4f89998ed..000000000 --- a/src/blowfish/check-scm +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo '(load "check.scm")' | ${MIT_SCHEME_EXE} diff --git a/src/blowfish/check.scm b/src/blowfish/check.scm deleted file mode 100644 index 2c6c1bed2..000000000 --- a/src/blowfish/check.scm +++ /dev/null @@ -1,9 +0,0 @@ -#| -*-Scheme-*- |# - -;;;; Test the BLOWFISH option. - -(load "make") -(with-system-library-directories - '("./") - (lambda () - (load "blowfish-check" (->environment '(blowfish))))) \ No newline at end of file diff --git a/src/blowfish/compile.scm b/src/blowfish/compile.scm index d42c8b7c3..29b4c5bf9 100644 --- a/src/blowfish/compile.scm +++ b/src/blowfish/compile.scm @@ -4,10 +4,5 @@ (load-option 'CREF) (load-option 'FFI) -(with-working-directory-pathname (directory-pathname (current-load-pathname)) - (lambda () - (with-system-library-directories - '("./") - (lambda () - (compile-file "blowfish" '() (->environment '(RUNTIME))))) - (cref/generate-constructors "blowfish" 'ALL))) \ No newline at end of file +(compile-file "blowfish" '() (->environment '(RUNTIME))) +(cref/generate-constructors "blowfish" 'ALL) \ No newline at end of file diff --git a/src/blowfish/optiondb.scm b/src/blowfish/optiondb.scm new file mode 100644 index 000000000..24ddca067 --- /dev/null +++ b/src/blowfish/optiondb.scm @@ -0,0 +1,11 @@ +#| -*-Scheme-*- |# + +;;;; Test optiondb, includes the installed system's optiondb. + +(define-load-option 'BLOWFISH + (standard-system-loader ".")) + +(further-load-options + (merge-pathnames "optiondb" + (cadr (access library-directory-path + (->environment '(runtime pathname)))))) \ No newline at end of file diff --git a/src/gdbm/Makefile.am b/src/gdbm/Makefile.am index 5709e13e4..2374b8782 100644 --- a/src/gdbm/Makefile.am +++ b/src/gdbm/Makefile.am @@ -56,13 +56,14 @@ gdbm-const.scm: gdbm-const ./gdbm-const gdbm.bin gdbm.bci gdbm.com gdbm-unx.pkd: gdbm.scm gdbm-const.bin gdbm-types.bin - echo '(load "compile.scm")' | $(MIT_SCHEME_EXE) --batch-mode + echo '(load "compile.scm")' \ + | $(MIT_SCHEME_EXE) --prepend-library . --batch-mode CLEANFILES = gdbm-const* gdbm-shim.c CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd -CLEANFILES += test -TESTS = check-scm +TESTS = gdbm-check.sh +CLEANFILES += gdbm-check.db install-data-hook: echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \ diff --git a/src/gdbm/check-scm b/src/gdbm/check-scm deleted file mode 100755 index 4f89998ed..000000000 --- a/src/gdbm/check-scm +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo '(load "check.scm")' | ${MIT_SCHEME_EXE} diff --git a/src/gdbm/check.scm b/src/gdbm/check.scm deleted file mode 100644 index 62b8095e2..000000000 --- a/src/gdbm/check.scm +++ /dev/null @@ -1,9 +0,0 @@ -#| -*-Scheme-*- |# - -;;;; Test the GDBM option. - -(load "make") -(with-system-library-directories - '("./") - (lambda () - (load "gdbm-check" (->environment '(gdbm))))) \ No newline at end of file diff --git a/src/gdbm/compile.scm b/src/gdbm/compile.scm index 2479f78ec..685ee26c3 100644 --- a/src/gdbm/compile.scm +++ b/src/gdbm/compile.scm @@ -4,10 +4,5 @@ (load-option 'CREF) (load-option 'FFI) -(with-working-directory-pathname (directory-pathname (current-load-pathname)) - (lambda () - (with-system-library-directories - '("./") - (lambda () - (compile-file "gdbm" '() (->environment '(RUNTIME))))) - (cref/generate-constructors "gdbm" 'ALL))) \ No newline at end of file +(compile-file "gdbm" '() (->environment '(RUNTIME))) +(cref/generate-constructors "gdbm" 'ALL) \ No newline at end of file diff --git a/src/gdbm/gdbm-check.sh b/src/gdbm/gdbm-check.sh new file mode 100755 index 000000000..805c28128 --- /dev/null +++ b/src/gdbm/gdbm-check.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Test the GDBM option. + +set -e +${MIT_SCHEME_EXE} --prepend-library . <environment '(gdbm))) +EOF diff --git a/src/gdbm/optiondb.scm b/src/gdbm/optiondb.scm new file mode 100644 index 000000000..12e8fe207 --- /dev/null +++ b/src/gdbm/optiondb.scm @@ -0,0 +1,9 @@ +#| -*-Scheme-*- |# + +(define-load-option 'GDBM + (standard-system-loader ".")) + +(further-load-options + (merge-pathnames "optiondb" + (cadr (access library-directory-path + (->environment '(runtime pathname)))))) \ No newline at end of file diff --git a/src/mcrypt/Makefile.am b/src/mcrypt/Makefile.am index 6c1cddbd8..8a230cb8b 100644 --- a/src/mcrypt/Makefile.am +++ b/src/mcrypt/Makefile.am @@ -57,13 +57,14 @@ mcrypt-const.scm: mcrypt-const mcrypt.bin mcrypt.bci mcrypt.com mcrypt-unx.pkd: \ mcrypt.scm mcrypt-const.bin mcrypt-types.bin - echo '(load "compile.scm")' | $(MIT_SCHEME_EXE) --batch-mode + echo '(load "compile.scm")' \ + | $(MIT_SCHEME_EXE) --prepend-library . --batch-mode CLEANFILES = mcrypt-const* mcrypt-shim.c CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd -CLEANFILES += test -TESTS = check-scm +TESTS = mcrypt-check.sh +CLEANFILES += encrypted decrypted install-data-hook: echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \ diff --git a/src/mcrypt/check-scm b/src/mcrypt/check-scm deleted file mode 100755 index 4f89998ed..000000000 --- a/src/mcrypt/check-scm +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo '(load "check.scm")' | ${MIT_SCHEME_EXE} diff --git a/src/mcrypt/check.scm b/src/mcrypt/check.scm deleted file mode 100644 index f47a4edaa..000000000 --- a/src/mcrypt/check.scm +++ /dev/null @@ -1,9 +0,0 @@ -#| -*-Scheme-*- |# - -;;;; Test the MCRYPT option. - -(load "make") -(with-system-library-directories - '("./") - (lambda () - (load "mcrypt-check" (->environment '(mcrypt))))) \ No newline at end of file diff --git a/src/mcrypt/compile.scm b/src/mcrypt/compile.scm index c5576c077..a83ce932e 100644 --- a/src/mcrypt/compile.scm +++ b/src/mcrypt/compile.scm @@ -4,10 +4,5 @@ (load-option 'CREF) (load-option 'FFI) -(with-working-directory-pathname (directory-pathname (current-load-pathname)) - (lambda () - (with-system-library-directories - '("./") - (lambda () - (compile-file "mcrypt" '() (->environment '(RUNTIME))))) - (cref/generate-constructors "mcrypt" 'ALL))) \ No newline at end of file +(compile-file "mcrypt" '() (->environment '(RUNTIME))) +(cref/generate-constructors "mcrypt" 'ALL) \ No newline at end of file diff --git a/src/mcrypt/mcrypt-check.sh b/src/mcrypt/mcrypt-check.sh new file mode 100755 index 000000000..553337d0e --- /dev/null +++ b/src/mcrypt/mcrypt-check.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Test the MCRYPT option. + +set -e +${MIT_SCHEME_EXE} --prepend-library . <environment '(mcrypt))) +EOF diff --git a/src/mcrypt/optiondb.scm b/src/mcrypt/optiondb.scm new file mode 100644 index 000000000..c442a1ae7 --- /dev/null +++ b/src/mcrypt/optiondb.scm @@ -0,0 +1,9 @@ +#| -*-Scheme-*- |# + +(define-load-option 'MCRYPT + (standard-system-loader ".")) + +(further-load-options + (merge-pathnames "optiondb" + (cadr (access library-directory-path + (->environment '(runtime pathname)))))) \ No newline at end of file diff --git a/src/md5/Makefile.am b/src/md5/Makefile.am index 132ed7a50..0f894dd24 100644 --- a/src/md5/Makefile.am +++ b/src/md5/Makefile.am @@ -57,13 +57,14 @@ md5-const.scm: md5-const ./md5-const md5.bin md5.bci md5.com md5-unx.pkd: md5.scm md5-const.bin md5-types.bin - echo '(load "compile.scm")' | $(MIT_SCHEME_EXE) --batch-mode + echo '(load "compile.scm")' \ + | $(MIT_SCHEME_EXE) --prepend-library . --batch-mode CLEANFILES = md5-const* md5-shim.c CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd -CLEANFILES += test -TESTS = check-scm +TESTS = md5-check.sh +CLEANFILES += sample install-data-hook: echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \ diff --git a/src/md5/check-scm b/src/md5/check-scm deleted file mode 100755 index 4f89998ed..000000000 --- a/src/md5/check-scm +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo '(load "check.scm")' | ${MIT_SCHEME_EXE} diff --git a/src/md5/check.scm b/src/md5/check.scm deleted file mode 100644 index 060027afe..000000000 --- a/src/md5/check.scm +++ /dev/null @@ -1,9 +0,0 @@ -#| -*-Scheme-*- |# - -;;;; Test the MD5 option. - -(load "make") -(with-system-library-directories - '("./") - (lambda () - (load "md5-check" (->environment '(md5))))) \ No newline at end of file diff --git a/src/md5/compile.scm b/src/md5/compile.scm index 93bc0da8b..ddf0ede07 100644 --- a/src/md5/compile.scm +++ b/src/md5/compile.scm @@ -4,10 +4,5 @@ (load-option 'CREF) (load-option 'FFI) -(with-working-directory-pathname (directory-pathname (current-load-pathname)) - (lambda () - (with-system-library-directories - '("./") - (lambda () - (compile-file "md5" '() (->environment '(RUNTIME))))) - (cref/generate-constructors "md5" 'ALL))) \ No newline at end of file +(compile-file "md5" '() (->environment '(RUNTIME))) +(cref/generate-constructors "md5" 'ALL) \ No newline at end of file diff --git a/src/md5/md5-check.sh b/src/md5/md5-check.sh new file mode 100755 index 000000000..a8f05d03c --- /dev/null +++ b/src/md5/md5-check.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Test the MD5 option. + +set -e +${MIT_SCHEME_EXE} --prepend-library . <environment '(md5))) +EOF diff --git a/src/md5/optiondb.scm b/src/md5/optiondb.scm new file mode 100644 index 000000000..bb18b9306 --- /dev/null +++ b/src/md5/optiondb.scm @@ -0,0 +1,9 @@ +#| -*-Scheme-*- |# + +(define-load-option 'MD5 + (standard-system-loader ".")) + +(further-load-options + (merge-pathnames "optiondb" + (cadr (access library-directory-path + (->environment '(runtime pathname)))))) \ No newline at end of file diff --git a/src/mhash/Makefile.am b/src/mhash/Makefile.am index aab510bb5..f5f1f9347 100644 --- a/src/mhash/Makefile.am +++ b/src/mhash/Makefile.am @@ -57,13 +57,14 @@ mhash-const.scm: mhash-const mhash.bin mhash.bci mhash.com mhash-unx.pkd: \ mhash.scm mhash-const.bin mhash-types.bin - echo '(load "compile.scm")' | $(MIT_SCHEME_EXE) --batch-mode + echo '(load "compile.scm")' \ + | $(MIT_SCHEME_EXE) --prepend-library . --batch-mode CLEANFILES = mhash-const* mhash-shim.c CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd -CLEANFILES += test -TESTS = check-scm +TESTS = mhash-check.sh +CLEANFILES += sample install-data-hook: echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \ diff --git a/src/mhash/check-scm b/src/mhash/check-scm deleted file mode 100755 index 4f89998ed..000000000 --- a/src/mhash/check-scm +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo '(load "check.scm")' | ${MIT_SCHEME_EXE} diff --git a/src/mhash/check.scm b/src/mhash/check.scm deleted file mode 100644 index a03b9f754..000000000 --- a/src/mhash/check.scm +++ /dev/null @@ -1,9 +0,0 @@ -#| -*-Scheme-*- |# - -;;;; Test the MHASH option. - -(load "make") -(with-system-library-directories - '("./") - (lambda () - (load "mhash-check" (->environment '(mhash))))) \ No newline at end of file diff --git a/src/mhash/compile.scm b/src/mhash/compile.scm index 9719d7781..1103428d8 100644 --- a/src/mhash/compile.scm +++ b/src/mhash/compile.scm @@ -4,10 +4,5 @@ (load-option 'CREF) (load-option 'FFI) -(with-working-directory-pathname (directory-pathname (current-load-pathname)) - (lambda () - (with-system-library-directories - '("./") - (lambda () - (compile-file "mhash" '() (->environment '(RUNTIME))))) - (cref/generate-constructors "mhash" 'ALL))) \ No newline at end of file +(compile-file "mhash" '() (->environment '(RUNTIME))) +(cref/generate-constructors "mhash" 'ALL) \ No newline at end of file diff --git a/src/mhash/mhash-check.sh b/src/mhash/mhash-check.sh new file mode 100755 index 000000000..038ded0bd --- /dev/null +++ b/src/mhash/mhash-check.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Test the MHASH option. + +set -e +${MIT_SCHEME_EXE} --prepend-library . <environment '(mhash))) +EOF diff --git a/src/mhash/optiondb.scm b/src/mhash/optiondb.scm new file mode 100644 index 000000000..f4b04f324 --- /dev/null +++ b/src/mhash/optiondb.scm @@ -0,0 +1,9 @@ +#| -*-Scheme-*- |# + +(define-load-option 'MHASH + (standard-system-loader ".")) + +(further-load-options + (merge-pathnames "optiondb" + (cadr (access library-directory-path + (->environment '(runtime pathname)))))) \ No newline at end of file diff --git a/tests/ffi/Makefile.am b/tests/ffi/Makefile.am index 5f996252d..c2a98f191 100644 --- a/tests/ffi/Makefile.am +++ b/tests/ffi/Makefile.am @@ -54,5 +54,3 @@ ffi-test.bin ffi-test.bci ffi-test.com ffi-test-unx.pkd: \ CLEANFILES = ffi-test-const* ffi-test-shim.c CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd - -TESTS = test-ffi diff --git a/tests/ffi/optiondb.scm b/tests/ffi/optiondb.scm new file mode 100644 index 000000000..e605f2d37 --- /dev/null +++ b/tests/ffi/optiondb.scm @@ -0,0 +1,8 @@ +#| -*-Scheme-*- |# + +;;;; Test optiondb, includes the installed system's optiondb. + +(further-load-options + (merge-pathnames "optiondb" + (cadr (access library-directory-path + (->environment '(runtime pathname)))))) \ No newline at end of file diff --git a/tests/ffi/test-ffi b/tests/ffi/test-ffi deleted file mode 100755 index c296e99d9..000000000 --- a/tests/ffi/test-ffi +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -echo '(load "test-ffi.scm")' \ -| ../../src/microcode/scheme --library ../../src/lib --batch-mode diff --git a/tests/ffi/test-ffi-wrapper.scm b/tests/ffi/test-ffi-wrapper.scm index 54e444b59..36058b5f5 100644 --- a/tests/ffi/test-ffi-wrapper.scm +++ b/tests/ffi/test-ffi-wrapper.scm @@ -2,14 +2,15 @@ (C-include "ffi-test") -(define test-ffi - (let ((libdir (merge-pathnames "./"))) - (named-lambda (test-ffi) - (with-system-library-directories (list libdir) - (lambda () - (test-ffi*)))))) +(define (assert-equal value expected . properties) + (if (not (equal? value expected)) + (error "Assert-equal failed:" value expected properties))) -(define (test-ffi*) +(define (assert-= value expected . properties) + (if (not (equal? value expected)) + (error "Assert-= failed:" value expected properties))) + +(define (test-ffi) (let* ((struct (malloc (c-sizeof "TestStruct") '|TestStruct|)) (string "input string") (pi (* 4 (atan 1 1))) diff --git a/tests/ffi/test-ffi.scm b/tests/ffi/test-ffi.scm index ba4724c32..5d4e8065d 100644 --- a/tests/ffi/test-ffi.scm +++ b/tests/ffi/test-ffi.scm @@ -30,19 +30,17 @@ USA. (lambda () (let ((port (notification-output-port))) (fresh-line port) - (write-string "make all in tests/ffi/" port) + (write-string "./autobuild.sh in tests/ffi/" port) (newline port)) (let ((status (run-synchronous-subprocess "sh" '("./autobuild.sh")))) (if (not (zero? status)) - (begin - (write-string "../tests/ffi/test-ffi.scm:0: Test FFI build failed." - (notification-output-port)) - (error "Test FFI build failed:" status)) - (begin - (parameterize ((param:suppress-loading-message? #t)) - (load-option 'FFI)) - (with-system-library-directories '("./") - (lambda () - (compile-file "test-ffi-wrapper"))) - (load "test-ffi-wrapper") - (define-test 'ffi test-ffi)))))) \ No newline at end of file + (error "Test FFI build failed:" status))) + (define-test 'ffi + (let ((cwd (working-directory-pathname))) + (named-lambda (test-ffi) + (with-working-directory-pathname cwd + (lambda () + (let ((status + (run-synchronous-subprocess "sh" '("./test-ffi.sh")))) + (if (not (zero? status)) + (error "Test FFI check failed:" status)))))))))) \ No newline at end of file diff --git a/tests/ffi/test-ffi.sh b/tests/ffi/test-ffi.sh new file mode 100755 index 000000000..8793b0cd3 --- /dev/null +++ b/tests/ffi/test-ffi.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e +../../src/microcode/scheme --library .:../../src/lib --batch-mode <