<div dir="ltr"><div><div><div><div><div>Quickly: It is common to use a submodule for tests, in the same source file:<br></div>(module+ test<br></div> (require rackunit)<br> ....)<br><br></div>then running `raco test <file.rkt> ...` will run all the tests. Such tests are also automatically run in DrRacket when you press run (along with the 'main' submodule).<br>
<br></div>For packages that have a collection A, it is also common (and considered good practice) to have another collection 'test' with a subdirectory for A and its tests.<br></div><div>See for example the xml-rpc repo: <a href="https://github.com/jeapostrophe/xml-rpc">https://github.com/jeapostrophe/xml-rpc</a><br>
</div><div></div>This is partly intended for use with DrDr (that runs `raco test`), a tool written by Jay for the development of Racket. I don't know much more about it, but other people on this list do.<br><br><div>
<div>
Laurent<br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 22, 2013 at 7:54 AM, Chad Albers <span dir="ltr"><<a href="mailto:calbers@neomantic.com" target="_blank">calbers@neomantic.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As a Ruby engineer, we have a wonderful tool called "guard" that<br>
automatically runs our unit-tests every time a test-case changes or<br>
every-time a source file changes.<br>
<br>
I have written a guard plugin that performs the same task for Racket's<br>
rackunit. Currently, it pretty primitive - guard runs all tests if<br>
anything changes - and it makes several assumptions about how tests<br>
are structured.<br>
<br>
guard's ruby unit test plug works so well because there is a set of<br>
informal conventions that Ruby developers follow, and guard's ruby<br>
plugin works so well because it can counts on those conventions.<br>
<br>
Before I release "guard-rackunit" to the general public, I am<br>
wondering if similar conventions exist for rackunit.<br>
<br>
For instance, in my Racket project, the following conditions hold true<br>
1. all tests are located at the root of the project in a directory call "tests"<br>
2. in the "tests" directory, I have a "test-runner.rkt" file that<br>
performs all '(run-tests *).<br>
3. Each test-suite file contains one 'provide' which corresponds to<br>
the name of the test-suite<br>
4. Each test-suite file is name after the file that it tests and<br>
appends "-test.rkt"; eg. foo.rkt corresponds to foo-test.rkt<br>
<br>
If the Racket community follows a different set of conventions, I can<br>
change my guard plugin to follow those conventions, and only have<br>
guard run a test suite for the file it tests.<br>
<br>
Let me know 1) if there is any interest in this project, and 2) a set<br>
of conventions that I can generally depend upon.<br>
<br>
Thanks,<br>
Chad<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br></div>