Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
5f4e77a5
Commit
5f4e77a5
authored
Sep 07, 2007
by
andy@galois.com
Browse files
Fixing hpc to allow use of hash function to seperate source files on source path
parent
f8c52d7f
Changes
6
Hide whitespace changes
Inline
Side-by-side
utils/hpc/Hpc.hs
View file @
5f4e77a5
...
...
@@ -125,4 +125,4 @@ version_plugin = Plugin { name = "version"
version_main
_
_
=
putStrLn
$
"hpc tools, version 0.5-dev"
------------------------------------------------------------------------------
------------------------------------------------------------------------------
\ No newline at end of file
utils/hpc/HpcDraft.hs
View file @
5f4e77a5
...
...
@@ -59,7 +59,7 @@ makeDraft hpcflags tix = do
hash
=
tixModuleHash
tix
tixs
=
tixModuleTixs
tix
mix
@
(
Mix
filepath
timestamp
hash
tabstop
entries
)
<-
readMixWithFlags
hpcflags
mod
mix
@
(
Mix
filepath
timestamp
hash
tabstop
entries
)
<-
readMixWithFlags
hpcflags
tix
let
forest
=
createMixEntryDom
[
(
span
,(
box
,
v
>
0
))
...
...
utils/hpc/HpcFlags.hs
View file @
5f4e77a5
...
...
@@ -110,6 +110,7 @@ postInvertOpt = noArg "post-invert" "invert output; ticked becomes unticked, unt
$
\
f
->
f
{
funTotals
=
True
}
-------------------------------------------------------------------------------
readMixWithFlags
::
Flags
->
TixModule
->
IO
Mix
readMixWithFlags
flags
mod
=
readMix
[
dir
++
"/"
++
hpcDir
flags
|
dir
<-
srcDirs
flags
]
mod
...
...
utils/hpc/HpcMarkup.hs
View file @
5f4e77a5
...
...
@@ -143,7 +143,7 @@ genHtmlFromMod dest_dir flags tix theFunTotals invertOutput = do
let
theHsPath
=
srcDirs
flags
let
modName0
=
tixModuleName
tix
(
Mix
origFile
_
mixHash
tabStop
mix'
)
<-
readMixWithFlags
flags
modName0
(
Mix
origFile
_
mixHash
tabStop
mix'
)
<-
readMixWithFlags
flags
tix
let
arr_tix
::
Array
Int
Integer
arr_tix
=
listArray
(
0
,
length
(
tixModuleTixs
tix
)
-
1
)
...
...
utils/hpc/HpcReport.hs
View file @
5f4e77a5
...
...
@@ -8,7 +8,7 @@ module HpcReport (report_plugin) where
import
System.Exit
import
Prelude
hiding
(
exp
)
import
System
(
getArgs
)
import
List
(
sort
,
intersperse
)
import
List
(
sort
,
intersperse
,
sortBy
)
import
HpcFlags
import
Trace.Hpc.Mix
import
Trace.Hpc.Tix
...
...
@@ -150,17 +150,17 @@ single (TopLevelBox _) = True
single
(
LocalBox
_
)
=
True
single
(
BinBox
{})
=
False
modInfo
::
Flags
->
Bool
->
(
String
,[
Integer
])
->
IO
ModInfo
modInfo
hpcflags
qualDecList
(
moduleName
,
tickCounts
)
=
do
Mix
_
_
_
_
mes
<-
readMixWithFlags
hpcflags
moduleName
modInfo
::
Flags
->
Bool
->
TixModule
->
IO
ModInfo
modInfo
hpcflags
qualDecList
tix
@
(
TixModule
moduleName
_
_
tickCounts
)
=
do
Mix
_
_
_
_
mes
<-
readMixWithFlags
hpcflags
tix
return
(
q
(
accumCounts
(
zip
(
map
snd
mes
)
tickCounts
)
miZero
))
where
q
mi
=
if
qualDecList
then
mi
{
decPaths
=
map
(
moduleName
:
)
(
decPaths
mi
)}
else
mi
modReport
::
Flags
->
(
String
,[
Integer
])
->
IO
()
modReport
hpcflags
(
moduleName
,
tickCounts
)
=
do
mi
<-
modInfo
hpcflags
False
(
moduleName
,
tickCounts
)
modReport
::
Flags
->
TixModule
->
IO
()
modReport
hpcflags
tix
@
(
TixModule
moduleName
_
_
tickCounts
)
=
do
mi
<-
modInfo
hpcflags
False
tix
if
xmlOutput
hpcflags
then
putStrLn
$
" <module name = "
++
show
moduleName
++
">"
else
putStrLn
(
"-----<module "
++
moduleName
++
">-----"
)
...
...
@@ -221,20 +221,21 @@ report_main hpcflags (progName:mods) = do
case
tix
of
Just
(
Tix
tickCounts
)
->
makeReport
hpcflags1
progName
[(
m
,
tcs
)
|
TixModule
m
_h
_
tcs
<-
tickCounts
$
sortBy
(
\
mod1
mod2
->
tixModuleName
mod1
`
compare
`
tixModuleName
mod2
)
$
[
tix
|
tix
@
(
TixModule
m
_h
_
tcs
)
<-
tickCounts
,
allowModule
hpcflags1
m
]
Nothing
->
hpcError
report_plugin
$
"unable to find tix file for:"
++
progName
report_main
hpcflags
[]
=
hpcError
report_plugin
$
"no .tix file or executable name specified"
makeReport
::
Flags
->
String
->
[
(
String
,[
Integer
])
]
->
IO
()
makeReport
::
Flags
->
String
->
[
TixModule
]
->
IO
()
makeReport
hpcflags
progName
modTcs
|
xmlOutput
hpcflags
=
do
putStrLn
$
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
?>"
putStrLn
$
"<coverage name="
++
show
progName
++
">"
if
perModule
hpcflags
then
mapM_
(
modReport
hpcflags
)
(
sort
modTcs
)
then
mapM_
(
modReport
hpcflags
)
modTcs
else
return
()
mis
<-
mapM
(
modInfo
hpcflags
True
)
modTcs
putStrLn
$
" <summary>"
...
...
@@ -243,7 +244,7 @@ makeReport hpcflags progName modTcs | xmlOutput hpcflags = do
putStrLn
$
"</coverage>"
makeReport
hpcflags
_
modTcs
=
if
perModule
hpcflags
then
mapM_
(
modReport
hpcflags
)
(
sort
modTcs
)
mapM_
(
modReport
hpcflags
)
modTcs
else
do
mis
<-
mapM
(
modInfo
hpcflags
True
)
modTcs
printModInfo
hpcflags
(
foldr
miPlus
miZero
mis
)
...
...
utils/hpc/HpcShowTix.hs
View file @
5f4e77a5
...
...
@@ -38,7 +38,7 @@ showtix_main flags (prog:modNames) = do
Nothing
->
hpcError
showtix_plugin
$
"could not read .tix file : "
++
prog
Just
(
Tix
tixs
)
->
do
tixs_mixs
<-
sequence
[
do
mix
<-
readMixWithFlags
hpcflags1
(
tix
ModuleName
tix
)
[
do
mix
<-
readMixWithFlags
hpcflags1
tix
return
$
(
tix
,
mix
)
|
tix
<-
tixs
,
allowModule
hpcflags1
(
tixModuleName
tix
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment