From a57d572bcace4c38c614b6238c830b580ed90874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezgi=20=C3=87i=C3=A7ek?= Date: Wed, 24 Feb 2021 05:47:51 -0800 Subject: [PATCH] [ConfigImpact] Enable clang analysis and add tests Reviewed By: skcho Differential Revision: D26633124 fbshipit-source-id: 3e62854e5 --- Makefile | 1 + infer/src/backend/registerCheckers.ml | 2 +- .../objc/fb-config-impact/Makefile | 18 ++++++++++++++++++ .../objc/fb-config-impact/issues.exp | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 infer/tests/codetoanalyze/objc/fb-config-impact/Makefile create mode 100644 infer/tests/codetoanalyze/objc/fb-config-impact/issues.exp diff --git a/Makefile b/Makefile index 118b17727..4329ed01c 100644 --- a/Makefile +++ b/Makefile @@ -122,6 +122,7 @@ DIRECT_TESTS += \ ifeq ($(IS_FACEBOOK_TREE),yes) DIRECT_TESTS += \ + objc_fb-config-impact \ objc_fb-gk-interaction endif diff --git a/infer/src/backend/registerCheckers.ml b/infer/src/backend/registerCheckers.ml index 58b5b7387..405d510d8 100644 --- a/infer/src/backend/registerCheckers.ml +++ b/infer/src/backend/registerCheckers.ml @@ -203,7 +203,7 @@ let all_checkers = (let checker = interprocedural Payloads.Fields.config_impact_analysis ConfigImpactAnalysis.checker in - [(checker, Java)] ) } ] + [(checker, Clang); (checker, Java)] ) } ] let get_active_checkers () = diff --git a/infer/tests/codetoanalyze/objc/fb-config-impact/Makefile b/infer/tests/codetoanalyze/objc/fb-config-impact/Makefile new file mode 100644 index 000000000..49275e8c5 --- /dev/null +++ b/infer/tests/codetoanalyze/objc/fb-config-impact/Makefile @@ -0,0 +1,18 @@ +# 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. + +TESTS_DIR = ../../.. + +CLANG_OPTIONS = -c $(OBJC_CLANG_OPTIONS) +INFER_OPTIONS = --config-impact-analysis-only -g --debug-exceptions \ + --report-force-relative-path --project-root $(TESTS_DIR) +INFERPRINT_OPTIONS = --issues-tests + +SOURCES = $(wildcard *.m) + +include $(TESTS_DIR)/clang.make +include $(TESTS_DIR)/objc.make + +infer-out/report.json: $(MAKEFILE_LIST) diff --git a/infer/tests/codetoanalyze/objc/fb-config-impact/issues.exp b/infer/tests/codetoanalyze/objc/fb-config-impact/issues.exp new file mode 100644 index 000000000..5299b8098 --- /dev/null +++ b/infer/tests/codetoanalyze/objc/fb-config-impact/issues.exp @@ -0,0 +1 @@ +../../facebook/skel/infer/tests/codetoanalyze/objc/fb-config-impact/Basic.m, qe_unchecked_bad, 4, CONFIG_IMPACT, no_bucket, ADVICE, [callee2 is called]