add a test for use by distribution builds
This commit is contained in:
parent
f2a202eb30
commit
ab505859b6
28
gui-lib/racket/gui/private/distro-test.rkt
Normal file
28
gui-lib/racket/gui/private/distro-test.rkt
Normal file
|
@ -0,0 +1,28 @@
|
|||
#lang racket/base
|
||||
(require setup/dirs
|
||||
racket/system)
|
||||
|
||||
;; Sanity checks to run in an installer-building context to make sure
|
||||
;; that things bascially work. This test is in the "-lib" package,
|
||||
;; instead of the "-test" package, so that it's lightweight to run
|
||||
;; (without installing lots of other packages)
|
||||
|
||||
(define bin-dir (find-gui-bin-dir))
|
||||
(define console-bin-dir (find-console-bin-dir))
|
||||
|
||||
(define (try-exe p)
|
||||
(printf "Trying ~a\n" p)
|
||||
(let ([o (open-output-bytes)])
|
||||
(parameterize ([current-output-port o])
|
||||
(system* p "-e" "'hello"))
|
||||
;; For historical reasons, `gracket` still uses `scheme` printing
|
||||
(unless (equal? #"hello\n" (get-output-bytes o))
|
||||
(error "sanity check failed" p))))
|
||||
|
||||
(try-exe (build-path console-bin-dir (if (eq? (system-type) 'windows)
|
||||
"gracket-text.exe"
|
||||
"gracket-text")))
|
||||
(unless (eq? (system-type) 'unix) ; may not have a GUI connection on Unix
|
||||
(case (system-type)
|
||||
[(windows) (try-exe (build-path bin-dir "GRacket.exe"))]
|
||||
[(macosx) (try-exe (build-path console-bin-dir "gracket"))]))
|
Loading…
Reference in New Issue
Block a user