[config] sensible default for --from-json-report

Summary:
Make <infer-out>/report.json the default value for this option, as this
is what is used 99% of the time. Clean up test options using this.

Reviewed By: ngorogiannis

Differential Revision: D20362644

fbshipit-source-id: a1bb18757
master
Jules Villard 5 years ago committed by Facebook GitHub Bot
parent c27e4c72a4
commit 339ebe74ec

@ -655,16 +655,16 @@ OPTIONS
particular path, with the format path:version (can be specified particular path, with the format path:version (can be specified
multiple times) See also infer-capture(1). multiple times) See also infer-capture(1).
--issues-fields ,-separated sequence of { bug_type | bucket | --issues-tests file
Write a list of issues in a format suitable for tests to file
See also infer-report(1).
--issues-tests-fields ,-separated sequence of { bug_type | bucket |
qualifier | severity | line | column | procedure | qualifier | severity | line | column | procedure |
procedure_start_line | file | bug_trace | key | hash | line_offset | procedure_start_line | file | bug_trace | key | hash | line_offset |
qualifier_contains_potential_exception_note } qualifier_contains_potential_exception_note }
Fields to emit with --issues-tests See also infer-report(1). Fields to emit with --issues-tests See also infer-report(1).
--issues-tests file
Write a list of issues in a format suitable for tests to file
See also infer-report(1).
--java-jar-compiler path --java-jar-compiler path
Specify the Java compiler jar used to generate the bytecode Specify the Java compiler jar used to generate the bytecode
See also infer-capture(1). See also infer-capture(1).

@ -274,15 +274,15 @@ OPTIONS
Show this manual with all internal options in the INTERNAL OPTIONS Show this manual with all internal options in the INTERNAL OPTIONS
section section
--issues-fields ,-separated sequence of { bug_type | bucket | --issues-tests file
Write a list of issues in a format suitable for tests to file
--issues-tests-fields ,-separated sequence of { bug_type | bucket |
qualifier | severity | line | column | procedure | qualifier | severity | line | column | procedure |
procedure_start_line | file | bug_trace | key | hash | line_offset | procedure_start_line | file | bug_trace | key | hash | line_offset |
qualifier_contains_potential_exception_note } qualifier_contains_potential_exception_note }
Fields to emit with --issues-tests Fields to emit with --issues-tests
--issues-tests file
Write a list of issues in a format suitable for tests to file
--print-logs --print-logs
Activates: Also log messages to stdout and stderr (Conversely: Activates: Also log messages to stdout and stderr (Conversely:
--no-print-logs) --no-print-logs)

@ -655,16 +655,16 @@ OPTIONS
particular path, with the format path:version (can be specified particular path, with the format path:version (can be specified
multiple times) See also infer-capture(1). multiple times) See also infer-capture(1).
--issues-fields ,-separated sequence of { bug_type | bucket | --issues-tests file
Write a list of issues in a format suitable for tests to file
See also infer-report(1).
--issues-tests-fields ,-separated sequence of { bug_type | bucket |
qualifier | severity | line | column | procedure | qualifier | severity | line | column | procedure |
procedure_start_line | file | bug_trace | key | hash | line_offset | procedure_start_line | file | bug_trace | key | hash | line_offset |
qualifier_contains_potential_exception_note } qualifier_contains_potential_exception_note }
Fields to emit with --issues-tests See also infer-report(1). Fields to emit with --issues-tests See also infer-report(1).
--issues-tests file
Write a list of issues in a format suitable for tests to file
See also infer-report(1).
--java-jar-compiler path --java-jar-compiler path
Specify the Java compiler jar used to generate the bytecode Specify the Java compiler jar used to generate the bytecode
See also infer-capture(1). See also infer-capture(1).

@ -444,7 +444,7 @@ let pp_json_report_by_report_kind formats_by_report_kind fname =
match format_kind with match format_kind with
| Tests -> | Tests ->
let outf = get_outfile outfile_opt in let outf = get_outfile outfile_opt in
pp_custom_of_report outf.fmt report Config.issues_fields pp_custom_of_report outf.fmt report Config.issues_tests_fields
| Json -> | Json ->
L.die InternalError "Printing issues from json does not support json output" L.die InternalError "Printing issues from json does not support json output"
in in
@ -578,9 +578,9 @@ let main ~report_json =
costs_report_format_kind @ [(Issues, issue_formats); (Summary, [])] costs_report_format_kind @ [(Issues, issue_formats); (Summary, [])]
in in
init_files formats_by_report_kind ; init_files formats_by_report_kind ;
( match Config.from_json_report with ( match Config.issues_tests with
| Some fname -> | Some _ ->
pp_json_report_by_report_kind formats_by_report_kind fname pp_json_report_by_report_kind formats_by_report_kind Config.from_json_report
| None -> | None ->
pp_summary_and_issues formats_by_report_kind issue_formats ) ; pp_summary_and_issues formats_by_report_kind issue_formats ) ;
if Config.test_determinator && Config.process_clang_ast then if Config.test_determinator && Config.process_clang_ast then

@ -30,7 +30,7 @@ let ml_bucket_symbols =
; ("unknown_origin", `MLeak_unknown) ] ; ("unknown_origin", `MLeak_unknown) ]
let issues_fields_symbols = let issues_tests_fields_symbols =
[ ("bug_type", `Issue_field_bug_type) [ ("bug_type", `Issue_field_bug_type)
; ("bucket", `Issue_field_bucket) ; ("bucket", `Issue_field_bucket)
; ("qualifier", `Issue_field_qualifier) ; ("qualifier", `Issue_field_qualifier)
@ -1434,8 +1434,8 @@ and iphoneos_target_sdk_version_path_regex =
format path:version (can be specified multiple times)" format path:version (can be specified multiple times)"
and issues_fields = and issues_tests_fields =
CLOpt.mk_symbol_seq ~long:"issues-fields" CLOpt.mk_symbol_seq ~long:"issues-tests-fields"
~in_help:InferCommand.[(Report, manual_generic)] ~in_help:InferCommand.[(Report, manual_generic)]
~default: ~default:
[ `Issue_field_file [ `Issue_field_file
@ -1445,7 +1445,7 @@ and issues_fields =
; `Issue_field_bucket ; `Issue_field_bucket
; `Issue_field_severity ; `Issue_field_severity
; `Issue_field_bug_trace ] ; `Issue_field_bug_trace ]
~symbols:issues_fields_symbols ~eq:PolyVariantEqual.( = ) ~symbols:issues_tests_fields_symbols ~eq:PolyVariantEqual.( = )
"Fields to emit with $(b,--issues-tests)" "Fields to emit with $(b,--issues-tests)"
@ -2757,7 +2757,7 @@ and force_delete_results_dir = !force_delete_results_dir
and force_integration = !force_integration and force_integration = !force_integration
and from_json_report = !from_json_report and from_json_report = Option.value !from_json_report ~default:(!results_dir ^/ report_json)
and frontend_stats = !frontend_stats and frontend_stats = !frontend_stats
@ -2783,10 +2783,10 @@ and iphoneos_target_sdk_version_path_regex =
process_iphoneos_target_sdk_version_path_regex !iphoneos_target_sdk_version_path_regex process_iphoneos_target_sdk_version_path_regex !iphoneos_target_sdk_version_path_regex
and issues_fields = !issues_fields
and issues_tests = !issues_tests and issues_tests = !issues_tests
and issues_tests_fields = !issues_tests_fields
and iterations = !iterations and iterations = !iterations
and java_jar_compiler = !java_jar_compiler and java_jar_compiler = !java_jar_compiler

@ -349,7 +349,7 @@ val force_delete_results_dir : bool
val force_integration : build_system option val force_integration : build_system option
val from_json_report : string option val from_json_report : string
val frontend_stats : bool val frontend_stats : bool
@ -385,7 +385,9 @@ val iphoneos_target_sdk_version_path_regex : iphoneos_target_sdk_version_path_re
val is_checker_enabled : Checker.t -> bool val is_checker_enabled : Checker.t -> bool
val issues_fields : val issues_tests : string option
val issues_tests_fields :
[ `Issue_field_bug_type [ `Issue_field_bug_type
| `Issue_field_qualifier | `Issue_field_qualifier
| `Issue_field_severity | `Issue_field_severity
@ -402,8 +404,6 @@ val issues_fields :
| `Issue_field_qualifier_contains_potential_exception_note ] | `Issue_field_qualifier_contains_potential_exception_note ]
list list
val issues_tests : string option
val iterations : int val iterations : int
val java_jar_compiler : string option val java_jar_compiler : string option

@ -28,12 +28,10 @@ replace_reports: current.exp.test previous.exp.test
current.exp.test: $(CURRENT_REPORT) current.exp.test: $(CURRENT_REPORT)
$(QUIET)$(INFER_BIN) report -o $(<D) \ $(QUIET)$(INFER_BIN) report -o $(<D) \
--from-json-report $(CURRENT_DIR)/report.json \
--issues-tests current.exp.test --issues-tests current.exp.test
previous.exp.test: $(PREVIOUS_REPORT) previous.exp.test: $(PREVIOUS_REPORT)
$(QUIET)$(INFER_BIN) report -o $(<D) \ $(QUIET)$(INFER_BIN) report -o $(<D) \
--from-json-report $(PREVIOUS_DIR)/report.json \
--issues-tests previous.exp.test --issues-tests previous.exp.test
test: compare_reports test: compare_reports

@ -43,9 +43,9 @@ infer-out-reactive-capture/report.json: $(CMAKE_BUILD_DIR)/compile_commands.json
issues.exp.test: infer-out-with-index/report.json infer-out-no-index/report.json infer-out-reactive-capture/report.json issues.exp.test: infer-out-with-index/report.json infer-out-no-index/report.json infer-out-reactive-capture/report.json
$(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.with-index \ $(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.with-index \
-o infer-out-with-index --from-json-report infer-out-with-index/report.json -o infer-out-with-index
$(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.no-index \ $(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.no-index \
-o infer-out-no-index --from-json-report infer-out-no-index/report.json -o infer-out-no-index
$(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.reactive-capture \ $(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.reactive-capture \
-o infer-out-reactive-capture --from-json-report infer-out-reactive-capture/report.json -o infer-out-reactive-capture
$(QUIET)cat $@.with-index $@.no-index $@.reactive-capture > $@ $(QUIET)cat $@.with-index $@.no-index $@.reactive-capture > $@

@ -34,14 +34,12 @@ $(MODIFIED_FILES_FILE):
current.exp.test: $(CURRENT_REPORT) current.exp.test: $(CURRENT_REPORT)
$(QUIET)$(INFER_BIN) report -o $(<D) \ $(QUIET)$(INFER_BIN) report -o $(<D) \
--issues-fields $(INFERPRINT_ISSUES_FIELDS) \ --issues-tests-fields $(INFERPRINT_ISSUES_FIELDS) \
--from-json-report $(CURRENT_DIR)/report.json \
--issues-tests current.exp.test --issues-tests current.exp.test
previous.exp.test: $(PREVIOUS_REPORT) previous.exp.test: $(PREVIOUS_REPORT)
$(QUIET)$(INFER_BIN) report -o $(<D) \ $(QUIET)$(INFER_BIN) report -o $(<D) \
--issues-fields $(INFERPRINT_ISSUES_FIELDS) \ --issues-tests-fields $(INFERPRINT_ISSUES_FIELDS) \
--from-json-report $(PREVIOUS_DIR)/report.json \
--issues-tests previous.exp.test --issues-tests previous.exp.test
test: compare_reports test: compare_reports

@ -36,8 +36,7 @@ infer-out-simple_app/report.json: infer-out-app_with_infer_profile/report.json
infer-out-app_with_infer_profile/report.json: infer-out-app_with_profiles/report.json infer-out-app_with_infer_profile/report.json: infer-out-app_with_profiles/report.json
issues-%.exp.test: infer-out-%/report.json issues-%.exp.test: infer-out-%/report.json
$(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@ \ $(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@ -o $(<D)
-o $(<D) --from-json-report $<
issues.exp.test: $(foreach mvndir,$(MVN_DIRS),issues-$(mvndir).exp.test) issues.exp.test: $(foreach mvndir,$(MVN_DIRS),issues-$(mvndir).exp.test)
# erase the contents of the file # erase the contents of the file

@ -21,8 +21,7 @@ $(REPORT): $(JAVA_DEPS) $(MAKEFILE_LIST) SimpleLeak.java
$(EXPECTED_TEST_OUTPUT): $(REPORT) $(EXPECTED_TEST_OUTPUT): $(REPORT)
$(QUIET)$(INFER_BIN) report -o $(<D) \ $(QUIET)$(INFER_BIN) report -o $(<D) \
--issues-fields "qualifier_contains_potential_exception_note,bug_type,bucket,file,procedure,line_offset" \ --issues-tests-fields "qualifier_contains_potential_exception_note,bug_type,bucket,file,procedure,line_offset" \
--from-json-report $(REPORT) \
--issues-tests $(EXPECTED_TEST_OUTPUT) --issues-tests $(EXPECTED_TEST_OUTPUT)
.PHONY: print .PHONY: print

@ -95,8 +95,7 @@ infer-out-make/report.json: $(CLANG_DEPS) $(MAKE_DIR)
$(TESTLOCK) sh -c "$(MAKE) clean && $(INFER_BIN) --results-dir $(CURDIR)/$(@D) -- $(MAKE) all") $(TESTLOCK) sh -c "$(MAKE) clean && $(INFER_BIN) --results-dir $(CURDIR)/$(@D) -- $(MAKE) all")
issues-%.exp.test: infer-out-%/report.json $(INFER_BIN) issues-%.exp.test: infer-out-%/report.json $(INFER_BIN)
$(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@ \ $(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@ -o $(<D)
-o $(<D) --from-json-report $<
issues.exp.test: issues-cmake.exp.test issues-gradle.exp.test issues-javac.exp.test \ issues.exp.test: issues-cmake.exp.test issues-gradle.exp.test issues-javac.exp.test \
issues-make.exp.test issues-make.exp.test

@ -12,7 +12,7 @@ INFER_OPTIONS = \
# we need to disable traces in C tests because assertions/assertion_failure.c has different traces # we need to disable traces in C tests because assertions/assertion_failure.c has different traces
# on Linux and OSX because of different implementations of assert() on each platform # on Linux and OSX because of different implementations of assert() on each platform
INFERPRINT_OPTIONS = --issues-fields "file,procedure,line_offset,bug_type,bucket" --issues-tests INFERPRINT_OPTIONS = --issues-tests-fields "file,procedure,line_offset,bug_type,bucket" --issues-tests
SOURCES = \ SOURCES = \
$(wildcard */*.c) \ $(wildcard */*.c) \

@ -36,7 +36,7 @@ PROJECT_ROOT ?= $(TESTS_DIR)
issues.exp.test$(TEST_SUFFIX): $(INFER_OUT)/report.json $(INFER_BIN) issues.exp.test$(TEST_SUFFIX): $(INFER_OUT)/report.json $(INFER_BIN)
$(QUIET)$(INFER_BIN) report -q --results-dir $(<D) \ $(QUIET)$(INFER_BIN) report -q --results-dir $(<D) \
$(INFERPRINT_OPTIONS) $@ --from-json-report $< $(INFERPRINT_OPTIONS) $@
infer-out/report.json: $(JAVA_DEPS) $(SOURCES) $(MAKEFILE_LIST) infer-out/report.json: $(JAVA_DEPS) $(SOURCES) $(MAKEFILE_LIST)
$(QUIET)$(call silent_on_success,Testing infer/java in $(TEST_REL_DIR),\ $(QUIET)$(call silent_on_success,Testing infer/java in $(TEST_REL_DIR),\

@ -141,10 +141,10 @@ infer-out/report.json: $(CLANG_DEPS) $(SOURCES_DEFAULT)
issues.exp.test: infer-out-all/report.json infer-out-arc/report.json infer-out/report.json issues.exp.test: infer-out-all/report.json infer-out-arc/report.json infer-out/report.json
$(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.all \ $(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.all \
-o infer-out-all --from-json-report infer-out-all/report.json -o infer-out-all
$(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.arc \ $(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.arc \
-o infer-out-arc --from-json-report infer-out-arc/report.json -o infer-out-arc
$(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.default \ $(QUIET)$(INFER_BIN) report -q $(INFERPRINT_OPTIONS) $@.default \
-o infer-out --from-json-report infer-out/report.json -o infer-out
$(QUIET)cat $@.all $@.arc $@.default > $@ $(QUIET)cat $@.all $@.arc $@.default > $@
$(QUIET)cat infer-out-all/duplicates.txt infer-out-arc/duplicates.txt >> infer-out/duplicates.txt $(QUIET)cat infer-out-all/duplicates.txt infer-out-arc/duplicates.txt >> infer-out/duplicates.txt

@ -40,15 +40,15 @@ $(EXPECTED_TEST_OUTPUT): $(CURRENT_REPORT) $(PREVIOUS_REPORT) $(MODIFIED_FILES_F
--costs-current $(CURRENT_COSTS) --costs-previous $(PREVIOUS_COSTS) \ --costs-current $(CURRENT_COSTS) --costs-previous $(PREVIOUS_COSTS) \
$(DIFFERENTIAL_ARGS)) $(DIFFERENTIAL_ARGS))
$(QUIET)$(INFER_BIN) report -o $(INFER_OUT) \ $(QUIET)$(INFER_BIN) report -o $(INFER_OUT) \
--issues-fields $(INFERPRINT_ISSUES_FIELDS) \ --issues-tests-fields $(INFERPRINT_ISSUES_FIELDS) \
--from-json-report $(INFER_OUT)/differential/introduced.json \ --from-json-report $(INFER_OUT)/differential/introduced.json \
--issues-tests introduced.exp.test --issues-tests introduced.exp.test
$(QUIET)$(INFER_BIN) report -o $(INFER_OUT) \ $(QUIET)$(INFER_BIN) report -o $(INFER_OUT) \
--issues-fields $(INFERPRINT_ISSUES_FIELDS) \ --issues-tests-fields $(INFERPRINT_ISSUES_FIELDS) \
--from-json-report $(INFER_OUT)/differential/fixed.json \ --from-json-report $(INFER_OUT)/differential/fixed.json \
--issues-tests fixed.exp.test --issues-tests fixed.exp.test
$(QUIET)$(INFER_BIN) report -o $(INFER_OUT) \ $(QUIET)$(INFER_BIN) report -o $(INFER_OUT) \
--issues-fields $(INFERPRINT_ISSUES_FIELDS) \ --issues-tests-fields $(INFERPRINT_ISSUES_FIELDS) \
--from-json-report $(INFER_OUT)/differential/preexisting.json \ --from-json-report $(INFER_OUT)/differential/preexisting.json \
--issues-tests preexisting.exp.test --issues-tests preexisting.exp.test
$(QUIET)$(COPY) $(INFER_OUT)/differential/costs_summary.json \ $(QUIET)$(COPY) $(INFER_OUT)/differential/costs_summary.json \

@ -11,7 +11,7 @@ default: compile
issues.exp.test$(TEST_SUFFIX): $(INFER_OUT)/report.json $(INFER_BIN) issues.exp.test$(TEST_SUFFIX): $(INFER_OUT)/report.json $(INFER_BIN)
$(QUIET)$(INFER_BIN) report -q --results-dir $(<D) \ $(QUIET)$(INFER_BIN) report -q --results-dir $(<D) \
$(INFERPRINT_OPTIONS) $@ --from-json-report $< $(INFERPRINT_OPTIONS) $@
.PHONY: compile .PHONY: compile
compile: $(OBJECTS) compile: $(OBJECTS)

Loading…
Cancel
Save