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)/")' \
--- /dev/null
+#!/bin/sh
+#
+# Test the BLOWFISH option.
+
+set -e
+${MIT_SCHEME_EXE} --prepend-library . <<EOF
+(load-option 'BLOWFISH)
+(load "blowfish-check" (->environment '(blowfish)))
+EOF
+++ /dev/null
-#!/bin/sh
-echo '(load "check.scm")' | ${MIT_SCHEME_EXE}
+++ /dev/null
-#| -*-Scheme-*- |#
-
-;;;; Test the BLOWFISH option.
-
-(load "make")
-(with-system-library-directories
- '("./")
- (lambda ()
- (load "blowfish-check" (->environment '(blowfish)))))
\ No newline at end of file
(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
--- /dev/null
+#| -*-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
./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)/")' \
+++ /dev/null
-#!/bin/sh
-echo '(load "check.scm")' | ${MIT_SCHEME_EXE}
+++ /dev/null
-#| -*-Scheme-*- |#
-
-;;;; Test the GDBM option.
-
-(load "make")
-(with-system-library-directories
- '("./")
- (lambda ()
- (load "gdbm-check" (->environment '(gdbm)))))
\ No newline at end of file
(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
--- /dev/null
+#!/bin/sh
+#
+# Test the GDBM option.
+
+set -e
+${MIT_SCHEME_EXE} --prepend-library . <<EOF
+(load-option 'GDBM)
+(load "gdbm-check" (->environment '(gdbm)))
+EOF
--- /dev/null
+#| -*-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
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)/")' \
+++ /dev/null
-#!/bin/sh
-echo '(load "check.scm")' | ${MIT_SCHEME_EXE}
+++ /dev/null
-#| -*-Scheme-*- |#
-
-;;;; Test the MCRYPT option.
-
-(load "make")
-(with-system-library-directories
- '("./")
- (lambda ()
- (load "mcrypt-check" (->environment '(mcrypt)))))
\ No newline at end of file
(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
--- /dev/null
+#!/bin/sh
+#
+# Test the MCRYPT option.
+
+set -e
+${MIT_SCHEME_EXE} --prepend-library . <<EOF
+(load-option 'MCRYPT)
+(load "mcrypt-check" (->environment '(mcrypt)))
+EOF
--- /dev/null
+#| -*-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
./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)/")' \
+++ /dev/null
-#!/bin/sh
-echo '(load "check.scm")' | ${MIT_SCHEME_EXE}
+++ /dev/null
-#| -*-Scheme-*- |#
-
-;;;; Test the MD5 option.
-
-(load "make")
-(with-system-library-directories
- '("./")
- (lambda ()
- (load "md5-check" (->environment '(md5)))))
\ No newline at end of file
(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
--- /dev/null
+#!/bin/sh
+#
+# Test the MD5 option.
+
+set -e
+${MIT_SCHEME_EXE} --prepend-library . <<EOF
+(load-option 'MD5)
+(load "md5-check" (->environment '(md5)))
+EOF
--- /dev/null
+#| -*-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
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)/")' \
+++ /dev/null
-#!/bin/sh
-echo '(load "check.scm")' | ${MIT_SCHEME_EXE}
+++ /dev/null
-#| -*-Scheme-*- |#
-
-;;;; Test the MHASH option.
-
-(load "make")
-(with-system-library-directories
- '("./")
- (lambda ()
- (load "mhash-check" (->environment '(mhash)))))
\ No newline at end of file
(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
--- /dev/null
+#!/bin/sh
+#
+# Test the MHASH option.
+
+set -e
+${MIT_SCHEME_EXE} --prepend-library . <<EOF
+(load-option 'MHASH)
+(load "mhash-check" (->environment '(mhash)))
+EOF
--- /dev/null
+#| -*-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
CLEANFILES = ffi-test-const* ffi-test-shim.c
CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd
-
-TESTS = test-ffi
--- /dev/null
+#| -*-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
+++ /dev/null
-#!/bin/sh
-echo '(load "test-ffi.scm")' \
-| ../../src/microcode/scheme --library ../../src/lib --batch-mode
(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)))
(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
--- /dev/null
+#!/bin/sh
+
+set -e
+../../src/microcode/scheme --library .:../../src/lib --batch-mode <<EOF
+(begin
+ (parameterize ((param:suppress-loading-message? #t))
+ (load-option 'FFI))
+ (compile-file "test-ffi-wrapper")
+ (load "test-ffi-wrapper")
+ (test-ffi))
+EOF