From 241b4b04fadd40d0d95109621e8eb1c09a1d033c Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Thu, 15 Dec 2016 09:01:17 -0800 Subject: [PATCH] [tests] port ck imports test to a Makefile Reviewed By: jberdine Differential Revision: D4329617 fbshipit-source-id: c0bcfd4 --- Makefile | 2 +- .../build_systems/build_integration_tests.py | 9 --------- infer/tests/build_systems/ck_imports/Makefile | 20 +++++++++++++++++++ .../tests/build_systems/ck_imports/issues.exp | 1 + .../componentkit_imports_report.json | 7 ------- 5 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 infer/tests/build_systems/ck_imports/Makefile create mode 100644 infer/tests/build_systems/ck_imports/issues.exp delete mode 100644 infer/tests/build_systems/expected_outputs/componentkit_imports_report.json diff --git a/Makefile b/Makefile index a7251dc32..d2c794d95 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ ifeq ($(IS_FACEBOOK_TREE),yes) include $(ROOT_DIR)/facebook/Makefile.env endif -BUILD_SYSTEMS_TESTS = assembly ck_analytics clang_translation linters project_root_rel +BUILD_SYSTEMS_TESTS = assembly ck_analytics ck_imports clang_translation linters project_root_rel ifneq ($(ANT),no) BUILD_SYSTEMS_TESTS += ant endif diff --git a/infer/tests/build_systems/build_integration_tests.py b/infer/tests/build_systems/build_integration_tests.py index fda7be1b9..dfc519216 100755 --- a/infer/tests/build_systems/build_integration_tests.py +++ b/infer/tests/build_systems/build_integration_tests.py @@ -61,7 +61,6 @@ CODETOANALYZE_DIR = os.path.join(SCRIPT_DIR, 'codetoanalyze') EXPECTED_OUTPUTS_DIR = os.path.join(SCRIPT_DIR, 'expected_outputs') ALL_TESTS = [ - 'componentkit_imports', 'delete', 'fail', 'gradle', @@ -474,14 +473,6 @@ class BuildIntegrationTest(unittest.TestCase): {'compile': ['analyze'], 'infer_args': ['--reactive']}]) - def test_clang_component_kit_imports(self): - test('componentkit_imports', - 'component quality analyzer skips imports', - os.path.join(CODETOANALYZE_DIR, 'componentkit'), - [{'compile': ['clang', '-x', 'objective-c++', '-std=c++11', '-c', - '-fblocks', 'TestIgnoreImports.mm'], - 'infer_args': ['--cxx', '--no-filtering', '-a', 'linters']}]) - def test_fail_on_issue(self): test('fail', '--fail-on-issue flag', CODETOANALYZE_DIR, diff --git a/infer/tests/build_systems/ck_imports/Makefile b/infer/tests/build_systems/ck_imports/Makefile new file mode 100644 index 000000000..0cbbf179c --- /dev/null +++ b/infer/tests/build_systems/ck_imports/Makefile @@ -0,0 +1,20 @@ +# Copyright (c) 2016 - present Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +TESTS_DIR = ../.. + +ANALYZER = linters + +CODETOANALYZE_DIR = ../codetoanalyze/componentkit + +CLANG_OPTIONS = -x objective-c++ -std=c++11 -c -fblocks +INFER_OPTIONS = --no-filtering --project-root $(CODETOANALYZE_DIR) +INFERPRINT_OPTIONS = --issues-tests + +SOURCES = $(CODETOANALYZE_DIR)/TestIgnoreImports.mm + +include $(TESTS_DIR)/clang.make diff --git a/infer/tests/build_systems/ck_imports/issues.exp b/infer/tests/build_systems/ck_imports/issues.exp new file mode 100644 index 000000000..a752eed47 --- /dev/null +++ b/infer/tests/build_systems/ck_imports/issues.exp @@ -0,0 +1 @@ +TestIgnoreImports.mm, SomeClass_new, 18, MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE, [] diff --git a/infer/tests/build_systems/expected_outputs/componentkit_imports_report.json b/infer/tests/build_systems/expected_outputs/componentkit_imports_report.json deleted file mode 100644 index 8222406b3..000000000 --- a/infer/tests/build_systems/expected_outputs/componentkit_imports_report.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "bug_type": "MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE", - "file": "TestIgnoreImports.mm", - "procedure": "SomeClass_new" - } -] \ No newline at end of file