Reviewed By: jvillard Differential Revision: D10861323 fbshipit-source-id: 78453ff9fmaster
parent
a40a7984c7
commit
6131b1fd13
@ -0,0 +1,33 @@
|
|||||||
|
# Copyright (c) 2017-present, Facebook, Inc.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
|
TESTS_DIR = ../..
|
||||||
|
|
||||||
|
CMAKE_DIR = $(CURDIR)/../codetoanalyze/clang_compilation_database
|
||||||
|
CMAKE_BUILD_DIR = $(CURDIR)/_build_infer
|
||||||
|
|
||||||
|
CLEAN_EXTRA = $(CMAKE_BUILD_DIR)
|
||||||
|
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(CMAKE_DIR)
|
||||||
|
SOURCES = $(CMAKE_DIR)/hello.cpp
|
||||||
|
OBJECTS = $(CMAKE_BUILD_DIR)/compile_commands.json
|
||||||
|
INFERPRINT_OPTIONS = --issues-tests
|
||||||
|
|
||||||
|
include $(TESTS_DIR)/infer.make
|
||||||
|
export INFER_STRICT_MODE=0
|
||||||
|
|
||||||
|
$(CMAKE_BUILD_DIR):
|
||||||
|
$(QUIET)$(MKDIR_P) $@
|
||||||
|
|
||||||
|
$(CMAKE_BUILD_DIR)/compile_commands.json: $(SOURCES) $(CMAKE_DIR)/CMakeLists.txt $(CMAKE_BUILD_DIR)
|
||||||
|
$(QUIET)cd $(CMAKE_BUILD_DIR) && \
|
||||||
|
$(call silent_on_success,Running cmake to generate Makefiles,\
|
||||||
|
$(CMAKE) -DCMAKE_EXPORT_COMPILE_COMMANDS=1 $(CMAKE_DIR))
|
||||||
|
|
||||||
|
infer-out/report.json: $(CMAKE_BUILD_DIR)/compile_commands.json $(CLANG_DEPS) $(SOURCES)
|
||||||
|
# test that config/infer.conf is read and paths inside it are interpreted relative to its
|
||||||
|
# location
|
||||||
|
$(QUIET)$(call silent_on_success,Testing Clang compilation database with index integration,\
|
||||||
|
INFERCONFIG=config/infer.conf $(INFER_BIN) $(INFER_OPTIONS) -o $(@D) \
|
||||||
|
--compilation-database $<)
|
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"bo-debug": 0,
|
||||||
|
"bo-debug": "0"
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
hello.cpp, test0, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure test0()]
|
||||||
|
hello.cpp, test1, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure test1(),start of procedure deref1()]
|
||||||
|
hello.cpp, test2, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure test2(),start of procedure deref2()]
|
||||||
|
lib3.h, test, 0, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure test(),start of procedure deref3()]
|
Loading…
Reference in new issue