Summary: This diff uses config-impact-issues.exp instead of issues.exp, like in the cost checker. Reviewed By: ezgicicek Differential Revision: D26723761 fbshipit-source-id: 9c6779479master
parent
5007eddbef
commit
598cb10170
@ -0,0 +1,38 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
module F = Format
|
||||
|
||||
let pp_custom_of_config_impact_report fmt report =
|
||||
let pp_custom_of_config_impact_issue fmt (config_impact_item : Jsonbug_t.config_impact_item) =
|
||||
let open Jsonbug_t in
|
||||
F.fprintf fmt "%s, %s, {%a}@\n" config_impact_item.procedure_name config_impact_item.loc.file
|
||||
ConfigImpactAnalysis.UncheckedCallees.pp_without_location
|
||||
(ConfigImpactAnalysis.UncheckedCallees.decode config_impact_item.unchecked_callees)
|
||||
in
|
||||
List.iter ~f:(pp_custom_of_config_impact_issue fmt) report
|
||||
|
||||
|
||||
let config_impact_tests_jsonbug_compare (x : Jsonbug_t.config_impact_item)
|
||||
(y : Jsonbug_t.config_impact_item) =
|
||||
let open Jsonbug_t in
|
||||
[%compare: string * string * string]
|
||||
(x.loc.file, x.procedure_id, x.hash)
|
||||
(y.loc.file, y.procedure_id, y.hash)
|
||||
|
||||
|
||||
let write_from_json ~json_path ~out_path =
|
||||
Utils.with_file_out out_path ~f:(fun outf ->
|
||||
let config_impact_report =
|
||||
Atdgen_runtime.Util.Json.from_file Jsonbug_j.read_config_impact_report json_path
|
||||
in
|
||||
let sorted_config_impact_report =
|
||||
List.sort ~compare:config_impact_tests_jsonbug_compare config_impact_report
|
||||
in
|
||||
pp_custom_of_config_impact_report (F.formatter_of_out_channel outf)
|
||||
sorted_config_impact_report )
|
@ -0,0 +1,10 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
val write_from_json : json_path:string -> out_path:string -> unit
|
@ -1,3 +0,0 @@
|
||||
../../facebook/skel/infer/tests/codetoanalyze/objc/fb-config-impact/Basic.m, qe_unchecked_bad, 4, CONFIG_IMPACT, no_bucket, ADVICE, [callee2 is called]
|
||||
../../facebook/skel/infer/tests/codetoanalyze/objc/fb-config-impact/ClassTest.m, MyClass.call_log_bad:data:, 4, CONFIG_IMPACT, no_bucket, ADVICE, [__objc_alloc_no_fail is called]
|
||||
../../facebook/skel/infer/tests/codetoanalyze/objc/fb-config-impact/ClassTest.m, MyClass.call_log_bad:data:, 4, CONFIG_IMPACT, no_bucket, ADVICE, [NSKeyedUnarchiver.initForReadingFromData:error: is called]
|
@ -0,0 +1,27 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# We add issues.exp.test to recipe in order to avoid "infer report"s run parallel
|
||||
config-impact-issues.exp.test: $(INFER_OUT)/report.json $(INFER_BIN) issues.exp.test
|
||||
$(QUIET)$(INFER_BIN) report -q --results-dir $(<D) --config-impact-issues-tests $@
|
||||
|
||||
test: config-impact-test
|
||||
|
||||
.PHONY: config-impact-test
|
||||
config-impact-test: config-impact-issues.exp.test
|
||||
$(QUIET)cd $(TESTS_DIR) && \
|
||||
$(call check_no_diff,$(TEST_REL_DIR)/config-impact-issues.exp,$(TEST_REL_DIR)/config-impact-issues.exp.test)
|
||||
|
||||
replace: config-impact-replace
|
||||
|
||||
.PHONY: config-impact-replace
|
||||
config-impact-replace: config-impact-issues.exp.test
|
||||
cp $< config-impact-issues.exp
|
||||
|
||||
clean: config-impact-clean
|
||||
|
||||
.PHONY: config-impact-clean
|
||||
config-impact-clean:
|
||||
$(REMOVE) config-impact-issues.exp.test
|
Loading…
Reference in new issue