From 1c87f617281d69cc1e75bf6d0acc04754454b441 Mon Sep 17 00:00:00 2001 From: Sungkeun Cho Date: Fri, 7 May 2021 04:16:51 -0700 Subject: [PATCH] [ConfigImpact] Add config impact differential test in ObjC Reviewed By: ezgicicek Differential Revision: D28256508 fbshipit-source-id: e18cc400f --- .gitignore | 1 + Makefile | 3 ++ .../Makefile | 31 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 infer/tests/build_systems/fb_differential_of_config_impact_report_objc/Makefile diff --git a/.gitignore b/.gitignore index 0c29ae1dc..6d7072a53 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ duplicates.txt /infer/tests/build_systems/differential_*/**/Diff*.java /infer/tests/build_systems/differential_*/**/Diff*.m /infer/tests/build_systems/fb_differential_*/**/Diff*.java +/infer/tests/build_systems/fb_differential_*/**/Diff*.m /infer/tests/build_systems/incremental_analysis_remove_file/src /infer/tests/build_systems/incremental_analysis_cost_change/src /infer/tests/build_systems/incremental_analysis_add_procedure/src diff --git a/Makefile b/Makefile index 32bf7ebad..f0522fd97 100644 --- a/Makefile +++ b/Makefile @@ -130,6 +130,9 @@ DIRECT_TESTS += \ objcpp_retain-cycles \ ifeq ($(IS_FACEBOOK_TREE),yes) +BUILD_SYSTEMS_TESTS += \ + fb_differential_of_config_impact_report_objc + DIRECT_TESTS += \ objc_fb-config-impact \ objc_fb-gk-interaction diff --git a/infer/tests/build_systems/fb_differential_of_config_impact_report_objc/Makefile b/infer/tests/build_systems/fb_differential_of_config_impact_report_objc/Makefile new file mode 100644 index 000000000..efc348b40 --- /dev/null +++ b/infer/tests/build_systems/fb_differential_of_config_impact_report_objc/Makefile @@ -0,0 +1,31 @@ +# 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 = ../.. +SOURCES = src/DiffExample.current.m src/DiffExample.previous.m +COPIED = src/DiffExample.m +CLEAN_EXTRA = $(COPIED) *.o +CLANG_OPTIONS = -c $(OBJC_CLANG_OPTIONS) +DIFFERENTIAL_ARGS = --enable-issue-type CONFIG_IMPACT +INFERPRINT_ISSUES_FIELDS = "bug_type,bucket,file,procedure,line_offset,bug_trace" + +include $(TESTS_DIR)/differential-config-impact.make +include $(TESTS_DIR)/objc.make + +$(CURRENT_REPORT) $(PREVIOUS_REPORT): $(OBJC_DEPS) + +$(CURRENT_REPORT): + $(QUIET)$(COPY) src/DiffExample.current.m src/DiffExample.m + $(QUIET)$(call silent_on_success,Testing ObjC Config Impact Differential: current,\ + $(INFER_BIN) --no-filtering --config-impact-analysis-only \ + --config-impact-data-file config_data.json -o $(CURRENT_DIR) \ + -- clang $(CLANG_OPTIONS) $(COPIED)) + +$(PREVIOUS_REPORT): + $(QUIET)$(COPY) src/DiffExample.previous.m src/DiffExample.m + $(QUIET)$(call silent_on_success,Testing ObjC Config Impact Differential: previous,\ + $(INFER_BIN) --no-filtering --config-impact-analysis-only \ + --config-impact-data-file config_data.json -o $(PREVIOUS_DIR) \ + -- clang $(CLANG_OPTIONS) $(COPIED))