> I am starting to use raco test for testing, and found out that in a file 
> without (module test ...), it may run some kind of test on the file. But for 
> some files, raco test reports that it ran a test, for others however no test 
> is run.
>
> Right now I am now adding a (module test racket/base) at the end of files I 
> have no tests for which leads to 0 tests (as it should). Nonetheless out of 
> curiosity, I am wondering why raco reports running a test for `pages.rkt`, 
> but not `tools.rkt`, even though both of them are essentially defining a 
> bunch of functions and providing them to other files, without running any 
> code.

You can also use -x with raco test: `raco test -x file.rkt`.

Relevant snip from `raco help test`:

    / --run-if-absent, -r : Require module if submodule is absent (on
by default)
    \ --no-run-if-absent, -x : Require nothing if submodule is absent

I believe the default is --run-if-absent to support the traditional
approach of putting tests in dedicated files under test/ subdirs.

There are some other interesting flags to check out. You can specify
the submodule name (not just "test"). For example you could have
submodules like `slow-test` or `except-on-ci`, and your makefile or CI
script runs raco test for those submodules (or not) in various
circumstances.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to