[tests] convert unknown ext test to Makefile

Reviewed By: jberdine

Differential Revision: D4329657

fbshipit-source-id: 00df93a
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent c40dfc950e
commit 4c34509f6d

@ -14,8 +14,9 @@ ifeq ($(IS_FACEBOOK_TREE),yes)
endif
BUILD_SYSTEMS_TESTS = \
assembly ck_analytics ck_imports clang_multiple_files clang_translation delete_results_dir \
fail_on_issue gradle javac linters make project_root_rel reactive utf8_in_procname
assembly ck_analytics ck_imports clang_multiple_files clang_translation clang_unknown_ext \
delete_results_dir fail_on_issue gradle javac linters make project_root_rel reactive \
utf8_in_procname
ifneq ($(ANT),no)
BUILD_SYSTEMS_TESTS += ant
endif

@ -61,7 +61,6 @@ CODETOANALYZE_DIR = os.path.join(SCRIPT_DIR, 'codetoanalyze')
EXPECTED_OUTPUTS_DIR = os.path.join(SCRIPT_DIR, 'expected_outputs')
ALL_TESTS = [
'unknown_ext',
'utf8_in_pwd',
'waf',
]
@ -408,11 +407,6 @@ class BuildIntegrationTest(unittest.TestCase):
report_fname='utf8_in_pwd_make_report.json')
shutil.rmtree(utf8_in_pwd_path, True) # remove copied dir
def test_unknown_extension(self):
test('unknown_ext', 'unknown extension',
CODETOANALYZE_DIR,
[{'compile': ['clang', '-x', 'c', '-c', 'hello.unknown_ext']}])
if __name__ == '__main__':
# hackish capturing of the arguments after '--'

@ -0,0 +1,21 @@
# 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 = infer
CLANG_OPTIONS = -x c -c
INFER_OPTIONS = --project-root ../codetoanalyze
INFERPRINT_OPTIONS = --issues-tests
SOURCES = ../codetoanalyze/hello.unknown_ext
include $(TESTS_DIR)/clang.make
../codetoanalyze/hello.o: ../codetoanalyze/hello.unknown_ext
clang $(CLANG_OPTIONS) $< > $@

@ -0,0 +1 @@
hello.unknown_ext, test, 2, NULL_DEREFERENCE, [start of procedure test()]

@ -1,7 +0,0 @@
[
{
"bug_type": "NULL_DEREFERENCE",
"file": "hello.unknown_ext",
"procedure": "test"
}
]
Loading…
Cancel
Save