<div dir="ltr"><br><br><div class="gmail_quote">On Wed, Apr 6, 2011 at 11:53 PM, Simon Hengel <span dir="ltr">&lt;<a href="mailto:simon.hengel@wiktory.org" target="_blank">simon.hengel@wiktory.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello Michael,<br>
<div><br>
&gt; I would like to integrate DocTest into my normal test suite procedures. Do you<br>
&gt; have a recommended approach for this? I think I have projects using all of<br>
&gt; test-framework[1], HTF[2] and hspect[3], so I&#39;m not picky here.<br>
<br>
</div>Currently you are pretty much on your own here.  A shell script that<br>
runs both, doctest and unit test, is what I currently use.<br>
<br>
In principle it should be possible to provide an API function that maps<br>
a list of flags and source files to tests, like:<br>
<br>
    getDocTests :: [Flag] -&gt; [FilePath] -&gt; IO [Test]<br>
<br>
But with this you still have to figure out the flags and source files.<br>
<br>
A different approach would be to provide Cabal with a `doctest&#39; target<br>
(similar to the `haddock&#39; target), that runs the DocTests.  Cabal<br>
already knows the necessary information to do so.<br>
<br>
Sadly, I have no time to work on any of these for at least a month.<br>
Nevertheless, I&#39;d be interested what you think about it.<br>
<br>
Cheers,<br>
<font color="#888888">Simon<br>
</font></blockquote></div><br><div>I like the idea of a getDocTests function. In theory, it could take a cabal file as an argument, and use the Cabal library to get a list of all modules to be checked. It would also be convenient if it automatically passed in GHC options correlating to each LANGUAGE pragma found on a module.</div>

<div><br></div><div>Michael</div></div>