[MINOR: aesthetic modification for HTML output.
bisect@x9c.fr**20090503120820] {
hunk ./src/reportHTML.ml 27
+ ".title {" ;
+ " font-size: xx-large;" ;
+ " font-weight: bold;" ;
+ "}" ;
+ "" ;
+ ".section {" ;
+ " font-size: larger;" ;
+ " font-weight: bold;" ;
+ "}" ;
+ "" ;
hunk ./src/reportHTML.ml 66
+ " font-size: smaller;" ;
hunk ./src/reportHTML.ml 90
+ " font-size: smaller;" ;
hunk ./src/reportHTML.ml 103
+ ".gaugeNO { background: gray; }" ;
hunk ./src/reportHTML.ml 127
- [ "$(tabs)
" ;
- "$(tabs) kind | | coverage |
" ] @
- (List.map
- (fun (k, r) ->
- Printf.sprintf "$(tabs) %s | | %d / %d (%s %%) |
"
- (Common.string_of_point_kind k)
- r.ReportStat.count
- r.ReportStat.total
- (if r.ReportStat.total <> 0 then
- string_of_int ((r.ReportStat.count * 100) / r.ReportStat.total)
- else
- "-"))
- s) @
- [ "$(tabs)
" ]
+ let len = List.length s in
+ let s1, s2 = split_after ((succ len) / 2) s in
+ let hos s =
+ [ "$(tabs)" ;
+ "$(tabs) kind | | coverage |
" ] @
+ (List.map
+ (fun (k, r) ->
+ Printf.sprintf "$(tabs) %s | | %d / %d (%s %%) |
"
+ (Common.string_of_point_kind k)
+ r.ReportStat.count
+ r.ReportStat.total
+ (if r.ReportStat.total <> 0 then
+ string_of_int ((r.ReportStat.count * 100) / r.ReportStat.total)
+ else
+ "-"))
+ s) @
+ [ "$(tabs)
" ] in
+ (hos s1), (hos s2)
hunk ./src/reportHTML.ml 164
- " $(title)
" ;
+ " $(title)
" ;
+ "
" ;
hunk ./src/reportHTML.ml 168
- " Overall statistics
" ]
+ "
" ;
+ " Overall statistics
" ;
+ " " ;
+ " " ;
+ " " ]
hunk ./src/reportHTML.ml 175
+ let st1, st2 = html_of_stats stats in
+ output_strings
+ st1
+ ["tabs", " "]
+ channel;
hunk ./src/reportHTML.ml 181
- (html_of_stats stats)
- ["tabs", " "]
+ [ " | " ;
+ " " ]
+ []
hunk ./src/reportHTML.ml 186
- [ " " ;
+ st2
+ ["tabs", " "]
+ channel;
+ output_strings
+ [ " | " ;
+ "
" ;
+ "
" ;
+ "
" ;
hunk ./src/reportHTML.ml 195
+ "
" ;
hunk ./src/reportHTML.ml 199
- " Per-file coverage
" ;
+ " Per-file coverage
" ;
hunk ./src/reportHTML.ml 208
+ let gauge stats name =
+ let a, b = ReportStat.summarize stats in
+ let x = if b = 0 then 100 else (100 * a) / b in
+ let y = 100 - x in
+ output_strings
+ [ " " ;
+ " " ;
+ " " ;
+ " " ;
+ " " ;
+ " | " ;
+ " | $(p)% | " ;
+ " " ;
+ " " ;
+ " | " ;
+ " | " ;
+ " $(name) | ";
+ "
" ]
+ [ "g", (if b = 0 then "gaugeNO" else "gaugeOK");
+ "x", string_of_int x ;
+ "y", string_of_int y ;
+ "p", (if b = 0 then "-" else string_of_int x) ;
+ "name", name ]
+ channel in
hunk ./src/reportHTML.ml 234
- let a, b = ReportStat.summarize stats in
- let x = if b = 0 then 100 else (100 * a) / b in
- let y = 100 - x in
- output_strings
- [ " " ;
- " " ;
- " " ;
- " " ;
- " " ;
- " | " ;
- " | $(p)% | " ;
- " " ;
- " " ;
- " | " ;
- " | " ;
- " $(in_file) | ";
- "
" ]
- [ "x", string_of_int x ;
- "y", string_of_int y ;
- "p", (if b = 0 then "-" else string_of_int x) ;
- "out_file", out_file ;
- "in_file", in_file ]
- channel)
+ gauge stats (Printf.sprintf "%s" out_file in_file))
hunk ./src/reportHTML.ml 241
- "
" ;
hunk ./src/reportHTML.ml 269
- " " ;
+ " " ;
+ "
" ;
hunk ./src/reportHTML.ml 272
- " Statistics:
" ]
+ "
" ;
+ " " ;
+ " " ;
+ " Statistics: | " ;
+ " " ]
hunk ./src/reportHTML.ml 280
+ let st1, st2 = html_of_stats stats in
hunk ./src/reportHTML.ml 282
- (html_of_stats stats)
- [ "tabs", " " ]
+ st1
+ ["tabs", " "]
hunk ./src/reportHTML.ml 286
- [ " " ;
- " Source:" ;
+ [ " | " ;
+ " " ]
+ []
+ out_channel;
+ output_strings
+ st2
+ ["tabs", " "]
+ out_channel;
+ output_strings
+ [ " | " ;
+ "
" ;
+ "
" ;
+ "
" ;
+ "
" ;
+ "
" ;
+ " Source:
" ;
+ "
" ;
hunk ./src/reportHTML.ml 337
+ "
" ;
+ " Legend:
" ;
+ " some code - line containing no point
" ;
+ " some code - line containing only visited points
" ;
+ " some code - line containing only unvisited points
" ;
+ " some code - line containing both visited and unvisited points
" ;
+ "
" ;
hunk ./src/reportUtils.ml 60
+
+let split_after n l =
+ let rec spl n acc l =
+ match l with
+ | hd :: tl ->
+ if n > 0 then
+ spl (pred n) (hd :: acc) tl
+ else
+ (List.rev acc), l
+ | [] -> (List.rev acc), [] in
+ spl n [] l
hunk ./src/reportUtils.mli 46
+
+val split_after : int -> ('a list) -> 'a list * 'a list
+(** [split_after k [e1; ...; en]] returns [([e1; ...; ek], [e(k+1); ...; en])]. *)
hunk ./tests/report/reference 7
-
+
+
hunk ./tests/report/reference 10
- Statistics:
-
- kind | | coverage |
- binding | | 3 / 3 (100 %) |
- sequence | | 5 / 5 (100 %) |
- for | | 1 / 1 (100 %) |
- if/then | | 0 / 0 (- %) |
- try | | 0 / 0 (- %) |
- while | | 0 / 0 (- %) |
- match/function | | 2 / 2 (100 %) |
- class expression | | 0 / 0 (- %) |
- class initializer | | 0 / 0 (- %) |
- class method | | 0 / 0 (- %) |
- class value | | 0 / 0 (- %) |
- toplevel expression | | 0 / 0 (- %) |
- lazy operator | | 2 / 2 (100 %) |
+
+
+
+ Statistics: |
+
+
+ kind | | coverage |
+ binding | | 3 / 3 (100 %) |
+ sequence | | 5 / 5 (100 %) |
+ for | | 1 / 1 (100 %) |
+ if/then | | 0 / 0 (- %) |
+ try | | 0 / 0 (- %) |
+ while | | 0 / 0 (- %) |
+ match/function | | 2 / 2 (100 %) |
+
+ |
+
+
+ kind | | coverage |
+ class expression | | 0 / 0 (- %) |
+ class initializer | | 0 / 0 (- %) |
+ class method | | 0 / 0 (- %) |
+ class value | | 0 / 0 (- %) |
+ toplevel expression | | 0 / 0 (- %) |
+ lazy operator | | 2 / 2 (100 %) |
+
+ |
+
hunk ./tests/report/reference 39
+
hunk ./tests/report/reference 41
- Source:
+
+ Source:
+
hunk ./tests/report/reference 68
+
+ Legend:
+ some code - line containing no point
+ some code - line containing only visited points
+ some code - line containing only unvisited points
+ some code - line containing both visited and unvisited points
+
}