diff --git a/htest/Test/Ganeti/TestHelper.hs b/htest/Test/Ganeti/TestHelper.hs index 9fe9dbf3e74c3492b2e42382c9027033e832c249..04eb4908dd86b50ab5cb5a329366898629627c24 100644 --- a/htest/Test/Ganeti/TestHelper.hs +++ b/htest/Test/Ganeti/TestHelper.hs @@ -81,10 +81,10 @@ testSuite :: String -> [Name] -> Q [Dec] testSuite tsname tdef = do let fullname = mkName $ "test" ++ mapSlashes tsname tests <- mapM run tdef - sigtype <- [t| (String, [Test]) |] + sigtype <- [t| Test |] + body <- [| testGroup $(litE $ stringL tsname) $(return $ ListE tests) |] return [ SigD fullname sigtype - , ValD (VarP fullname) (NormalB (TupE [LitE (StringL tsname), - ListE tests])) [] + , ValD (VarP fullname) (NormalB body) [] ] -- | Builds an arbitrary value for a given constructor. This doesn't diff --git a/htest/test.hs b/htest/test.hs index d7eb7801936564d6444f4c650b6988008337aaf7..9e00d36093090043a892fa4e76c9681a42272682 100644 --- a/htest/test.hs +++ b/htest/test.hs @@ -69,7 +69,7 @@ defOpts = TestOptions } -- | All our defined tests. -allTests :: [(String, [Test])] +allTests :: [Test] allTests = [ testBasicTypes , testCommon @@ -104,5 +104,4 @@ main :: IO () main = do ropts <- getArgs >>= interpretArgsOrExit let opts = maybe defOpts (defOpts `mappend`) $ ropt_test_options ropts - tests = map (uncurry testGroup) allTests - defaultMainWithOpts tests (ropts { ropt_test_options = Just opts }) + defaultMainWithOpts allTests (ropts { ropt_test_options = Just opts })