From 4b7e4e4322590896fc97898d159d1de623b3950e Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sat, 31 Jan 2009 19:46:33 +0000 Subject: [PATCH] misc improvements, add test for (exit) svn: r13339 --- collects/tests/mzscheme/sandbox.ss | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/collects/tests/mzscheme/sandbox.ss b/collects/tests/mzscheme/sandbox.ss index 480de7fa78..8ef43c1fc0 100644 --- a/collects/tests/mzscheme/sandbox.ss +++ b/collects/tests/mzscheme/sandbox.ss @@ -435,30 +435,33 @@ ;; can go arbitrarily high here (for ([i (in-range 20)]) (t))) - ;; test that killing the custodian works fine - ;; first try it without limits (limits imply a nested thread/custodian) + ;; test that killing the thread, shutting the custodian, or calling `exit' + ;; works fine first try it without limits (limits imply a nested + ;; thread/custodian) --top-- - (set! ev (parameterize ([sandbox-eval-limits #f]) - (make-evaluator 'scheme/base))) + (set! ev (make-evaluator 'scheme/base)) --eval-- (kill-thread (current-thread)) =err> "terminated .thread-killed.$" --top-- - (set! ev (parameterize ([sandbox-eval-limits #f]) - (make-evaluator 'scheme/base))) + (set! ev (make-evaluator 'scheme/base)) --eval-- (custodian-shutdown-all (current-custodian)) - =err> "terminated .custodian-shutdown.$" + =err> "terminated .custodian-shutdown.$" + --top-- + (set! ev (make-evaluator 'scheme/base)) + --eval-- + (exit) =err> "terminated .exited.$" --top-- ;; also happens when it's done directly - (set! ev (parameterize ([sandbox-eval-limits #f]) - (make-evaluator 'scheme/base))) + (set! ev (make-evaluator 'scheme/base)) (call-in-sandbox-context ev (lambda () (kill-thread (current-thread)))) - =err> "terminated .thread-killed.$" - (set! ev (parameterize ([sandbox-eval-limits #f]) - (make-evaluator 'scheme/base))) + =err> "terminated .thread-killed.$" + (set! ev (make-evaluator 'scheme/base)) (call-in-sandbox-context ev (lambda () (custodian-shutdown-all (current-custodian)))) - =err> "terminated .custodian-shutdown.$" + =err> "terminated .custodian-shutdown.$" + (set! ev (make-evaluator 'scheme/base)) + (call-in-sandbox-context ev exit) =err> "terminated .exited.$" --top-- ;; now make sure it works with per-expression limits too (set! ev (make-evaluator 'scheme/base))