From 12927d0e8bbbac5912d88fe06a96a827396d95b8 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Sat, 9 Jan 2016 22:51:55 -0500 Subject: [PATCH] Avoid writing to the current directory in this test. --- compiler-test/tests/compiler/make.rkt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/compiler-test/tests/compiler/make.rkt b/compiler-test/tests/compiler/make.rkt index e537e03b4a..d17d16cbb8 100644 --- a/compiler-test/tests/compiler/make.rkt +++ b/compiler-test/tests/compiler/make.rkt @@ -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")))