From 0d66aeb2185caf2c01eddef26173209f36ab958c Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 13 Aug 2014 09:17:16 +0100 Subject: [PATCH] racket/gui: minor test clean-up original commit: ad870a1d0f4c50306297183daa91e94320a9accb --- pkgs/gui-pkgs/gui-test/tests/gracket/README | 72 +------------------ .../gui-pkgs/gui-test/tests/gracket/blits.rkt | 20 +++--- pkgs/gui-pkgs/gui-test/tests/gracket/mem.rkt | 7 +- 3 files changed, 17 insertions(+), 82 deletions(-) diff --git a/pkgs/gui-pkgs/gui-test/tests/gracket/README b/pkgs/gui-pkgs/gui-test/tests/gracket/README index 3f0f5878..a9259ec4 100644 --- a/pkgs/gui-pkgs/gui-test/tests/gracket/README +++ b/pkgs/gui-pkgs/gui-test/tests/gracket/README @@ -10,9 +10,9 @@ The "draw.rkt" test (use load/cd) tests drawing commands. Click the --------------------------------------------------------------------------- -The "mem.rktl" test is loaded at startup: - gracket -r mem.rktl -Creates a lot of frames and instance of other objects, reporting +The "mem.rkt" test + gracket mem.rkt +creates a lot of frames and instance of other objects, reporting memory information along the way. At the end, before the last memory dump, objects that are still allocated are displayed like this: (frame (1 . 5)) @@ -20,69 +20,3 @@ This means that the frame allocated by thread #1 at cycle 5 (counting down from some number) hasn't been garbage-collected. If there's a few of these lines (around 10), that's ok. A large number of lines (say, 50) indicates a GC problem. - ---------------------------------------------------------------------------- - -[Out of date:] -The "random.rktl" test is a randomized test of the GRacket classes that tests -GRacket's stability. Load "random.rktl", and then run - (init) -This attempts to create instances of classes using random -intialization arguments. (init) can be run any number of times. -(2 is a good number) Then run - (call-all-random) -This calls every method of every class (skipping some "dangerous" ones -that modify the file system) with a random instance and with random -arguments. - -To avoid testing much of the wxMedia toolbox, which is likely to be -platform-independent, (define skip-media? #t) before loading -"random.rktl". - - -================================================== -Old Stuff -================================================== - ---------------------------------------------------------------------------- - -The "imred.rktl" test is used to check for memory leaks in a loop -invoking the gracket system. Call the `go' procedure with a list -of symbol flags: - 'force not included: - Use the current eventspaces; expects mred:run-exit-callbacks - to terminate everything properly - 'force included: - Use a new eventspace; don't run mred:run-exit-callbacks and - call wx:kill-eventspace instead. - 'console included: - Open a GRacket console - 'thread included: - Spawn a sleeping-and-looping thread during each invocation. - Also tests semaphore-callback (because it has to) - 'eventspace included: - Create a new sub-eventspace during each invocation with - a wx:frame% shown - ---------------------------------------------------------------------------- - -"startup" tests the startup flags of gracket. -run "run.rktl" from that directory. - ---------------------------------------------------------------------------- - -"frame-edit.rktl" checks that various frames match with various -edits. Under construction. - ---------------------------------------------------------------------------- - -"gui.rktl" tests: - - save prompting (before closing unsaved files) and - - autosaving - -evaluate `(load "gui.rktl")' in the console to run. - -It also overwrites the file "tmp.rktd" in the testing directory. - ---------------------------------------------------------------------------- - diff --git a/pkgs/gui-pkgs/gui-test/tests/gracket/blits.rkt b/pkgs/gui-pkgs/gui-test/tests/gracket/blits.rkt index 570840af..02b43533 100644 --- a/pkgs/gui-pkgs/gui-test/tests/gracket/blits.rkt +++ b/pkgs/gui-pkgs/gui-test/tests/gracket/blits.rkt @@ -58,16 +58,16 @@ (define targets (list - (build-path (collection-path "frtime") "tool" "clock.png") - (self-mask (build-path (collection-path "frtime") "tool" "clock.png")) - (build-path (collection-path "icons") "foot-up.png") - (build-path (collection-path "icons") "mred.xbm") - (self-mask (build-path (collection-path "icons") "mred.xbm")) - (plus-mask (build-path (collection-path "icons") "mred.xbm") - (build-path (collection-path "icons") "PLT-206.png")) - (plus-mask (build-path (collection-path "frtime") "tool" "clock.png") - (build-path (collection-path "icons") "mred.xbm")) - (build-path (collection-path "icons") "htdp-icon.gif") + (collection-file-path "clock.png" "frtime" "tool") + (self-mask (collection-file-path "clock.png" "frtime" "tool")) + (collection-file-path "foot-up.png" "icons") + (collection-file-path "mred.xbm" "icons") + (self-mask (collection-file-path "mred.xbm" "icons")) + (plus-mask (collection-file-path "mred.xbm" "icons") + (collection-file-path "PLT-206.png" "icons")) + (plus-mask (collection-file-path "clock.png" "frtime" "tool") + (collection-file-path "mred.xbm" "icons")) + (collection-file-path "htdp-icon.gif" "icons") )) (for-each diff --git a/pkgs/gui-pkgs/gui-test/tests/gracket/mem.rkt b/pkgs/gui-pkgs/gui-test/tests/gracket/mem.rkt index ba7d3407..73538189 100644 --- a/pkgs/gui-pkgs/gui-test/tests/gracket/mem.rkt +++ b/pkgs/gui-pkgs/gui-test/tests/gracket/mem.rkt @@ -2,7 +2,7 @@ (define source-dir (current-load-relative-directory)) -(define num-times 80) +(define num-times 10) (define num-threads 3) (define dump-stats? #f) @@ -53,12 +53,13 @@ [else (get-panel% n)])) (define (get-image n) - (build-path (collection-path "icons") + (collection-file-path (case (modulo n 4) [(0) "mini-plt.xpm"] [(1) "lock.gif"] [(2) "help.bmp"] - [(3) "return.xbm"]))) + [(3) "return.xbm"]) + "icons")) (define (maker id n) (sleep)