adjust tests for Racket CS

This commit is contained in:
Matthew Flatt 2019-05-01 13:47:43 -06:00
parent fb968db7a5
commit cbbf7a7c2b
4 changed files with 16 additions and 9 deletions

View File

@ -20,7 +20,7 @@ process.
(let ([p (open-output-bytes)])
(parameterize ([current-error-port p])
(system* f "-l" "tests/racket/prompt-sfs" "sub"))
(unless (regexp-match? #rx"<will-executor>: +1 +" (get-output-bytes p))
(unless (regexp-match? #rx"<will-executor>:? +1 +" (get-output-bytes p))
(error "wrong output")
(exit 1))))
(exit 0))

View File

@ -97,7 +97,11 @@
(module+ test
(require racket/vector syntax/location)
(parameterize ([current-command-line-arguments (vector-append #("-c") (current-command-line-arguments))])
(dynamic-require (quote-module-path ".." main) #f))
(cond
[(eq? 'racket (system-type 'vm))
(parameterize ([current-command-line-arguments (vector-append #("-c") (current-command-line-arguments))])
(dynamic-require (quote-module-path ".." main) #f))]
[else
(printf "This test only works when (system-type 'vm) is 'racket\n")])
(module config info
(define random? #t)))

View File

@ -24,7 +24,10 @@
(void
(let loop ([i 0])
(vector-set-performance-stats! results)
(if (zero? (vector-ref results 5))
(if (and (zero? (vector-ref results 5))
;; No "stack overflow" on Chez Scheme, so pick a depth
(or (eq? 'racket (system-type 'vm))
(i . < . 50000)))
(let ([v (loop (add1 i))])
(if (zero? v)
(begin

View File

@ -1094,9 +1094,9 @@
(define u1 (unit (import) (export x-sub y-sub) (define x 1) (define xx 2) (define y 3) (define yy 4)))
(define-values/invoke-unit u1 (import) (export x-sig))
(test 1 x)
(test-runtime-error exn? "xx: undefined;\n cannot reference an identifier before its definition" xx)
(test-runtime-error exn? "y: undefined;\n cannot reference an identifier before its definition" y)
(test-runtime-error exn? "yy: undefined;\n cannot reference an identifier before its definition" yy))
(test-runtime-error exn? "xx: undefined;\n cannot reference" xx)
(test-runtime-error exn? "y: undefined;\n cannot reference" y)
(test-runtime-error exn? "yy: undefined;\n cannot reference" yy))
(let ()
(define u1 (unit (import) (export x-sig) (define x 1)))
@ -2062,9 +2062,9 @@
(test 'zero (use-unit))
(test 'zero (use-unit2))
(test-runtime-error exn:fail:contract:variable? "u-a: undefined;\n cannot reference an identifier before its definition"
(test-runtime-error exn:fail:contract:variable? "u-a: undefined;\n cannot reference"
(use-unit-badly1 u-a))
(test-runtime-error exn:fail:contract:variable? "u-a: undefined;\n cannot reference an identifier before its definition"
(test-runtime-error exn:fail:contract:variable? "u-a: undefined;\n cannot reference"
(use-unit-badly2 sig^))
(test 12