Adding module**, when-testing, and raco test
original commit: b73444a0f3
This commit is contained in:
parent
f2dbacc73f
commit
9741ae6d98
|
@ -6,6 +6,7 @@
|
||||||
("pack" compiler/commands/pack "pack files/collections into a .plt archive" 10)
|
("pack" compiler/commands/pack "pack files/collections into a .plt archive" 10)
|
||||||
("unpack" compiler/commands/unpack "unpack files/collections from a .plt archive" 10)
|
("unpack" compiler/commands/unpack "unpack files/collections from a .plt archive" 10)
|
||||||
("decompile" compiler/commands/decompile "decompile bytecode" #f)
|
("decompile" compiler/commands/decompile "decompile bytecode" #f)
|
||||||
|
("test" compiler/commands/test "run all tests associated with a set of paths" #f)
|
||||||
("expand" compiler/commands/expand "macro-expand source" #f)
|
("expand" compiler/commands/expand "macro-expand source" #f)
|
||||||
("distribute" compiler/commands/exe-dir "prepare executable(s) in a directory for distribution" #f)
|
("distribute" compiler/commands/exe-dir "prepare executable(s) in a directory for distribution" #f)
|
||||||
("ctool" compiler/commands/ctool "compile and link C-based extensions" #f)
|
("ctool" compiler/commands/ctool "compile and link C-based extensions" #f)
|
||||||
|
|
28
collects/compiler/commands/test.rkt
Normal file
28
collects/compiler/commands/test.rkt
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#lang racket/base
|
||||||
|
(require racket/cmdline
|
||||||
|
racket/match
|
||||||
|
racket/path
|
||||||
|
raco/command-name)
|
||||||
|
|
||||||
|
(define do-test
|
||||||
|
(match-lambda
|
||||||
|
[(? string? s)
|
||||||
|
(do-test (string->path s))]
|
||||||
|
[(? path? p)
|
||||||
|
(cond
|
||||||
|
[(directory-exists? p)
|
||||||
|
(for-each
|
||||||
|
(λ (dp)
|
||||||
|
(do-test (build-path p dp)))
|
||||||
|
(directory-list p))]
|
||||||
|
[(file-exists? p)
|
||||||
|
(define mod `(submod (file ,(path->string p)) test))
|
||||||
|
(when (module-declared? mod #t)
|
||||||
|
(dynamic-require mod #f))]
|
||||||
|
[else
|
||||||
|
(error 'test "Given path ~e does not exist" p)])]))
|
||||||
|
|
||||||
|
(command-line
|
||||||
|
#:program (short-program+command-name)
|
||||||
|
#:args files+directories
|
||||||
|
(for-each do-test files+directories))
|
4
collects/tests/compiler/test/a.rkt
Normal file
4
collects/tests/compiler/test/a.rkt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#lang racket/base
|
||||||
|
(error 'dont-run)
|
||||||
|
(module test racket/base
|
||||||
|
(printf "a\n"))
|
4
collects/tests/compiler/test/b.rkt
Normal file
4
collects/tests/compiler/test/b.rkt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#lang racket/base
|
||||||
|
(error 'dont-run)
|
||||||
|
(module test racket/base
|
||||||
|
(printf "b\n"))
|
4
collects/tests/compiler/test/d/c.rkt
Normal file
4
collects/tests/compiler/test/d/c.rkt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#lang racket/base
|
||||||
|
(error 'dont-run)
|
||||||
|
(module test racket/base
|
||||||
|
(printf "c\n"))
|
1
collects/tests/compiler/test/d/d.rkt
Normal file
1
collects/tests/compiler/test/d/d.rkt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#lang racket/base
|
Loading…
Reference in New Issue
Block a user