|
|
|
# Copyright (c) 2016-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 = ../codetoanalyze/clang_compilation_database
|
|
|
|
CMAKE_BUILD_DIR = $(CMAKE_DIR)/_build_infer
|
|
|
|
|
|
|
|
ANALYZER = checkers
|
|
|
|
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
|
|
|
|
|
|
|
|
$(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 ..)
|
|
|
|
|
|
|
|
infer-out/report.json:
|
|
|
|
# make this target empty - since this test defines issues.exp.test directly
|
|
|
|
|
|
|
|
infer-out-with-index/report.json: $(CMAKE_BUILD_DIR)/compile_commands.json $(CLANG_DEPS) $(SOURCES)
|
|
|
|
$(QUIET)$(call silent_on_success,Testing Clang compilation database with index integration,\
|
|
|
|
$(INFER_BIN) -a $(ANALYZER) $(INFER_OPTIONS) -o $(@D) \
|
|
|
|
--changed-files-index $(CMAKE_DIR)/index.txt --compilation-database $<)
|
|
|
|
|
|
|
|
infer-out-no-index/report.json: $(CMAKE_BUILD_DIR)/compile_commands.json $(CLANG_DEPS) $(SOURCES)
|
|
|
|
$(QUIET)$(call silent_on_success,Testing Clang compilation database integration,\
|
|
|
|
$(INFER_BIN) -a $(ANALYZER) $(INFER_OPTIONS) -o $(@D) --compilation-database $<)
|
|
|
|
|
|
|
|
infer-out-reactive-capture/report.json: $(CMAKE_BUILD_DIR)/compile_commands.json $(CLANG_DEPS) $(SOURCES)
|
|
|
|
$(QUIET)$(call silent_on_success,Testing Clang compilation database reactive capture integration,\
|
|
|
|
$(INFER_BIN) -a $(ANALYZER) $(INFER_OPTIONS) -o $(@D) --reactive-capture \
|
|
|
|
--changed-files-index $(CMAKE_DIR)/index.txt --compilation-database $<)
|
|
|
|
|
|
|
|
issues.exp.test: infer-out-with-index/report.json infer-out-no-index/report.json infer-out-reactive-capture/report.json
|
[CLI] switch to infer-<command> (symlinks) executables
Summary:
Introduce `infer-<command>` for each command, except for internal commands
(only `infer-clang` for now) which are not exported. Install these executables
(which are just symlinks to `infer`) on `make install`. The main executable
looks at the name it was invoked with to figure out if it should behave as a
particular command.
Get rid of `InferClang`, `InferAnalyze`, and `InferPrint`. As a bonus, we now
only need to build one executable: `infer`, which should be a few seconds
faster (less link time).
`InferAnalyze` is now `infer-analyze` and `InferPrint` is `infer-print`. To run
`InferClang`, use a symlink named `clang`, `clang++`, etc. to `infer`. There
are such symlinks available in "infer/lib/wrappers/" already.
I also noticed that the scripts in xcodebuild_wrappers/ don't seem useful
anymore, so use wrappers/ instead, as for `make`.
Reviewed By: mbouaziz
Differential Revision: D5036495
fbshipit-source-id: 4a90030
8 years ago
|
|
|
$(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.with-index \
|
|
|
|
-o infer-out-with-index --from-json-report infer-out-with-index/report.json
|
[CLI] switch to infer-<command> (symlinks) executables
Summary:
Introduce `infer-<command>` for each command, except for internal commands
(only `infer-clang` for now) which are not exported. Install these executables
(which are just symlinks to `infer`) on `make install`. The main executable
looks at the name it was invoked with to figure out if it should behave as a
particular command.
Get rid of `InferClang`, `InferAnalyze`, and `InferPrint`. As a bonus, we now
only need to build one executable: `infer`, which should be a few seconds
faster (less link time).
`InferAnalyze` is now `infer-analyze` and `InferPrint` is `infer-print`. To run
`InferClang`, use a symlink named `clang`, `clang++`, etc. to `infer`. There
are such symlinks available in "infer/lib/wrappers/" already.
I also noticed that the scripts in xcodebuild_wrappers/ don't seem useful
anymore, so use wrappers/ instead, as for `make`.
Reviewed By: mbouaziz
Differential Revision: D5036495
fbshipit-source-id: 4a90030
8 years ago
|
|
|
$(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.no-index \
|
|
|
|
-o infer-out-no-index --from-json-report infer-out-no-index/report.json
|
[CLI] switch to infer-<command> (symlinks) executables
Summary:
Introduce `infer-<command>` for each command, except for internal commands
(only `infer-clang` for now) which are not exported. Install these executables
(which are just symlinks to `infer`) on `make install`. The main executable
looks at the name it was invoked with to figure out if it should behave as a
particular command.
Get rid of `InferClang`, `InferAnalyze`, and `InferPrint`. As a bonus, we now
only need to build one executable: `infer`, which should be a few seconds
faster (less link time).
`InferAnalyze` is now `infer-analyze` and `InferPrint` is `infer-print`. To run
`InferClang`, use a symlink named `clang`, `clang++`, etc. to `infer`. There
are such symlinks available in "infer/lib/wrappers/" already.
I also noticed that the scripts in xcodebuild_wrappers/ don't seem useful
anymore, so use wrappers/ instead, as for `make`.
Reviewed By: mbouaziz
Differential Revision: D5036495
fbshipit-source-id: 4a90030
8 years ago
|
|
|
$(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.reactive-capture \
|
|
|
|
-o infer-out-reactive-capture --from-json-report infer-out-reactive-capture/report.json
|
|
|
|
$(QUIET)cat $@.with-index $@.no-index $@.reactive-capture > $@
|