[toplevel] small changes in the stdout output

Summary:
After:
```
$ infer run -- clang -c examples/hello.c
Capturing in make/cc mode...
Found 1 source file to analyze in /home/jul/infer/infer-out
Starting analysis...

legend:
  "F" analyzing a file
  "." analyzing a procedure

F.

Found 1 issue

examples/hello.c:14: error: NULL_DEREFERENCE
  pointer `s` last assigned on line 13 could be null and is dereferenced at line 14, column 3
  12.   void test() {
  13.     int* s = NULL;
  14. >   *s = 42;
  15.   }

Summary of the reports

  NULL_DEREFERENCE: 1
```

Before, legend and analysis run were separated by 2 lines, one is now before
and the other is in the log files only:
```
Capturing in make/cc mode...
Starting analysis...

legend:
  "F" analyzing a file
  "." analyzing a procedure

Found 1 (out of 1) source files to be analyzed in /home/jul/infer/infer-out
per-procedure parallelism jobs:4
F.

Found 1 issue

examples/hello.c:14: error: NULL_DEREFERENCE
  pointer `s` last assigned on line 13 could be null and is dereferenced at line 14, column 3
  12.   void test() {
  13.     int* s = NULL;
  14. >   *s = 42;
  15.   }

Summary of the reports

  NULL_DEREFERENCE: 1
```

Reviewed By: mbouaziz

Differential Revision: D5069590

fbshipit-source-id: 8843422
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent 523cd84e92
commit 9c3e92d9fd

@ -136,7 +136,6 @@ let main makefile => {
switch Config.cluster_cmdline { switch Config.cluster_cmdline {
| Some fname => process_cluster_cmdline fname | Some fname => process_cluster_cmdline fname
| None => | None =>
print_stdout_legend ();
if Config.allow_specs_cleanup { if Config.allow_specs_cleanup {
DB.Results_dir.clean_specs_dir () DB.Results_dir.clean_specs_dir ()
}; };
@ -145,19 +144,34 @@ let main makefile => {
}; };
let all_clusters = DB.find_source_dirs (); let all_clusters = DB.find_source_dirs ();
let clusters_to_analyze = List.filter f::cluster_should_be_analyzed all_clusters; let clusters_to_analyze = List.filter f::cluster_should_be_analyzed all_clusters;
let n_clusters_to_analyze = List.length clusters_to_analyze;
L.stdout L.stdout
"Found %d (out of %d) source files to be analyzed in %s@." "Found %d%s source file%s to analyze in %s@."
(List.length clusters_to_analyze) n_clusters_to_analyze
(List.length all_clusters) (
if (Config.reactive_mode || Option.is_some Ondemand.dirs_to_analyze) {
" (out of " ^ string_of_int (List.length all_clusters) ^ ")"
} else {
""
}
)
(
if (Int.equal n_clusters_to_analyze 1) {
""
} else {
"s"
}
)
Config.results_dir; Config.results_dir;
let is_java () => let is_java () =>
List.exists List.exists
f::(fun cl => DB.string_crc_has_extension ext::"java" (DB.source_dir_to_string cl)) f::(fun cl => DB.string_crc_has_extension ext::"java" (DB.source_dir_to_string cl))
all_clusters; all_clusters;
print_stdout_legend ();
if (Config.per_procedure_parallelism && not (is_java ())) { if (Config.per_procedure_parallelism && not (is_java ())) {
/* Java uses ZipLib which is incompatible with forking */ /* Java uses ZipLib which is incompatible with forking */
/* per-procedure parallelism */ /* per-procedure parallelism */
L.stdout "per-procedure parallelism jobs:%d@." Config.jobs; L.out "Per-procedure parallelism jobs: %d@." Config.jobs;
if (makefile != "") { if (makefile != "") {
ClusterMakefile.create_cluster_makefile [] makefile ClusterMakefile.create_cluster_makefile [] makefile
}; };

Loading…
Cancel
Save