diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-11-23 18:03:22 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-11-23 18:03:22 +0000 |
commit | 39f273709488ec609b25320c10f2fc7b5f7518de (patch) | |
tree | ca0be8558f0045da50d5ad11c832fb2909621539 /utils/hpc | |
parent | 95027b829425b1a4f18f2cb197a0982cfaedcbe5 (diff) | |
download | haskell-39f273709488ec609b25320c10f2fc7b5f7518de.tar.gz |
Add a --reset-hpcdirs flag to hpc
Diffstat (limited to 'utils/hpc')
-rw-r--r-- | utils/hpc/HpcDraft.hs | 1 | ||||
-rw-r--r-- | utils/hpc/HpcFlags.hs | 18 | ||||
-rw-r--r-- | utils/hpc/HpcMarkup.hs | 1 | ||||
-rw-r--r-- | utils/hpc/HpcOverlay.hs | 1 | ||||
-rw-r--r-- | utils/hpc/HpcReport.hs | 1 | ||||
-rw-r--r-- | utils/hpc/HpcShowTix.hs | 1 |
6 files changed, 17 insertions, 6 deletions
diff --git a/utils/hpc/HpcDraft.hs b/utils/hpc/HpcDraft.hs index c0b5c47e15..b804d568e4 100644 --- a/utils/hpc/HpcDraft.hs +++ b/utils/hpc/HpcDraft.hs @@ -18,6 +18,7 @@ draft_options . includeOpt . srcDirOpt . hpcDirOpt + . resetHpcDirsOpt . outputOpt draft_plugin :: Plugin diff --git a/utils/hpc/HpcFlags.hs b/utils/hpc/HpcFlags.hs index b66d418e6c..3bb31639b1 100644 --- a/utils/hpc/HpcFlags.hs +++ b/utils/hpc/HpcFlags.hs @@ -13,7 +13,7 @@ data Flags = Flags { outputFile :: String , includeMods :: Set.Set String , excludeMods :: Set.Set String - , hpcDir :: String + , hpcDirs :: [String] , srcDirs :: [String] , destDir :: String @@ -34,7 +34,7 @@ default_flags = Flags { outputFile = "-" , includeMods = Set.empty , excludeMods = Set.empty - , hpcDir = ".hpc" + , hpcDirs = [".hpc"] , srcDirs = [] , destDir = "." @@ -72,7 +72,8 @@ anArg flag detail argtype fn = (:) $ Option [] [flag] (ReqArg fn argtype) detail infoArg :: String -> FlagOptSeq infoArg info = (:) $ Option [] [] (NoArg $ id) info -excludeOpt, includeOpt, hpcDirOpt, srcDirOpt, destDirOpt, outputOpt, +excludeOpt, includeOpt, hpcDirOpt, resetHpcDirsOpt, srcDirOpt, + destDirOpt, outputOpt, perModuleOpt, decListOpt, xmlOutputOpt, funTotalsOpt, altHighlightOpt, combineFunOpt, combineFunOptInfo, mapFunOpt, mapFunOptInfo, unionModuleOpt :: FlagOptSeq @@ -82,10 +83,14 @@ excludeOpt = anArg "exclude" "exclude MODULE and/or PACKAGE" "[PACKAGE:] includeOpt = anArg "include" "include MODULE and/or PACKAGE" "[PACKAGE:][MODULE]" $ \ a f -> f { includeMods = a `Set.insert` includeMods f } -hpcDirOpt = anArg "hpcdir" "sub-directory that contains .mix files" "DIR" - (\ a f -> f { hpcDir = a }) +hpcDirOpt = anArg "hpcdir" "append sub-directory that contains .mix files" "DIR" + (\ a f -> f { hpcDirs = hpcDirs f ++ [a] }) . infoArg "default .hpc [rarely used]" +resetHpcDirsOpt = noArg "reset-hpcdirs" "empty the list of hpcdir's" + (\ f -> f { hpcDirs = [] }) + . infoArg "[rarely used]" + srcDirOpt = anArg "srcdir" "path to source directory of .hs files" "DIR" (\ a f -> f { srcDirs = srcDirs f ++ [a] }) . infoArg "multi-use of srcdir possible" @@ -130,8 +135,9 @@ unionModuleOpt = noArg "union" ------------------------------------------------------------------------------- readMixWithFlags :: Flags -> Either String TixModule -> IO Mix -readMixWithFlags flags modu = readMix [ dir ++ "/" ++ hpcDir flags +readMixWithFlags flags modu = readMix [ dir ++ "/" ++ hpcDir | dir <- srcDirs flags + , hpcDir <- hpcDirs flags ] modu ------------------------------------------------------------------------------- diff --git a/utils/hpc/HpcMarkup.hs b/utils/hpc/HpcMarkup.hs index bd297828e5..ebec912352 100644 --- a/utils/hpc/HpcMarkup.hs +++ b/utils/hpc/HpcMarkup.hs @@ -29,6 +29,7 @@ markup_options . includeOpt . srcDirOpt . hpcDirOpt + . resetHpcDirsOpt . funTotalsOpt . altHighlightOpt . destDirOpt diff --git a/utils/hpc/HpcOverlay.hs b/utils/hpc/HpcOverlay.hs index d5566aa6ae..531018cd0c 100644 --- a/utils/hpc/HpcOverlay.hs +++ b/utils/hpc/HpcOverlay.hs @@ -13,6 +13,7 @@ overlay_options :: FlagOptSeq overlay_options = srcDirOpt . hpcDirOpt + . resetHpcDirsOpt . outputOpt overlay_plugin :: Plugin diff --git a/utils/hpc/HpcReport.hs b/utils/hpc/HpcReport.hs index 12403eb5b3..a97d6b0981 100644 --- a/utils/hpc/HpcReport.hs +++ b/utils/hpc/HpcReport.hs @@ -272,6 +272,7 @@ report_options . includeOpt . srcDirOpt . hpcDirOpt + . resetHpcDirsOpt . xmlOutputOpt diff --git a/utils/hpc/HpcShowTix.hs b/utils/hpc/HpcShowTix.hs index 354ee066b0..13a28754aa 100644 --- a/utils/hpc/HpcShowTix.hs +++ b/utils/hpc/HpcShowTix.hs @@ -13,6 +13,7 @@ showtix_options . includeOpt . srcDirOpt . hpcDirOpt + . resetHpcDirsOpt . outputOpt showtix_plugin :: Plugin |