diff --git a/Makefile b/Makefile index 2c48920b8..ef7cb2a44 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/infer/tests/build_systems/build_integration_tests.py b/infer/tests/build_systems/build_integration_tests.py index 18277856f..8db324cc0 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 = [ - '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 '--' diff --git a/infer/tests/build_systems/clang_unknown_ext/Makefile b/infer/tests/build_systems/clang_unknown_ext/Makefile new file mode 100644 index 000000000..20f8b3891 --- /dev/null +++ b/infer/tests/build_systems/clang_unknown_ext/Makefile @@ -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) $< > $@ diff --git a/infer/tests/build_systems/clang_unknown_ext/issues.exp b/infer/tests/build_systems/clang_unknown_ext/issues.exp new file mode 100644 index 000000000..c51d658ea --- /dev/null +++ b/infer/tests/build_systems/clang_unknown_ext/issues.exp @@ -0,0 +1 @@ +hello.unknown_ext, test, 2, NULL_DEREFERENCE, [start of procedure test()] diff --git a/infer/tests/build_systems/expected_outputs/unknown_ext_report.json b/infer/tests/build_systems/expected_outputs/unknown_ext_report.json deleted file mode 100644 index ffc159855..000000000 --- a/infer/tests/build_systems/expected_outputs/unknown_ext_report.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "bug_type": "NULL_DEREFERENCE", - "file": "hello.unknown_ext", - "procedure": "test" - } -] \ No newline at end of file