Skip to content
GitLab
Menu
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
78a1b71c
Commit
78a1b71c
authored
Jun 27, 2007
by
andy@galois.com
Browse files
fixing creation of directory for html output; fixing html markup for 0% bars.
parent
3e664735
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils/hpc/HpcMarkup.hs
View file @
78a1b71c
...
...
@@ -12,6 +12,7 @@ import Trace.Hpc.Util
import
HpcFlags
import
System.Environment
import
System.Directory
import
Data.List
import
Data.Maybe
(
fromJust
)
import
Data.Array
...
...
@@ -55,6 +56,9 @@ markup_main flags (prog:modNames) = do
Nothing
->
error
$
"unable to find tix file for: "
++
prog
Just
a
->
return
a
-- create the dest_dir if needed
createDirectoryIfMissing
True
dest_dir
mods
<-
sequence
[
genHtmlFromMod
dest_dir
hpcDirs
tix
theFunTotals
theHsPath
invertOutput
|
tix
<-
tixs
...
...
@@ -68,6 +72,9 @@ markup_main flags (prog:modNames) = do
let
writeSummary
name
cmp
=
do
let
mods'
=
sortBy
cmp
mods
putStrLn
$
"Writing: "
++
(
name
++
".html"
)
writeFile
(
dest_dir
++
"/"
++
name
++
".html"
)
$
...
...
@@ -75,6 +82,7 @@ markup_main flags (prog:modNames) = do
"<style type=
\"
text/css
\"
>"
++
"table.bar { background-color: #f25913; }
\n
"
++
"td.bar { background-color: #60de51; }
\n
"
++
"td.invbar { background-color: #f25913; }
\n
"
++
"table.dashboard { border-collapse: collapse ; border: solid 1px black }
\n
"
++
".dashboard td { border: solid 1px black }
\n
"
++
".dashboard th { border: solid 1px black }
\n
"
++
...
...
@@ -411,14 +419,16 @@ showSummary ticked total =
"<td width=100>"
++
(
case
percent
ticked
total
of
Nothing
->
" "
Just
w
->
"<table cellpadding=0 cellspacing=0 width=
\"
100
\"
class=
\"
bar
\"
>"
++
"<tr><td><table cellpadding=0 cellspacing=0 width=
\"
"
++
show
w
++
"%
\"
>"
++
"<tr><td height=12 class=
\"
bar
\"
></td></tr>"
++
"</table></td></tr></table>"
)
++
"</td>"
Just
w
->
bar
w
"bar"
)
++
"</td>"
where
showP
Nothing
=
"- "
showP
(
Just
x
)
=
show
x
++
"%"
bar
0
inner
=
bar
100
"invbar"
bar
w
inner
=
"<table cellpadding=0 cellspacing=0 width=
\"
100
\"
class=
\"
bar
\"
>"
++
"<tr><td><table cellpadding=0 cellspacing=0 width=
\"
"
++
show
w
++
"%
\"
>"
++
"<tr><td height=12 class="
++
show
inner
++
"></td></tr>"
++
"</table></td></tr></table>"
percent
::
(
Integral
a
)
=>
a
->
a
->
Maybe
a
percent
ticked
total
=
if
total
==
0
then
Nothing
else
Just
(
ticked
*
100
`
div
`
total
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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