Out-of-tree building and testing now seems to work
This commit is contained in:
parent
3aad0fbe0b
commit
5c941ea62c
|
@ -29,7 +29,7 @@ EXTRA_DIST=ikarus.boot.4.prebuilt ikarus.boot.8.prebuilt \
|
|||
ikarus.string-to-number.ss ikarus.compiler.source-optimizer.ss \
|
||||
ikarus.compiler.tag-annotation-analysis.ss ikarus.ontology.ss \
|
||||
ikarus.reader.annotated.ss ikarus.pointers.ss ikarus.equal.ss \
|
||||
ikarus.symbol-table.ss ikarus.apropos.ss
|
||||
ikarus.symbol-table.ss ikarus.apropos.ss ikarus.include-src.ss
|
||||
|
||||
all: $(nodist_pkglib_DATA)
|
||||
|
||||
|
@ -41,7 +41,7 @@ sizeofvoidp = $(shell grep SIZEOF_VOID_P ../config.h | sed "s/.*\(.\)/\1/g")
|
|||
|
||||
ikarus.config.ss: Makefile last-revision ../config.h
|
||||
echo '(define ikarus-version "$(PACKAGE_VERSION)")' >$@
|
||||
echo '(define ikarus-revision "$(shell cat last-revision)")' >>$@
|
||||
echo '(define ikarus-revision "$(shell cat $(srcdir)/last-revision)")' >>$@
|
||||
echo '(define ikarus-lib-dir "$(pkglibdir)")' >>$@
|
||||
echo '(define target "$(target)")' >>$@
|
||||
echo '(define wordsize $(sizeofvoidp))' >>$@
|
||||
|
@ -51,7 +51,13 @@ CLEANFILES=$(nodist_pkglib_DATA) ikarus.config.ss
|
|||
MAINTAINERCLEANFILES=last-revision
|
||||
|
||||
ikarus.boot: $(EXTRA_DIST) ikarus.config.ss
|
||||
../src/ikarus -b ./ikarus.boot.$(sizeofvoidp).prebuilt --r6rs-script makefile.ss
|
||||
IKARUS_SRC_DIR=$(srcdir) \
|
||||
IKARUS_BUILD_DIR=$(builddir) \
|
||||
IKARUS_LIBRARY_PATH=$(srcdir) \
|
||||
../src/ikarus -b $(srcdir)/ikarus.boot.$(sizeofvoidp).prebuilt \
|
||||
--r6rs-script $(srcdir)/makefile.ss
|
||||
|
||||
check: ikarus.boot
|
||||
../src/ikarus -b ikarus.boot --r6rs-script run-tests.ss
|
||||
IKARUS_SRC_DIR=$(srcdir) \
|
||||
IKARUS_LIBRARY_PATH=$(srcdir) \
|
||||
../src/ikarus -b ikarus.boot --r6rs-script $(srcdir)/run-tests.ss
|
||||
|
|
|
@ -184,7 +184,7 @@ EXTRA_DIST = ikarus.boot.4.prebuilt ikarus.boot.8.prebuilt \
|
|||
ikarus.string-to-number.ss ikarus.compiler.source-optimizer.ss \
|
||||
ikarus.compiler.tag-annotation-analysis.ss ikarus.ontology.ss \
|
||||
ikarus.reader.annotated.ss ikarus.pointers.ss ikarus.equal.ss \
|
||||
ikarus.symbol-table.ss ikarus.apropos.ss
|
||||
ikarus.symbol-table.ss ikarus.apropos.ss ikarus.include-src.ss
|
||||
|
||||
revno = "$(shell sed 's/ .*//' ../.bzr/branch/last-revision 2>/dev/null)"
|
||||
sizeofvoidp = $(shell grep SIZEOF_VOID_P ../config.h | sed "s/.*\(.\)/\1/g")
|
||||
|
@ -380,16 +380,22 @@ last-revision: $(shell ls ../.bzr/branch/last-revision 2>/dev/null)
|
|||
|
||||
ikarus.config.ss: Makefile last-revision ../config.h
|
||||
echo '(define ikarus-version "$(PACKAGE_VERSION)")' >$@
|
||||
echo '(define ikarus-revision "$(shell cat last-revision)")' >>$@
|
||||
echo '(define ikarus-revision "$(shell cat $(srcdir)/last-revision)")' >>$@
|
||||
echo '(define ikarus-lib-dir "$(pkglibdir)")' >>$@
|
||||
echo '(define target "$(target)")' >>$@
|
||||
echo '(define wordsize $(sizeofvoidp))' >>$@
|
||||
|
||||
ikarus.boot: $(EXTRA_DIST) ikarus.config.ss
|
||||
../src/ikarus -b ./ikarus.boot.$(sizeofvoidp).prebuilt --r6rs-script makefile.ss
|
||||
IKARUS_SRC_DIR=$(srcdir) \
|
||||
IKARUS_BUILD_DIR=$(builddir) \
|
||||
IKARUS_LIBRARY_PATH=$(srcdir) \
|
||||
../src/ikarus -b $(srcdir)/ikarus.boot.$(sizeofvoidp).prebuilt \
|
||||
--r6rs-script $(srcdir)/makefile.ss
|
||||
|
||||
check: ikarus.boot
|
||||
../src/ikarus -b ikarus.boot --r6rs-script run-tests.ss
|
||||
IKARUS_SRC_DIR=$(srcdir) \
|
||||
IKARUS_LIBRARY_PATH=$(srcdir) \
|
||||
../src/ikarus -b ikarus.boot --r6rs-script $(srcdir)/run-tests.ss
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
|
@ -319,7 +319,7 @@
|
|||
(make-codes (map Clambda code*) (Main body))]))
|
||||
(Program x))
|
||||
|
||||
(include "pass-specify-rep.ss")
|
||||
(include-src "pass-specify-rep.ss")
|
||||
|
||||
(define parameter-registers '(%edi))
|
||||
(define return-value-register '%eax)
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
(ikarus system $pairs)
|
||||
(only (ikarus system $codes) $code->closure)
|
||||
(only (ikarus system $structs) $struct-ref $struct/rtd?)
|
||||
(ikarus.include-src)
|
||||
(except (ikarus)
|
||||
optimize-level debug-optimizer
|
||||
fasl-write scc-letrec optimize-cp
|
||||
|
@ -39,6 +40,7 @@
|
|||
(ikarus.intel-assembler))
|
||||
|
||||
|
||||
|
||||
(define-syntax struct-case
|
||||
(lambda (x)
|
||||
(define (enumerate fld* i)
|
||||
|
@ -1052,7 +1054,7 @@
|
|||
;(pretty-print (unparse x))
|
||||
x))
|
||||
|
||||
(include "ikarus.compiler.source-optimizer.ss")
|
||||
(include-src "ikarus.compiler.source-optimizer.ss")
|
||||
|
||||
(define (rewrite-assignments x)
|
||||
(define who 'rewrite-assignments)
|
||||
|
@ -1140,7 +1142,7 @@
|
|||
[else (error who "invalid expression" (unparse x))]))
|
||||
(Expr x))
|
||||
|
||||
(include "ikarus.compiler.tag-annotation-analysis.ss")
|
||||
(include-src "ikarus.compiler.tag-annotation-analysis.ss")
|
||||
|
||||
(define (introduce-vars x)
|
||||
(define who 'introduce-vars)
|
||||
|
@ -2408,7 +2410,7 @@
|
|||
(define eval-core
|
||||
(lambda (x) ((compile-core-expr x))))
|
||||
|
||||
(include "ikarus.compiler.altcogen.ss")
|
||||
(include-src "ikarus.compiler.altcogen.ss")
|
||||
|
||||
(define current-primitive-locations
|
||||
(let ([plocs (lambda (x) #f)])
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
|
||||
;;; THIS IS WIP
|
||||
(include "ikarus.ontology.ss")
|
||||
(include-src "ikarus.ontology.ss")
|
||||
|
||||
(define tag-analysis-output (make-parameter #f))
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
;;; Ikarus Scheme -- A compiler for R6RS Scheme.
|
||||
;;; Copyright (C) 2009 Abdulaziz Ghuloum
|
||||
;;;
|
||||
;;; This program is free software: you can redistribute it and/or modify
|
||||
;;; it under the terms of the GNU General Public License version 3 as
|
||||
;;; published by the Free Software Foundation.
|
||||
;;;
|
||||
;;; This program is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
;;; General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(library (ikarus.include-src)
|
||||
(export include-src)
|
||||
(import (ikarus))
|
||||
(define-syntax include-src
|
||||
(lambda (x)
|
||||
(syntax-case x ()
|
||||
[(ctxt filename)
|
||||
(with-syntax ([filename
|
||||
(string-append
|
||||
(or (getenv "IKARUS_SRC_DIR") ".")
|
||||
"/"
|
||||
(syntax->datum #'filename))])
|
||||
#'(include-into ctxt filename))]))))
|
|
@ -31,6 +31,7 @@
|
|||
string-ci=? string-ci>? string-ci>=? string-normalize-nfd
|
||||
string-normalize-nfkd string-normalize-nfc string-normalize-nfkc )
|
||||
(import
|
||||
(ikarus.include-src)
|
||||
(except (ikarus)
|
||||
unicode-printable-char?
|
||||
char-upcase char-downcase char-titlecase char-foldcase
|
||||
|
@ -99,8 +100,8 @@
|
|||
(define (char- x y)
|
||||
(fx- (char->integer x) (char->integer y)))
|
||||
|
||||
(include "unicode/unicode-char-cases.ss")
|
||||
(include "unicode/unicode-charinfo.ss")
|
||||
(include-src "unicode/unicode-char-cases.ss")
|
||||
(include-src "unicode/unicode-charinfo.ss")
|
||||
|
||||
(define-syntax define-char-op
|
||||
(syntax-rules ()
|
||||
|
|
|
@ -1727,6 +1727,8 @@
|
|||
`([$init-symbol-value! . ,label])
|
||||
`([,label . (global . ,loc)])))
|
||||
|
||||
(define src-dir (or (getenv "IKARUS_SRC_DIR") "."))
|
||||
|
||||
(define (expand-all files)
|
||||
;;; remove all re-exported identifiers (those with labels in
|
||||
;;; subst but not binding in env).
|
||||
|
@ -1740,7 +1742,7 @@
|
|||
(for-each
|
||||
(lambda (file)
|
||||
(debugf " ~s" file)
|
||||
(load file
|
||||
(load (string-append src-dir "/" file)
|
||||
(lambda (x)
|
||||
(let-values ([(name code export-subst export-env)
|
||||
(boot-library-expand x)])
|
||||
|
|
|
@ -550,4 +550,4 @@
|
|||
(let ([x (Program x)])
|
||||
x))
|
||||
|
||||
(include "pass-specify-rep-primops.ss"))
|
||||
(include-src "pass-specify-rep-primops.ss"))
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
|
||||
(library (tests framework)
|
||||
(export define-tests)
|
||||
(export define-tests src-file)
|
||||
(import (ikarus))
|
||||
|
||||
(define (src-file x)
|
||||
(string-append (or (getenv "IKARUS_SRC_DIR") ".") "/" x))
|
||||
(define-syntax define-tests
|
||||
(syntax-rules ()
|
||||
[(_ test-all [p0 e0] ...)
|
||||
|
|
|
@ -541,16 +541,16 @@
|
|||
(f (fx+ i 1)))))
|
||||
|
||||
(define (test-input-files)
|
||||
(assert (= (file-size-char-by-char "tests/SRFI-1.ss") 56573))
|
||||
(assert (= (file-size "tests/SRFI-1.ss") 56573))
|
||||
(let ([bv (file->bytevector "tests/SRFI-1.ss")])
|
||||
(assert (= (file-size-char-by-char (src-file "tests/SRFI-1.ss")) 56573))
|
||||
(assert (= (file-size (src-file "tests/SRFI-1.ss")) 56573))
|
||||
(let ([bv (file->bytevector (src-file "tests/SRFI-1.ss"))])
|
||||
(let-values ([(p extract) (open-bytevector-output-port #f)])
|
||||
(bytevector->binary-port bv p)
|
||||
(let ([bv2 (extract)])
|
||||
(assert (bytevector=? bv bv2))
|
||||
(assert (bytevector=? #vu8() (extract))))))
|
||||
|
||||
(let ([bv (file->bytevector "tests/SRFI-1.ss")])
|
||||
(let ([bv (file->bytevector (src-file "tests/SRFI-1.ss"))])
|
||||
(let-values ([(p extract) (open-bytevector-output-port
|
||||
(native-transcoder))])
|
||||
(bytevector->textual-port bv p)
|
||||
|
@ -558,7 +558,7 @@
|
|||
(assert (bytevector=? bv bv2))
|
||||
(assert (bytevector=? #vu8() (extract))))))
|
||||
|
||||
(let ([bv (file->bytevector "tests/SRFI-1.ss")])
|
||||
(let ([bv (file->bytevector (src-file "tests/SRFI-1.ss"))])
|
||||
(let-values ([(p extract) (open-bytevector-output-port
|
||||
(make-transcoder (latin-1-codec)))])
|
||||
(bytevector->textual-port bv p)
|
||||
|
@ -566,7 +566,7 @@
|
|||
(assert (bytevector=? bv bv2))
|
||||
(assert (bytevector=? #vu8() (extract))))))
|
||||
|
||||
(let ([bv (file->bytevector "tests/SRFI-1.ss")])
|
||||
(let ([bv (file->bytevector (src-file "tests/SRFI-1.ss"))])
|
||||
(let-values ([(p extract) (open-string-output-port)])
|
||||
(bytevector->textual-port bv p)
|
||||
(let ([str (extract)])
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
(library (tests normalization)
|
||||
(export run-tests)
|
||||
(import (ikarus) (unicode-data))
|
||||
(import (ikarus) (tests framework) (unicode-data))
|
||||
|
||||
(define (reset) (error 'reset "yukk"))
|
||||
(define (enumerate ls)
|
||||
|
@ -33,7 +33,7 @@
|
|||
(let ([data (map (lambda (x) (map conv (list-head x 5)))
|
||||
(filter (lambda (x) (>= (length x) 5))
|
||||
(get-unicode-data
|
||||
"unicode/UNIDATA/NormalizationTest.txt")))])
|
||||
(src-file "unicode/UNIDATA/NormalizationTest.txt"))))])
|
||||
(define NFD string-normalize-nfd)
|
||||
(define NFKD string-normalize-nfkd)
|
||||
(define NFC string-normalize-nfc)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
(library (tests parse-flonums)
|
||||
(export run-tests)
|
||||
(import (ikarus))
|
||||
(import (ikarus) (tests framework))
|
||||
|
||||
(define file "tests/rn100")
|
||||
(define file (src-file "tests/rn100"))
|
||||
|
||||
(define (read-all)
|
||||
(with-input-from-file file
|
||||
|
|
Loading…
Reference in New Issue