[racket] Rackunit best practices

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Aug 22 09:47:38 EDT 2013

Thanks for the idea but I think it's worth explaining the
bigger picture a bit in addition to the detail answers you 
have received. 

;; --------------------------------------------------------

Part of Racket's slogan is 

 'internalize tools from the tool chain into the language'

Tests have recently been moved from the tool chain into the 
language via submodules (plus syntax extensions). I know that 
many of us have switched to this unit-tests-are-in-the-module 
mode of work but not all due to our history. 

Past: 

For many main distribution parts mp of Racket, the tests 
are located in a test/mp folder. There are commands to run
them all but not on change events. 

For some of those mp, people also use mp/test. I am one of 
the people who arranges his projects this way. 

Until submodules, I more or less followed the Ruby conventions
(I didn't know that that's what they were) for my course projects
in softw dev courses. 

Hope this helps shed some light on the picture -- Matthias








On Aug 22, 2013, at 1:54 AM, Chad Albers wrote:

> As a Ruby engineer, we have a wonderful tool called "guard" that
> automatically runs our unit-tests every time a test-case changes or
> every-time a source file changes.
> 
> I have written a guard plugin that performs the same task for Racket's
> rackunit.  Currently, it pretty primitive - guard runs all tests if
> anything changes - and it makes several assumptions about how tests
> are structured.
> 
> guard's ruby unit test plug works so well because there is a set of
> informal conventions that Ruby developers follow, and guard's ruby
> plugin works so well because it can counts on those conventions.
> 
> Before I release "guard-rackunit" to the general public, I am
> wondering if similar conventions exist for rackunit.
> 
> For instance, in my Racket project, the following conditions hold true
> 1. all tests are located at the root of the project in a directory call "tests"
> 2. in the "tests" directory, I have a "test-runner.rkt" file that
> performs all '(run-tests *).
> 3. Each test-suite file contains one 'provide' which corresponds to
> the name of the test-suite
> 4. Each test-suite file is name after the file that it tests and
> appends "-test.rkt"; eg. foo.rkt corresponds to foo-test.rkt
> 
> If the Racket community follows a different set of conventions, I can
> change my guard plugin to follow those conventions, and only have
> guard run a test suite for the file it tests.
> 
> Let me know 1) if there is any interest in this project, and 2) a set
> of conventions that I can generally depend upon.
> 
> Thanks,
> Chad
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users



Posted on the users mailing list.