<div dir="ltr">The 2 approaches are not mutually exclusive.<div><br></div><div> ticket#_description.hs<div> tc12345_GADT.hs<br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 18, 2012 at 6:22 AM, Simon Marlow <span dir="ltr">&lt;<a href="mailto:marlowsd@gmail.com" target="_blank">marlowsd@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 18/12/12 12:33, Roman Cheplyaka wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* Simon Peyton-Jones &lt;<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>&gt; [2012-12-18 10:32:39+0000]<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(This belongs on cvs-ghc, or the upcoming ghc-devs.)<br>
<br>
| I find our tests to be quite hard to navigate, as the majority have<br>
| names like tc12345.hs or some such. I suggest we instead use descriptive<br>
| names like GADT.hs or PrimOps.hs instead. What do people think?<br>
<br>
We&#39;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.<br>


<br>
The old serially number tests tc032 etc are history.<br>
<br>
If there isn&#39;t a corresponding ticket, it&#39;d be a good idea to create one.<br>
<br>
Increasingly we refer to tickets in source-code comments.  They are incredibly valuable resource to give the detail of what went wrong.<br>
<br>
OK?  We should document this convention somewhere.<br>
</blockquote>
<br>
It is sort of documented at <a href="http://hackage.haskell.org/trac/ghc/wiki/Building/RunningTests/Adding" target="_blank">http://hackage.haskell.org/<u></u>trac/ghc/wiki/Building/<u></u>RunningTests/Adding</a><br>
<br>
   Having found a suitable place for the test case, give the test case a<br>
   name. For regression test cases, we often just name the test case<br>
   after the bug number (e.g. T2047). Alternatively, follow the<br>
   convention for the directory in which you place the test case: for<br>
   example, in typecheck/should_compile, test cases are named tc001,<br>
   tc002, and so on.<br>
<br>
But I wonder what if one wants to create a test preventively (say, for a<br>
new feature), and there isn&#39;t actually any bug to create a ticket for?<br>
</blockquote>
<br></div>
It wouldn&#39;t hurt to be more descriptive with test names than we are currently in e.g. codeGen and typechecker.  Some parts of the testsuite are better, e.g. see libraries/base/tests where the tests are named after the function being tested (sort of), or in codeGen/should_run_asm:<br>


<br>
test(&#39;memcpy&#39;,<br>
     unless_platform(&#39;x86_64-<u></u>unknown-linux&#39;,skip), compile_cmp_asm, [&#39;&#39;])<br>
test(&#39;memcpy-unroll&#39;,<br>
     unless_platform(&#39;x86_64-<u></u>unknown-linux&#39;,skip), compile_cmp_asm, [&#39;&#39;])<br>
test(&#39;memcpy-unroll-conprop&#39;,<br>
     unless_platform(&#39;x86_64-<u></u>unknown-linux&#39;,skip), compile_cmp_asm, [&#39;&#39;])<br>
<br>
ticket numbers are good names for regression tests, but for other tests more descriptive names would help. There isn&#39;t always a good name for a test, but often there is.<br>
<br>
Cheers,<br>
        Simon<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
______________________________<u></u>_________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org" target="_blank">Glasgow-haskell-users@haskell.<u></u>org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/<u></u>mailman/listinfo/glasgow-<u></u>haskell-users</a><br>
</div></div></blockquote></div><br></div>