Disable the creation of the harness by default

Summary: public
The harness was created all the time but we do not report issues comming from the harness right now. The option:

  infer --android-harness -- <build command>

Allows to create the harness

Reviewed By: sblackshear

Differential Revision: D2595211

fb-gh-sync-id: c7a6dc5
master
jrm 9 years ago committed by facebook-github-bot-1
parent e402764313
commit 4260c720c0

@ -108,6 +108,10 @@ base_group.add_argument('--fail-on-bug', action='store_true',
something to report'''
% BUG_FOUND_ERROR_CODE)
base_group.add_argument('--android-harness', action='store_true',
help='''[experimental] Create harness to detect bugs
involving the Android lifecycle''')
base_group.add_argument('-l', '--llvm', action='store_true',
help='''[experimental] Analyze C or C++ file using the
experimental LLVM frontend''')
@ -460,6 +464,8 @@ class Infer:
infer_cmd.append('-debug')
if self.args.analyzer == TRACING:
infer_cmd.append('-tracing')
if self.args.android_harness:
infer_cmd.append('-harness')
return run_command(
infer_cmd,

@ -141,4 +141,4 @@ let normalize_string s =
let translate_checks = ref false
(* Generate harness for Android code *)
let create_harness = true
let create_harness = ref false

@ -24,6 +24,8 @@ let arg_desc =
"-no-static_final", Arg.Unit (fun () -> JTrans.no_static_final := true), None, "no special treatment for static final fields";
"-tracing", Arg.Unit (fun () -> JConfig.translate_checks := true), None,
"Translate JVM checks";
"-harness", Arg.Unit (fun () -> JConfig.create_harness := true), None,
"Create Android lifecycle harness";
"-verbose_out", Arg.String (fun path -> JClasspath.set_verbose_out path), None,
"Set the path to the javac verbose output"
] in
@ -85,7 +87,7 @@ let do_source_file
JFrontend.compute_source_icfg
never_null_matcher linereader classes program tenv source_basename source_file in
store_icfg tenv call_graph cfg source_file;
if JConfig.create_harness then
if !JConfig.create_harness then
IList.fold_left
(fun proc_file_map pdesc ->
Procname.Map.add (Cfg.Procdesc.get_proc_name pdesc) source_file proc_file_map)
@ -161,7 +163,7 @@ let do_all_files classpath sources classes =
Procname.Map.empty in
if !JConfig.dependency_mode then
capture_libs never_null_matcher linereader program tenv;
if JConfig.create_harness then Harness.create_harness proc_file_map tenv;
if !JConfig.create_harness then Harness.create_harness proc_file_map tenv;
save_tenv classpath tenv;
JUtils.log "done @."

@ -143,7 +143,9 @@ public class InferRunner {
public static ImmutableList<String> createJavaInferHarnessCommand(
TemporaryFolder folder,
ImmutableList<String> sourceFiles) {
ImmutableList<String> args = new ImmutableList.Builder<String>().build();
ImmutableList<String> args = new ImmutableList.Builder<String>()
.add("--android-harness")
.build();
return createInferJavaCommand(folder, sourceFiles, "infer", args);
}
@ -156,7 +158,9 @@ public class InferRunner {
public static ImmutableList<String> createJavaInferAngelicHarnessCommand(
TemporaryFolder folder,
ImmutableList<String> sourceFiles) {
ImmutableList<String> args = (new ImmutableList.Builder<String>()).build();
ImmutableList<String> args = (new ImmutableList.Builder<String>())
.add("--android-harness")
.build();
return createInferJavaCommand(folder, sourceFiles, "infer", args);
}

Loading…
Cancel
Save