Add --write-html-regex-whitelist option that prints out debugging html only for selected source files

Summary: This is useful when we only want to examine the html for some but not all source files.

Reviewed By: jvillard

Differential Revision: D5334786

fbshipit-source-id: 774c23c
master
Jia Chen 8 years ago committed by Facebook Github Bot
parent aef8e296b6
commit b5b9c28a02

@ -582,6 +582,18 @@ let write_all_html_files cluster =
let load_proc_desc pname = ignore (Exe_env.get_proc_desc exe_env pname) in
let () = List.iter ~f:load_proc_desc (Cg.get_defined_nodes (Exe_env.get_cg exe_env)) in
let opt_whitelist_regex = match Config.write_html_whitelist_regex with
| [] -> None
| _ as reg_list ->
Some (Str.regexp (String.concat ~sep:"\\|" reg_list))
in
let is_whitelisted file =
Option.value_map opt_whitelist_regex ~default:true ~f:(fun regex ->
let fname = SourceFile.to_rel_path file in
Str.string_match regex fname 0
)
in
let linereader = LineReader.create () in
Exe_env.iter_files
(fun _ cfg ->
@ -592,7 +604,9 @@ let write_all_html_files cluster =
if Procdesc.is_defined proc_desc
then
let file = (Procdesc.get_loc proc_desc).Location.file in
files := SourceFile.Set.add file !files);
if is_whitelisted file then
files := SourceFile.Set.add file !files
else ());
!files in
SourceFile.Set.iter
(fun file ->

@ -805,6 +805,7 @@ and (
stats,
trace_error,
write_html,
write_html_whitelist_regex,
write_dotty
) =
let all_generic_manuals =
@ -872,6 +873,10 @@ and (
CLOpt.mk_bool ~long:"write-html"
"Produce hmtl debug output in the results directory"
and write_html_whitelist_regex =
CLOpt.mk_string_list ~long:"write-html-whitelist-regex"
"whitelist files that will have its html debug output printed"
and write_dotty =
CLOpt.mk_bool ~long:"write-dotty"
"Produce dotty files for specs in the results directory"
@ -965,6 +970,7 @@ and (
stats,
trace_error,
write_html,
write_html_whitelist_regex,
write_dotty
)
@ -2021,6 +2027,7 @@ and whole_seconds = !whole_seconds
and worklist_mode = !worklist_mode
and write_dotty = !write_dotty
and write_html = !write_html
and write_html_whitelist_regex = !write_html_whitelist_regex
and xcode_developer_dir = !xcode_developer_dir
and xcpretty = !xcpretty
and xml_specs = !xml_specs

@ -362,6 +362,7 @@ val whole_seconds : bool
val worklist_mode : int
val write_dotty : bool
val write_html : bool
val write_html_whitelist_regex : string list
val xcode_developer_dir : string option
val xcpretty : bool
val xml_specs : bool

Loading…
Cancel
Save