[racket-dev] [plt] Push #26996: master branch updated
Should I do the same kind of thing with "math/tests" and "plot/tests"?
In general, should everything have a separate tests package?
On 06/19/2013 07:53 PM, robby at racket-lang.org wrote:
> robby has updated `master' from f7a344dc32 to 9df3aa6a94.
> http://git.racket-lang.org/plt/f7a344dc32..9df3aa6a94
>
> =====[ 2 Commits ]======================================================
> Directory summary:
> 49.7% pkgs/gui-pkgs/gui-lib/framework/tests/
> 49.7% pkgs/gui-pkgs/gui-test/framework/tests/
>
> ~~~~~~~~~~
>
> 28e23fa Robby Findler <robby at racket-lang.org> 2013-06-19 20:02
> :
> | move framework tests to their own package (but still inside the framework collection)
> :
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/README (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/canvas.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/debug.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/exit.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/frame.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/framework-test (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/framework-test-engine (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/framework-test-engine.icns (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/framework-test-engine.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/group-test.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/handler-test.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/keys.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/load.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/main.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/mem.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/number-snip.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/panel.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/panel-single.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/pasteboard.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/prefs.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/racket.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/search.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/test-docs-complete.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/test-suite-utils.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/text.rkt (100%)
> R pkgs/gui-pkgs/{gui-lib => gui-test}/framework/tests/utils.rktl (100%)
>
> ~~~~~~~~~~
>
> 9df3aa6 Robby Findler <robby at racket-lang.org> 2013-06-19 20:53
> :
> | adjust games to use find-relevant-directories instead of
> | working directly with collections
> |
> | also some Rackety
> :
> M pkgs/games/main.rkt | 44 ++++++++++++++++++--------------------------
>
> =====[ Overall Diff ]===================================================
>
> pkgs/games/main.rkt
> ~~~~~~~~~~~~~~~~~~~
> --- OLD/pkgs/games/main.rkt
> +++ NEW/pkgs/games/main.rkt
> @@ -4,24 +4,19 @@
>
> (define-struct game (file name set icon))
>
> -(define gamedirs
> - (filter directory-exists?
> - (map (λ (x) (build-path x "games"))
> - (current-library-collection-paths))))
> -
> -(define (get-game gamedir game)
> - (let* ([game (path-element->string game)]
> - [info (with-handlers ([exn:fail? (lambda (x) #f)])
> - (get-info (list "games" game)))]
> - [main (and info (info 'game (lambda () #f)))]
> - [gamefile (lambda (f) (build-path gamedir game f))])
> - (and main
> - (make-game
> - (gamefile main)
> - (info 'name (lambda ()
> - (string-titlecase (regexp-replace* #rx"-" game " "))))
> - (info 'game-set (lambda () "Other Games"))
> - (info 'game-icon (lambda () (gamefile (format "~a.png" game))))))))
> +(define (get-game gamedir)
> + (define-values (base name dir?) (split-path gamedir))
> + (define game (path-element->string name))
> + (define info (with-handlers ([exn:fail? (lambda (x) #f)])
> + (get-info (list "games" game))))
> + (define main (and info (info 'game (lambda () #f))))
> + (define (gamefile f) (build-path gamedir f))
> + (and main
> + (make-game
> + (gamefile main)
> + (info 'name (λ () (string-titlecase (regexp-replace* #rx"-" game " "))))
> + (info 'game-set (λ () "Other Games"))
> + (info 'game-icon (λ () (gamefile (format "~a.png" game)))))))
>
> (define (run-game game)
> (define c (make-custodian))
> @@ -51,15 +46,12 @@
> (run))))))
>
> (define games
> - (apply
> - append
> - (for/list ([gamedir (in-list gamedirs)])
> - (filter values (map (λ (x) (get-game gamedir x))
> - (directory-list gamedir))))))
> + (for/list ([gamedir (in-list (find-relevant-directories '(game)))])
> + (get-game gamedir)))
>
> (define game-sets
> (let ([ht (make-hash)])
> - (for ([g games])
> + (for ([g (in-list games)])
> (let ([set (game-set g)])
> (hash-set! ht set (cons g (hash-ref ht set '())))))
> (sort (hash-map ht cons)
> @@ -79,7 +71,7 @@
> (send f stretchable-width #f)
> (send f stretchable-height #f)
>
> -(for ([set game-sets])
> +(for ([set (in-list game-sets)])
> (define set-name (car set))
> (define games (cdr set))
> (define panel
> @@ -102,7 +94,7 @@
> (lambda ()
> (message-box
> "Oops"
> - "There aren't actually any preferences. This is just a test for Mac OS X"
> + "There aren't actually any preferences."
> f
> '(ok))))
>
>
> *** See above for renames and copies ***
>