From 4400b70b8744b9895750ac9655edfe4425b8652c Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 29 Jun 2019 08:33:17 -0600 Subject: [PATCH] sandbox test: repair for bytecode directory other than "compiled" --- pkgs/racket-test-core/tests/racket/sandbox.rktl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/racket-test-core/tests/racket/sandbox.rktl b/pkgs/racket-test-core/tests/racket/sandbox.rktl index ca8728f613..6d6b9236bc 100644 --- a/pkgs/racket-test-core/tests/racket/sandbox.rktl +++ b/pkgs/racket-test-core/tests/racket/sandbox.rktl @@ -332,12 +332,15 @@ (let* ([tmp (make-temporary-file "sandboxtest~a" 'directory)] [strpath (lambda xs (path->string (apply build-path xs)))] [racketlib (strpath (path-only (collection-file-path "main.rkt" "racket")))] + [compiled (if (null? (use-compiled-file-paths)) + "compiled" + (car (use-compiled-file-paths)))] [list-lib (strpath racketlib "list.rkt")] - [list-zo (strpath racketlib "compiled" "list_rkt.zo")] + [list-zo (strpath racketlib compiled "list_rkt.zo")] [test-lib (strpath tmp "sandbox-test.rkt")] - [test-zo (strpath tmp "compiled" "sandbox-test_rkt.zo")] + [test-zo (strpath tmp compiled "sandbox-test_rkt.zo")] [test2-lib (strpath tmp "sandbox-test2.rkt")] - [test2-zo (strpath tmp "compiled" "sandbox-test2_rkt.zo")] + [test2-zo (strpath tmp compiled "sandbox-test2_rkt.zo")] [test3-file "sandbox-test3.rkt"] [test3-lib (strpath tmp test3-file)] [make-module-evaluator/rel (lambda (mod @@ -442,7 +445,7 @@ ;; (directory-list tmp) =err> "file access denied" --top-- ;; explicitly allow access to tmp, and write access to a single file - (make-directory (build-path tmp "compiled")) + (make-directory* (build-path tmp compiled)) (parameterize ([sandbox-path-permissions `((read ,tmp) (write ,test-zo) ,@(sandbox-path-permissions))])