Suggested policy: use declarative names for tests instead of increasing integers

Roman Cheplyaka roma at ro-che.info
Tue Dec 18 13:33:26 CET 2012


* Simon Peyton-Jones <simonpj at microsoft.com> [2012-12-18 10:32:39+0000]
> (This belongs on cvs-ghc, or the upcoming ghc-devs.)
> 
> | I find our tests to be quite hard to navigate, as the majority have
> | names like tc12345.hs or some such. I suggest we instead use descriptive
> | names like GADT.hs or PrimOps.hs instead. What do people think?
> 
> We've really moved to a naming convention connected to tickets. Thus test T7490 is a test for Trac ticket #7490.  This is fantastic.  It eliminates the need for elaborate comments in the test to say what is being tested... just look at the ticket.
> 
> The old serially number tests tc032 etc are history.
> 
> If there isn't a corresponding ticket, it'd be a good idea to create one.
> 
> Increasingly we refer to tickets in source-code comments.  They are incredibly valuable resource to give the detail of what went wrong.
> 
> OK?  We should document this convention somewhere.

It is sort of documented at http://hackage.haskell.org/trac/ghc/wiki/Building/RunningTests/Adding

  Having found a suitable place for the test case, give the test case a
  name. For regression test cases, we often just name the test case
  after the bug number (e.g. T2047). Alternatively, follow the
  convention for the directory in which you place the test case: for
  example, in typecheck/should_compile, test cases are named tc001,
  tc002, and so on.

But I wonder what if one wants to create a test preventively (say, for a
new feature), and there isn't actually any bug to create a ticket for?

Roman



More information about the Glasgow-haskell-users mailing list