Files
racket-makefile/tests/raco.rkt
T
2026-08-09 14:56:42 +02:00

26 lines
851 B
Racket

#lang racket
(require rackunit
(only-in racket-makefile raco))
;; DrDr (used by the package build service) counts any output on stderr as a
;; test failure. `raco help` legitimately writes its usage text to stderr, so
;; keep the child process output local to this test.
(define (check-raco-help)
(define out (open-output-string))
(define err (open-output-string))
(parameterize ([current-output-port out]
[current-error-port err])
(check-not-exn
(lambda ()
(raco '(help))))))
(check-raco-help)
;; It must not require raco to be on PATH. The current Racket installation
;; should locate its own raco first.
(define env (environment-variables-copy (current-environment-variables)))
(environment-variables-set! env #"PATH" #f)
(parameterize ([current-environment-variables env])
(check-raco-help))