-- | Generate the HTML markup for a test suite.
markupTest :: Verbosity
           -> LocalBuildInfo
           -> FilePath     -- ^ \"dist/\" prefix
           -> String       -- ^ Library name
           -> TestSuite
           -> IO ()
markupTest verbosity lbi distPref libName suite = do
    tixFileExists <- doesFileExist $ tixFilePath distPref $ testName suite
    when tixFileExists $ do
        (hpc, _) <- requireProgram verbosity hpcProgram $ withPrograms lbi
        markup hpc verbosity (tixFilePath distPref $ testName suite)
                             (mixDir distPref libName)
                             (htmlDir distPref $ testName suite)
                             (testModules suite ++ [ main ])
        notice verbosity $ "Test coverage report written to "
                            ++ htmlDir distPref (testName suite)
                            </> "hpc_index" <.> "html"

-- | Generate the HTML markup for all of a package's test suites.
markupTest :: Verbosity
           -> LocalBuildInfo
           -> FilePath     -- ^ \"dist/\" prefix
           -> String       -- ^ Library name
           -> TestSuite
           -> IO ()
markupTest verbosity lbi distPref libName suite = do
    tixFileExists <- doesFileExist $ tixFilePath distPref $ testName suite
    when tixFileExists $ do
        (hpc, _) <- requireProgram verbosity hpcProgram $ withPrograms lbi
        markup hpc verbosity (tixFilePath distPref $ testName suite)
                             (mixDir distPref libName)
                             (htmlDir distPref $ testName suite)
                             (testModules suite ++ [ main ])
        notice verbosity $ "Test coverage report written to "
                            ++ htmlDir distPref (testName suite)
                            </> "hpc_index" <.> "html"

-- | Generate the HTML markup for all of a package's test suites.
markupTest verbosity lbi distPref libName suite = do
    tixFileExists <- doesFileExist $ tixFilePath distPref $ testName suite
    when tixFileExists $ do
        (hpc, _) <- requireProgram verbosity hpcProgram $ withPrograms lbi
        markup hpc verbosity (tixFilePath distPref $ testName suite)
                             (mixDir distPref libName)
                             (htmlDir distPref $ testName suite)
                             (testModules suite ++ [ main ])
        notice verbosity $ "Test coverage report written to "
                            ++ htmlDir distPref (testName suite)
                            </> "hpc_index" <.> "html"

-- | Generate the HTML markup for all of a package's test suites.