From c49b9e272dd68cd87fdcb570a937672d5bd47652 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Mon, 7 Nov 2016 09:12:37 -0800 Subject: [PATCH] [tests] turn assembly build system test into a Makefile Summary: onemore Reviewed By: akotulski Differential Revision: D4118762 fbshipit-source-id: c4ffc3f --- Makefile | 2 +- infer/tests/build_systems/assembly/Makefile | 17 +++++++++++++++++ infer/tests/build_systems/assembly/issues.exp | 1 + .../build_systems/build_integration_tests.py | 13 ------------- .../expected_outputs/assembly_report.json | 7 ------- 5 files changed, 19 insertions(+), 21 deletions(-) create mode 100644 infer/tests/build_systems/assembly/Makefile create mode 100644 infer/tests/build_systems/assembly/issues.exp delete mode 100644 infer/tests/build_systems/expected_outputs/assembly_report.json diff --git a/Makefile b/Makefile index a2c72da57..4965a717f 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ ifeq ($(IS_FACEBOOK_TREE),yes) include $(ROOT_DIR)/facebook//Makefile.env endif -BUILD_SYSTEMS_TESTS = ant project_root_rel +BUILD_SYSTEMS_TESTS = ant assembly project_root_rel DIRECT_TESTS= ifeq ($(BUILD_C_ANALYZERS),yes) diff --git a/infer/tests/build_systems/assembly/Makefile b/infer/tests/build_systems/assembly/Makefile new file mode 100644 index 000000000..4dc157da8 --- /dev/null +++ b/infer/tests/build_systems/assembly/Makefile @@ -0,0 +1,17 @@ +# 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 = ../.. +include $(TESTS_DIR)/clang.make + +ANALYZER = infer +CLANG_OPTIONS = -c +INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze + +SOURCES = \ + ../codetoanalyze/example.S \ + ../codetoanalyze/hello.c \ diff --git a/infer/tests/build_systems/assembly/issues.exp b/infer/tests/build_systems/assembly/issues.exp new file mode 100644 index 000000000..61a83f1d4 --- /dev/null +++ b/infer/tests/build_systems/assembly/issues.exp @@ -0,0 +1 @@ +hello.c, test, 2, NULL_DEREFERENCE diff --git a/infer/tests/build_systems/build_integration_tests.py b/infer/tests/build_systems/build_integration_tests.py index 0b373609f..b7bc86698 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 = [ - 'assembly', 'buck', 'clang_compilation_database', 'cmake', @@ -329,13 +328,6 @@ def test(name, class BuildIntegrationTest(unittest.TestCase): - def test_ant_integration(self): - test('ant', 'Ant', - os.path.join(SCRIPT_DIR, os.pardir), - [{'compile': ['ant', 'compile']}], - clean_commands=[['ant', 'clean']], - available=lambda: is_tool_available(['ant', '-version'])) - def test_javac_integration( self, enabled=None, @@ -515,11 +507,6 @@ class BuildIntegrationTest(unittest.TestCase): 'infer_args': reactive_args}, {'compile': ['analyze']}]) - def test_clang_assembly(self): - test('assembly', 'compile with assembly code', CODETOANALYZE_DIR, - [{'compile': ['clang', '-x', 'c', '-c', 'hello.c', '-x', - 'assembler-with-cpp', 'example.S']}]) - def test_clang_component_kit_imports(self): test('componentkit', 'component quality analyzer skips imports', os.path.join(CODETOANALYZE_DIR, 'componentkit'), diff --git a/infer/tests/build_systems/expected_outputs/assembly_report.json b/infer/tests/build_systems/expected_outputs/assembly_report.json deleted file mode 100644 index a6ed10eff..000000000 --- a/infer/tests/build_systems/expected_outputs/assembly_report.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "bug_type": "NULL_DEREFERENCE", - "file": "hello.c", - "procedure": "test" - } -] \ No newline at end of file