Hi,<div><br></div><div>I've been playing with the detailed-0.9 test-suite option on a package of mine. First, what I have:</div><div><br></div><div>in my package root, I have my .cabal file and a tests folder containing a Tests.hs</div>
<div><br></div><div>in my Tests.hs, I took the code from the online user guide (minus the odd guards with == True and == False):</div><div><br></div><div><div>{-# LANGUAGE FlexibleInstances #-}</div><div>module Tests ( tests ) where</div>
<div><br></div><div>import Distribution.TestSuite</div><div><br></div><div>instance TestOptions (String, Bool) where</div><div> name = fst</div><div> options = const []</div><div> defaultOptions _ = return (Options [])</div>
<div> check _ _ = []</div><div><br></div><div>instance PureTestable (String, Bool) where</div><div> run (name, True) _ = Pass</div><div> run (name, False) _ = Fail (name ++ " failed!")</div><div><br></div>
<div>test :: (String, Bool) -> Test</div><div>test = pure</div><div><br></div><div>-- In actual usage, the instances 'TestOptions (String, Bool)' and</div><div>-- 'PureTestable (String, Bool)', as well as the function 'test', would be</div>
<div>-- provided by the test framework.</div><div><br></div><div>tests :: [Test]</div><div>tests =</div><div> [ test ("bar-1", True)</div><div> , test ("bar-2", False)</div><div> ]</div></div>
<div><br></div><div><br></div><div>in my .cabal file:</div><div><br></div><div><div>Test-Suite binutils</div><div> Hs-source-dirs: tests/</div><div> Type: detailed-0.9</div><div> Test-module: Tests</div>
<div> Build-depends: base, Cabal >= 1.9.2</div></div><div><br></div><div><br></div><div>I then run cabal configure --enable-tests and finally run cabal test.</div><div><br></div><div>It gives me this:</div><div><br>
</div><div>Running 1 test suites...</div><div><div>Test suite binutils: RUNNING...</div><div>Test suite binutils: PASS</div><div>Test suite logged to: dist/test/charm-0.0.1-binutils.log</div><div>1 of 1 test suites (0 of 0 test cases) passed.</div>
</div><div><br></div><div><br></div><div>Which seems odd, since there are 2 test cases (not 0 as the output claims) and one of them should definitely be failing (it has a False in it).</div><div><br></div><div>Am I doing something wrong?</div>
<div><br></div><div>Thanks,</div><div>Daniel</div>