fix mac sdk support; change initial namespace to not have 'module'; set up mzc --c-mods (still need docs)
svn: r8997
original commit: b64d03d932
This commit is contained in:
parent
6e98f88320
commit
876d31975b
|
@ -86,6 +86,14 @@
|
||||||
expect mred?)
|
expect mred?)
|
||||||
(delete-directory/files dist-dir)]))
|
(delete-directory/files dist-dir)]))
|
||||||
|
|
||||||
|
(define (base-compile e)
|
||||||
|
(parameterize ([current-namespace (make-base-namespace)])
|
||||||
|
(compile e)))
|
||||||
|
(define (kernel-compile e)
|
||||||
|
(parameterize ([current-namespace (make-base-empty-namespace)])
|
||||||
|
(namespace-require ''#%kernel)
|
||||||
|
(compile e)))
|
||||||
|
|
||||||
(define (mz-tests mred?)
|
(define (mz-tests mred?)
|
||||||
(define dest (if mred? mr-dest mz-dest))
|
(define dest (if mred? mr-dest mz-dest))
|
||||||
(define (flags s)
|
(define (flags s)
|
||||||
|
@ -97,7 +105,7 @@
|
||||||
dest mred? #f
|
dest mred? #f
|
||||||
`((#t (lib ,filename "tests" "mzscheme")))
|
`((#t (lib ,filename "tests" "mzscheme")))
|
||||||
null
|
null
|
||||||
null
|
#f
|
||||||
`(,(flags "l") ,(string-append "tests/mzscheme/" filename)))
|
`(,(flags "l") ,(string-append "tests/mzscheme/" filename)))
|
||||||
(try-exe dest expect mred?)
|
(try-exe dest expect mred?)
|
||||||
|
|
||||||
|
@ -111,9 +119,10 @@
|
||||||
`((,pfx (lib ,filename "tests" "mzscheme"))
|
`((,pfx (lib ,filename "tests" "mzscheme"))
|
||||||
(#t (lib "scheme/init")))
|
(#t (lib "scheme/init")))
|
||||||
null
|
null
|
||||||
null
|
#f
|
||||||
`(,(flags "ne")
|
`(,(flags "lne")
|
||||||
,(format "(#%require '~a~a)"
|
"scheme/base"
|
||||||
|
,(format "(require '~a~a)"
|
||||||
(or pfx "")
|
(or pfx "")
|
||||||
(regexp-replace #rx"[.].*$" filename ""))))
|
(regexp-replace #rx"[.].*$" filename ""))))
|
||||||
(try-exe dest expect mred?))])
|
(try-exe dest expect mred?))])
|
||||||
|
@ -128,7 +137,8 @@
|
||||||
dest mred? #f
|
dest mred? #f
|
||||||
`((#t ,path))
|
`((#t ,path))
|
||||||
null
|
null
|
||||||
`(#%require (file ,(path->string path)))
|
(base-compile
|
||||||
|
`(namespace-require '(file ,(path->string path))))
|
||||||
`(,(flags ""))))
|
`(,(flags ""))))
|
||||||
(try-exe dest expect mred?)
|
(try-exe dest expect mred?)
|
||||||
|
|
||||||
|
@ -140,7 +150,8 @@
|
||||||
dest mred? #f
|
dest mred? #f
|
||||||
`((#t (file ,(path->string path))))
|
`((#t (file ,(path->string path))))
|
||||||
null
|
null
|
||||||
`(#%require (file ,(path->string path)))
|
(base-compile
|
||||||
|
`(namespace-require '(file ,(path->string path))))
|
||||||
`(,(flags ""))))
|
`(,(flags ""))))
|
||||||
(try-exe dest expect mred?)
|
(try-exe dest expect mred?)
|
||||||
|
|
||||||
|
@ -152,7 +163,8 @@
|
||||||
dest mred? #f
|
dest mred? #f
|
||||||
`((#f ,filename))
|
`((#f ,filename))
|
||||||
null
|
null
|
||||||
`(#%require ',(string->symbol (regexp-replace #rx"[.].*$" filename "")))
|
(base-compile
|
||||||
|
`(namespace-require '',(string->symbol (regexp-replace #rx"[.].*$" filename ""))))
|
||||||
`(,(flags ""))))
|
`(,(flags ""))))
|
||||||
(try-exe dest expect mred?)
|
(try-exe dest expect mred?)
|
||||||
|
|
||||||
|
@ -164,23 +176,33 @@
|
||||||
`((#t (lib ,filename "tests" "mzscheme"))
|
`((#t (lib ,filename "tests" "mzscheme"))
|
||||||
(#t (lib "embed-me3.ss" "tests" "mzscheme")))
|
(#t (lib "embed-me3.ss" "tests" "mzscheme")))
|
||||||
null
|
null
|
||||||
`(begin
|
(base-compile
|
||||||
(#%require (lib "embed-me3.ss" "tests" "mzscheme"))
|
`(begin
|
||||||
(#%require (lib ,filename "tests" "mzscheme")))
|
(namespace-require '(lib "embed-me3.ss" "tests" "mzscheme"))
|
||||||
|
(namespace-require '(lib ,filename "tests" "mzscheme"))))
|
||||||
`(,(flags "")))
|
`(,(flags "")))
|
||||||
(try-exe dest (string-append "3 is here, too? #t\n" expect) mred?)
|
(try-exe dest (string-append "3 is here, too? #t\n" expect) mred?)
|
||||||
|
|
||||||
;; Try a literal file
|
;; Try a literal file
|
||||||
(printf ">>>literal\n")
|
(printf ">>>literal\n")
|
||||||
(prepare dest filename)
|
(prepare dest filename)
|
||||||
(make-embedding-executable
|
(let ([tmp (make-temporary-file)])
|
||||||
dest mred? #f
|
(with-output-to-file tmp
|
||||||
`((#t (lib ,filename "tests" "mzscheme")))
|
#:exists 'truncate
|
||||||
(list (build-path (collection-path "tests" "mzscheme") "embed-me4.ss"))
|
(lambda ()
|
||||||
`(with-output-to-file "stdout"
|
(write (kernel-compile
|
||||||
(lambda () (display "... and more!\n"))
|
'(namespace-require ''#%kernel)))))
|
||||||
'append)
|
(make-embedding-executable
|
||||||
`(,(flags "l") ,(string-append "tests/mzscheme/" filename)))
|
dest mred? #f
|
||||||
|
`((#t (lib ,filename "tests" "mzscheme")))
|
||||||
|
(list
|
||||||
|
tmp
|
||||||
|
(build-path (collection-path "tests" "mzscheme") "embed-me4.ss"))
|
||||||
|
`(with-output-to-file "stdout"
|
||||||
|
(lambda () (display "... and more!\n"))
|
||||||
|
'append)
|
||||||
|
`(,(flags "l") ,(string-append "tests/mzscheme/" filename)))
|
||||||
|
(delete-file tmp))
|
||||||
(try-exe dest (string-append
|
(try-exe dest (string-append
|
||||||
"This is the literal expression 4.\n"
|
"This is the literal expression 4.\n"
|
||||||
"... and more!\n"
|
"... and more!\n"
|
||||||
|
@ -196,13 +218,14 @@
|
||||||
dest mred? #f
|
dest mred? #f
|
||||||
'((#t scheme/base))
|
'((#t scheme/base))
|
||||||
null
|
null
|
||||||
`(begin
|
(base-compile
|
||||||
(#%require scheme/base)
|
'(begin
|
||||||
(define (out s)
|
(require scheme/base)
|
||||||
(with-output-to-file "stdout"
|
(eval '(define (out s)
|
||||||
(lambda () (printf s))
|
(with-output-to-file "stdout"
|
||||||
#:exists 'append))
|
(lambda () (printf s))
|
||||||
(out "\uA9, \u7238, and \U1D670\n"))
|
#:exists 'append)))
|
||||||
|
(out "\uA9, \u7238, and \U1D670\n")))
|
||||||
`(,(flags "ne") "(out \"\u7237...\U1D671\n\")"))
|
`(,(flags "ne") "(out \"\u7237...\U1D671\n\")"))
|
||||||
(try-exe dest "\uA9, \u7238, and \U1D670\n\u7237...\U1D671\n" mred?))
|
(try-exe dest "\uA9, \u7238, and \U1D670\n\u7237...\U1D671\n" mred?))
|
||||||
|
|
||||||
|
@ -215,7 +238,7 @@
|
||||||
mr-dest #t #f
|
mr-dest #t #f
|
||||||
`((#t (lib "embed-me5.ss" "tests" "mzscheme")))
|
`((#t (lib "embed-me5.ss" "tests" "mzscheme")))
|
||||||
null
|
null
|
||||||
null
|
#f
|
||||||
`("-l" "tests/mzscheme/embed-me5.ss"))
|
`("-l" "tests/mzscheme/embed-me5.ss"))
|
||||||
(try-exe mr-dest "This is 5: #<class:button%>\n" #t))
|
(try-exe mr-dest "This is 5: #<class:button%>\n" #t))
|
||||||
|
|
||||||
|
@ -278,10 +301,8 @@
|
||||||
|
|
||||||
(void)))
|
(void)))
|
||||||
|
|
||||||
#| REMOVEME
|
|
||||||
(mzc-tests #f)
|
(mzc-tests #f)
|
||||||
(mzc-tests #t)
|
(mzc-tests #t)
|
||||||
|#
|
|
||||||
|
|
||||||
(require dynext/file)
|
(require dynext/file)
|
||||||
(define (extension-test mred?)
|
(define (extension-test mred?)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user