Avoid writing to the current directory in this test.

This commit is contained in:
Sam Tobin-Hochstadt 2016-01-09 22:51:55 -05:00
parent 73a010841f
commit 12927d0e8b

View File

@ -4,17 +4,17 @@
racket/system
compiler/find-exe)
(define tmpdir (make-temporary-file "tmp~a" 'directory (current-directory)))
(define tmppath (build-path tmpdir "tmp.rkt"))
(with-output-to-file (build-path tmpdir "tmp.rkt") #:exists 'replace
(lambda ()
(printf "#lang racket\n")))
(define exec-path (find-exe))
(define relpath (find-relative-path (current-directory) tmppath))
(parameterize ((current-directory (find-system-path 'temp-dir)))
(define tmpdir (make-temporary-file "tmp~a" 'directory (current-directory)))
(define tmppath (build-path tmpdir "tmp.rkt"))
(with-output-to-file (build-path tmpdir "tmp.rkt") #:exists 'replace
(lambda ()
(printf "#lang racket\n")))
(define exec-path (find-exe))
(define relpath (find-relative-path (current-directory) tmppath))
(define ok? (system* exec-path "-l" "raco" "make" "-j" "2" (path->string relpath)))
(delete-directory/files tmpdir)
(unless ok?
(error "`raco make` test failed"))
(define ok? (system* exec-path "-l" "raco" "make" "-j" "2" (path->string relpath)))
(delete-directory/files tmpdir)
(unless ok?
(error "`raco make` test failed")))