[Hackage] #215: Overhaul support for package's tests

Hackage trac at galois.com
Sat Feb 23 12:36:57 EST 2008

#215: Overhaul support for package's tests
  Reporter:  duncan         |        Owner:                 
      Type:  task           |       Status:  new            
  Priority:  normal         |    Milestone:                 
 Component:  Cabal library  |      Version:        
  Severity:  normal         |   Resolution:                 
  Keywords:                 |   Difficulty:  project(> week)
Ghcversion:  6.8.2          |     Platform:                 
Comment (by duncan):

 Here's an idea

   test-is: Test
   build-depends: QuickCheck
   hs-source-dirs: tests src

 So imaging a dir layout like:

 where `tests/Test.hs` is

 module Test (tests) where

 tests :: SomethingYetToBeDecided
 tests = ...

 So a test is really like an executable or library. It can have all the
 ordinary buildinfo which for example allows it to depend on extra testing
 libs. The difference is that instead of having a single Main.main entry
 point or a bunch of exposed modules, it has a test entry point in one

 That also means the interface is a Haskell one, not a process text
 stdin/stdout one. That's likely more portable between Haskell
 implementations and crucially it allows us to build the test code with
 additional profiling or hpc or whatever. It also means that in principle
 such tests could be secure if the test type does not involve IO and we use
 a Haskell implementation that can run untrusted pure code securely.

 The tricky bit is what the type of the test entry point should be. We want
 to be able to gather the results of the tests. Perhaps the test stanza
 also needs to declare what version of the test api interface it is using
 since it is likely to be refined/improved over time.

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/215#comment:2>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list