Revision f842aecd

b/htest/Test/Ganeti/TestHelper.hs
81 81
testSuite tsname tdef = do
82 82
  let fullname = mkName $ "test" ++ mapSlashes tsname
83 83
  tests <- mapM run tdef
84
  sigtype <- [t| (String, [Test]) |]
84
  sigtype <- [t| Test |]
85
  body <- [| testGroup $(litE $ stringL tsname) $(return $ ListE tests) |]
85 86
  return [ SigD fullname sigtype
86
         , ValD (VarP fullname) (NormalB (TupE [LitE (StringL tsname),
87
                                                ListE tests])) []
87
         , ValD (VarP fullname) (NormalB body) []
88 88
         ]
89 89

  
90 90
-- | Builds an arbitrary value for a given constructor. This doesn't
b/htest/test.hs
69 69
       }
70 70

  
71 71
-- | All our defined tests.
72
allTests :: [(String, [Test])]
72
allTests :: [Test]
73 73
allTests =
74 74
  [ testBasicTypes
75 75
  , testCommon
......
104 104
main = do
105 105
  ropts <- getArgs >>= interpretArgsOrExit
106 106
  let opts = maybe defOpts (defOpts `mappend`) $ ropt_test_options ropts
107
      tests = map (uncurry testGroup) allTests
108
  defaultMainWithOpts tests (ropts { ropt_test_options = Just opts })
107
  defaultMainWithOpts allTests (ropts { ropt_test_options = Just opts })

Also available in: Unified diff