-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Automatic tasty test case discovery using TH
--   
--   Generate tasty TestTrees automatically with TemplateHaskell. See the
--   README for example usage.
@package tasty-th
@version 0.1.7


-- | This module provides TemplateHaskell functions to automatically
--   generate tasty TestTrees from specially named functions. See the
--   README of the package for examples.
--   
--   Important: due to to the GHC staging restriction, you must put any
--   uses of these functions at the end of the file, or you may get errors
--   due to missing definitions.
module Test.Tasty.TH

-- | This function generates a <a>TestTree</a> from functions in the
--   current module. The test tree is named after the current module.
--   
--   The following definitions are collected by <a>testGroupGenerator</a>:
--   
--   <ul>
--   <li>a test_something definition in the current module creates a
--   sub-testGroup with the name "something"</li>
--   <li>a prop_something definition in the current module is added as a
--   QuickCheck property named "something"</li>
--   <li>a case_something definition leads to a HUnit-Assertion test with
--   the name "something"</li>
--   </ul>
--   
--   Example usage:
--   
--   <pre>
--   prop_example :: Int -&gt; Int -&gt; Bool
--   prop_example a b = a + b == b + a
--   
--   tests :: <a>TestTree</a>
--   tests = $(<a>testGroupGenerator</a>)
--   </pre>
testGroupGenerator :: ExpQ

-- | Convenience function that directly generates an <a>IO</a> action that
--   may be used as the main function. It's just a wrapper that applies
--   <a>defaultMain</a> to the <a>TestTree</a> generated by
--   <a>testGroupGenerator</a>.
--   
--   Example usage:
--   
--   <pre>
--   -- properties, test cases, ....
--   
--   main :: IO ()
--   main = $(<a>defaultMainGenerator</a>)
--   </pre>
defaultMainGenerator :: ExpQ

-- | Like <a>testGroupGenerator</a>, but generates a test group only
--   including the specified function names. The function names still need
--   to follow the pattern of starting with one of <tt>prop_</tt>,
--   <tt>case_</tt> or <tt>test_</tt>.
testGroupGeneratorFor :: String -> [String] -> ExpQ

-- | Like <a>defaultMainGenerator</a>, but only includes the specific
--   function names in the test group. The function names still need to
--   follow the pattern of starting with one of <tt>prop_</tt>,
--   <tt>case_</tt> or <tt>test_</tt>.
defaultMainGeneratorFor :: String -> [String] -> ExpQ

-- | Retrieves all function names from the given file that would be
--   discovered by <a>testGroupGenerator</a>.
extractTestFunctions :: FilePath -> IO [String]

-- | Extract the name of the current module.
locationModule :: ExpQ
