[tests] port ck analytics test to a Makefile

Reviewed By: jberdine

Differential Revision: D4329611

fbshipit-source-id: aea5792
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent eafe1158a6
commit 6c056f535a

@ -13,7 +13,7 @@ ifeq ($(IS_FACEBOOK_TREE),yes)
include $(ROOT_DIR)/facebook/Makefile.env include $(ROOT_DIR)/facebook/Makefile.env
endif endif
BUILD_SYSTEMS_TESTS = assembly clang_translation linters project_root_rel BUILD_SYSTEMS_TESTS = assembly ck_analytics clang_translation linters project_root_rel
ifneq ($(ANT),no) ifneq ($(ANT),no)
BUILD_SYSTEMS_TESTS += ant BUILD_SYSTEMS_TESTS += ant
endif endif

@ -61,7 +61,6 @@ CODETOANALYZE_DIR = os.path.join(SCRIPT_DIR, 'codetoanalyze')
EXPECTED_OUTPUTS_DIR = os.path.join(SCRIPT_DIR, 'expected_outputs') EXPECTED_OUTPUTS_DIR = os.path.join(SCRIPT_DIR, 'expected_outputs')
ALL_TESTS = [ ALL_TESTS = [
'componentkit_analytics',
'componentkit_imports', 'componentkit_imports',
'delete', 'delete',
'fail', 'fail',
@ -475,16 +474,6 @@ class BuildIntegrationTest(unittest.TestCase):
{'compile': ['analyze'], {'compile': ['analyze'],
'infer_args': ['--reactive']}]) 'infer_args': ['--reactive']}])
def test_clang_component_kit_analytics(self):
test('componentkit_analytics',
'component quality analyzer emits analytics info when flag is '
'enabled',
os.path.join(CODETOANALYZE_DIR, 'componentkit'),
[{'compile': ['clang', '-x', 'objective-c++', '-std=c++11', '-c',
'-fblocks', 'TestComponentKitAnalytics.mm'],
'infer_args': ['--cxx', '--no-filtering', '-a', 'linters',
'--compute-analytics']}])
def test_clang_component_kit_imports(self): def test_clang_component_kit_imports(self):
test('componentkit_imports', test('componentkit_imports',
'component quality analyzer skips imports', 'component quality analyzer skips imports',

@ -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 --compute-analytics --project-root $(CODETOANALYZE_DIR)
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(CODETOANALYZE_DIR)/TestComponentKitAnalytics.mm
include $(TESTS_DIR)/clang.make

@ -0,0 +1,27 @@
TestComponentKitAnalytics.mm, Linters_dummy_method, -1, COMPONENT_FILE_CYCLOMATIC_COMPLEXITY, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 1, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 2, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 3, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 4, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 5, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 6, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 7, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 8, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 9, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 10, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 11, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 12, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 13, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 14, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 15, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 16, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 17, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 18, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 19, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 20, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 21, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 22, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 23, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, Linters_dummy_method, 24, COMPONENT_FILE_LINE_COUNT, []
TestComponentKitAnalytics.mm, SomeClass_new, 16, COMPONENT_FILE_CYCLOMATIC_COMPLEXITY, []
TestComponentKitAnalytics.mm, SomeClass_new, 18, COMPONENT_FILE_CYCLOMATIC_COMPLEXITY, []

@ -1,137 +0,0 @@
[
{
"bug_type": "COMPONENT_FILE_CYCLOMATIC_COMPLEXITY",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_CYCLOMATIC_COMPLEXITY",
"file": "TestComponentKitAnalytics.mm",
"procedure": "SomeClass_new"
},
{
"bug_type": "COMPONENT_FILE_CYCLOMATIC_COMPLEXITY",
"file": "TestComponentKitAnalytics.mm",
"procedure": "SomeClass_new"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
},
{
"bug_type": "COMPONENT_FILE_LINE_COUNT",
"file": "TestComponentKitAnalytics.mm",
"procedure": "Linters_dummy_method"
}
]
Loading…
Cancel
Save