[infer] merge --failures-allowed and --keep-going

Summary: The `--failures-allowed` was doing for the Clang frontend what `--keep-doing` was doing for the backend. This revision merges the two options to simplify the Infer CLI and our tests.

Reviewed By: jvillard

Differential Revision: D5474347

fbshipit-source-id: 09bcea4
master
Jeremy Dubreil 7 years ago committed by Facebook Github Bot
parent 7dc3232f5f
commit bf11a27158

@ -804,7 +804,6 @@ and ( bo_debug
, debug_level_capture
, debug_level_linters
, default_linters
, failures_allowed
, filtering
, frontend_tests
, keep_going
@ -842,9 +841,6 @@ and ( bo_debug
CLOpt.mk_bool ~long:"developer-mode"
~default:(Option.value_map ~default:false ~f:CLOpt.(equal_command Report) initial_command)
"Show internal exceptions"
and failures_allowed =
CLOpt.mk_bool ~deprecated_no:["-no_failures_allowed"] ~long:"failures-allowed" ~default:true
"Fail if at least one of the translations fails (clang only)"
and filtering =
CLOpt.mk_bool ~deprecated_no:["nf"] ~long:"filtering" ~short:'f' ~default:true
~in_help:CLOpt.([(Report, manual_generic)])
@ -857,7 +853,7 @@ and ( bo_debug
and print_types =
CLOpt.mk_bool ~long:"print-types" ~default:false "Print types in symbolic heaps"
and keep_going =
CLOpt.mk_bool ~long:"keep-going"
CLOpt.mk_bool ~deprecated_no:["-no-failures-allowed"] ~long:"keep-going"
~in_help:CLOpt.([(Analyze, manual_generic)])
~default:true "Keep going when the analysis encounters a failure"
and reports_include_ml_loc =
@ -913,8 +909,7 @@ and ( bo_debug
"Save filename.ext.test.dot with the cfg in dotty format for frontend tests (also sets $(b,--print-types))"
[print_types] []
and models_mode =
CLOpt.mk_bool_group ~long:"models-mode" "Mode for analyzing the models" []
[failures_allowed; keep_going]
CLOpt.mk_bool_group ~long:"models-mode" "Mode for analyzing the models" [] [keep_going]
and print_logs =
CLOpt.mk_bool ~long:"print-logs"
~in_help:
@ -936,7 +931,7 @@ and ( bo_debug
~f:(fun debug ->
debug_level_linters := if debug then 2 else 0 ;
debug)
[debug; developer_mode] [failures_allowed; default_linters]
[debug; developer_mode] [default_linters; keep_going]
in
( bo_debug
, developer_mode
@ -946,7 +941,6 @@ and ( bo_debug
, debug_level_capture
, debug_level_linters
, default_linters
, failures_allowed
, filtering
, frontend_tests
, keep_going
@ -1908,8 +1902,6 @@ and eradicate_verbose = !eradicate_verbose
and fail_on_bug = !fail_on_bug
and failures_allowed = !failures_allowed
and fcp_apple_clang = !fcp_apple_clang
and fcp_syntax_only = !fcp_syntax_only

@ -380,8 +380,6 @@ val eradicate_verbose : bool
val fail_on_bug : bool
val failures_allowed : bool
val fcp_apple_clang : string option
val fcp_syntax_only : bool

@ -104,7 +104,7 @@ let run_clang_frontend ast_source =
let run_and_validate_clang_frontend ast_source =
try run_clang_frontend ast_source
with exc -> if not Config.failures_allowed then raise exc
with exc -> if not Config.keep_going then raise exc
let run_clang clang_command read =
let exit_with_error exit_code =

@ -56,7 +56,7 @@ module CFrontend_decl_funct (T : CModule_type.CTranslation) : CModule_type.CFron
| CTrans_utils.TemplatedCodeException _
-> L.internal_error "Fatal error: frontend doesn't support translation of templated code@\n" ;
handle_translation_failure ()
| Assert_failure (file, line, column) when Config.failures_allowed
| Assert_failure (file, line, column) when Config.keep_going
-> L.internal_error "Fatal error: exception Assert_failure(%s, %d, %d)@\n%!" file line column ;
handle_translation_failure ()

@ -9,7 +9,7 @@ TESTS_DIR = ../..
ANALYZER = infer
CLANG_OPTIONS = -c
INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \

@ -10,7 +10,7 @@ TESTS_DIR = ../..
SOURCE_DIR = ../codetoanalyze
ANALYZER = infer
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(SOURCE_DIR) --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(SOURCE_DIR) --no-keep-going
SOURCES = $(wildcard $(SOURCE_DIR)/*.cpp $(SOURCE_DIR)/*.h)
OBJECTS = '$(SOURCE_DIR)/buck-out/gen/clang_compilation_database/__Hel lo\#compilation-database,x86_64.json'
INFERPRINT_OPTIONS = --issues-tests

@ -12,7 +12,7 @@ ANALYZER = infer
BUCK_TARGET = //src:hello
SOURCES = $(wildcard src/hello.c)
OBJECTS = buck-out/gen/src/hello\#compile-hello.c.o1f717d69,default/hello.c.o
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(TESTS_DIR) --no-keep-going
INFERPRINT_OPTIONS = --project-root $(TESTS_DIR) --issues-tests
CLEAN_EXTRA = buck-out

@ -12,7 +12,7 @@ ANALYZER = infer
BUCK_TARGET = //src:hello
SOURCES = $(wildcard src/hello.c)
OBJECTS = buck-out/gen/src/hello\#compile-hello.c.o1f717d69,default/hello.c.o
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(TESTS_DIR) --no-keep-going
INFERPRINT_OPTIONS = --project-root $(TESTS_DIR) --issues-tests
CLEAN_EXTRA = buck-out capture_hash-1.sha capture_hash-2.sha

@ -12,7 +12,7 @@ ANALYZER = linters
CODETOANALYZE_DIR = ../codetoanalyze/componentkit
CLANG_OPTIONS = -x objective-c++ -std=c++11 -c -fblocks
INFER_OPTIONS = --no-filtering --project-root $(CODETOANALYZE_DIR) --no-failures-allowed
INFER_OPTIONS = --no-filtering --project-root $(CODETOANALYZE_DIR) --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(CODETOANALYZE_DIR)/TestIgnoreImports.mm

@ -12,7 +12,7 @@ CMAKE_BUILD_DIR = $(CMAKE_DIR)/_build_infer
ANALYZER = infer
CLEAN_EXTRA = $(CMAKE_BUILD_DIR)
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(CMAKE_DIR) --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(CMAKE_DIR) --no-keep-going
SOURCES = $(CMAKE_DIR)/hello.cpp
OBJECTS = $(CMAKE_BUILD_DIR)/compile_commands.json
INFERPRINT_OPTIONS = --issues-tests

@ -8,7 +8,7 @@
TESTS_DIR = ../..
ANALYZER = infer
INFER_OPTIONS = --report-custom-error --developer-mode --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --no-keep-going
SOURCES = ../codetoanalyze/path\ with\ spaces/hel\ lo.c
OBJECTS = $(SOURCES:.c=.o)
CLEAN_EXTRA = compile_commands.json

@ -8,7 +8,7 @@
TESTS_DIR = ../..
ANALYZER = infer
INFER_OPTIONS = --report-custom-error --developer-mode --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --no-keep-going
SOURCES = \
../codetoanalyze/hello.c ../codetoanalyze/hello2.c ../codetoanalyze/hello3.c \
../codetoanalyze/path\ with\ spaces/hel\ lo.c

@ -10,7 +10,7 @@ TESTS_DIR = ../..
ANALYZER = infer
CLANG_OPTIONS = -c
INFER_OPTIONS = --project-root ../codetoanalyze --no-failures-allowed
INFER_OPTIONS = --project-root ../codetoanalyze --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = ../codetoanalyze/hello.c ../codetoanalyze/hello2.c

@ -24,7 +24,7 @@ CLEAN_EXTRA = $(DOT_FILES) $(foreach source,$(SOURCES),infer-out-$(basename $(no
include $(TESTS_DIR)/clang-frontend.make
INFER_OPTIONS = capture --frontend-tests --skip-translation-headers exclude_dir --no-failures-allowed
INFER_OPTIONS = capture --frontend-tests --skip-translation-headers exclude_dir --no-keep-going
capture: $(DOT_FILES)

@ -10,7 +10,7 @@ TESTS_DIR = ../..
ANALYZER = infer
CLANG_OPTIONS = -x c -c
INFER_OPTIONS = --project-root ../codetoanalyze --no-failures-allowed
INFER_OPTIONS = --project-root ../codetoanalyze --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = ../codetoanalyze/hello.unknown_ext

@ -9,7 +9,7 @@ TESTS_DIR = ../..
ANALYZER = infer
CLANG_OPTIONS = -E -c
INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = ../codetoanalyze/hello.c

@ -9,7 +9,7 @@ TESTS_DIR = ../..
ANALYZER = infer
CLANG_OPTIONS = -MD -c
INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = ../codetoanalyze/hello.c

@ -9,7 +9,7 @@ TESTS_DIR = ../..
ANALYZER = infer
CLANG_OPTIONS = -M -c
INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = ../codetoanalyze/hello.c

@ -13,7 +13,7 @@ CMAKE_ANALYZE_DIR = $(CMAKE_DIR)/_build_infer
ANALYZER = infer
CLEAN_EXTRA = $(CMAKE_BUILD_DIR) $(CMAKE_ANALYZE_DIR)
INFER_OPTIONS = --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --project-root $(TESTS_DIR) --no-keep-going
SOURCES = $(CMAKE_DIR)/hello.c
OBJECTS = $(CMAKE_BUILD_DIR)/CMakeFiles/Hello.dir/hello.c.o
INFERPRINT_OPTIONS = --issues-tests

@ -12,7 +12,7 @@ CMAKE_BUILD_DIR = $(CURDIR)/_build_infer
ANALYZER = infer
CLEAN_EXTRA = $(CMAKE_BUILD_DIR)
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(CMAKE_DIR) --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(CMAKE_DIR) --no-keep-going
SOURCES = $(CMAKE_DIR)/hello.cpp
OBJECTS = $(CMAKE_BUILD_DIR)/compile_commands.json
INFERPRINT_OPTIONS = --issues-tests

@ -9,7 +9,7 @@ TESTS_DIR = ../..
ANALYZER = infer
CLANG_OPTIONS = -c
INFER_OPTIONS = --report-custom-error --developer-mode --headers --project-root ../codetoanalyze --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --headers --project-root ../codetoanalyze --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \

@ -9,7 +9,7 @@ TESTS_DIR = ../..
ANALYZER = infer
CLANG_OPTIONS = -c
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(TESTS_DIR) --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \

@ -15,7 +15,7 @@ ANALYZER = linters
CODETOANALYZE_DIR = ../codetoanalyze/componentkit
CLANG_OPTIONS = -x objective-c++ -std=c++11 -c -fblocks
INFER_OPTIONS = --compute-analytics --project-root $(CODETOANALYZE_DIR) --no-failures-allowed
INFER_OPTIONS = --compute-analytics --project-root $(CODETOANALYZE_DIR) --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(CODETOANALYZE_DIR)/TestComponentKitAnalytics.mm

@ -12,7 +12,7 @@ TESTS_DIR = ../../..
ANALYZER = checkers
CLANG_OPTIONS = -c
INFER_OPTIONS = -F --project-root $(TESTS_DIR) --no-failures-allowed --no-liveness --bufferoverrun
INFER_OPTIONS = -F --project-root $(TESTS_DIR) --no-keep-going --no-liveness --bufferoverrun
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.c)

@ -9,7 +9,7 @@ TESTS_DIR = ../../..
ANALYZER = infer
CLANG_OPTIONS = -c
INFER_OPTIONS = --report-custom-error --developer-mode --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --report-custom-error --developer-mode --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-keep-going
# we need to disable traces in C tests because assertions/assertion_failure.c has different traces
# on Linux and OSX because of different implementations of assert() on each platform
INFERPRINT_OPTIONS = --issues-fields "file,procedure,line_offset,bug_type" --issues-tests

@ -8,7 +8,7 @@
TESTS_DIR=../../..
CLANG_OPTIONS = -c
INFER_OPTIONS = --no-failures-allowed
INFER_OPTIONS = --no-keep-going
SOURCES = \
$(wildcard */*.c) \

@ -11,7 +11,7 @@ ANALYZER = checkers
# see explanations in cpp/errors/Makefile for the custom isystem
CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(MODELS_DIR)/cpp/include -isystem$(CLANG_INCLUDES)/c++/v1/ -c
INFER_OPTIONS = --bufferoverrun --ml-buckets cpp --no-filtering --debug-exceptions \
--project-root $(TESTS_DIR) --no-failures-allowed --no-liveness
--project-root $(TESTS_DIR) --no-keep-going --no-liveness
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.cpp)

@ -11,7 +11,7 @@ ANALYZER = infer
CLANG_OPTIONS = -x c++ -std=c++14 -isystem$(ROOT_DIR) -c
INFER_OPTIONS = --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) \
--no-failures-allowed --pmd-xml --report-custom-error
--no-keep-going --pmd-xml --report-custom-error
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \

@ -11,7 +11,7 @@ TESTS_DIR=../../..
CLANG_OPTIONS = \
-nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ \
-x c++ -std=c++11 -c
INFER_OPTIONS = --headers --no-failures-allowed
INFER_OPTIONS = --headers --no-keep-going
SOURCES = \

@ -10,7 +10,7 @@ TESTS_DIR = ../../..
ANALYZER = checkers
# see explanations in cpp/errors/Makefile for the custom isystem
CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(MODELS_DIR)/cpp/include -isystem$(CLANG_INCLUDES)/c++/v1/ -c
INFER_OPTIONS = --ml-buckets cpp --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --ml-buckets cpp --debug-exceptions --project-root $(TESTS_DIR) --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.cpp)

@ -10,7 +10,7 @@ TESTS_DIR = ../../..
ANALYZER = checkers
# see explanations in cpp/errors/Makefile for the custom isystem
CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c
INFER_OPTIONS = --quandary --passthroughs --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --quandary --passthroughs --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.cpp)

@ -10,7 +10,7 @@ TESTS_DIR = ../../..
ANALYZER = checkers
# see explanations in cpp/errors/Makefile for the custom isystem
CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(MODELS_DIR)/cpp/include -isystem$(CLANG_INCLUDES)/c++/v1/ -c
INFER_OPTIONS = --siof --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --siof --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \

@ -10,7 +10,7 @@ TESTS_DIR = ../../..
ANALYZER = checkers
# see explanations in cpp/errors/Makefile for the custom isystem
CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c
INFER_OPTIONS = --threadsafety --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --threadsafety --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-keep-going
INFER_OPTIONS += --debug
INFERPRINT_OPTIONS = --issues-tests

@ -18,7 +18,7 @@ CLANG_OPTIONS = -x objective-c \
CLEAN_EXTRA = infer-out-arc infer-out-all infer-out-all infer-out-arc \
issues.exp.test.all issues.exp.test.arc issues.exp.test.default
INFER_OPTIONS = --dump-duplicate-symbols --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --dump-duplicate-symbols --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES_DEFAULT = \

@ -19,7 +19,7 @@ ANALYZER = linters
INFER_OPTIONS = --no-filtering --debug-exceptions --project-root $(TESTS_DIR) \
--iphoneos-target-sdk-version 8.0 \
--iphoneos-target-sdk-version-skip-path "codetoanalyze/objc/ioslints/filter_out_unavailable_api\.m" \
--no-failures-allowed
--no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \

@ -9,7 +9,7 @@ TESTS_DIR = ../../..
ANALYZER = linters
CLANG_OPTIONS = -c
INFER_OPTIONS = --linters-def-folder checks --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --linters-def-folder checks --project-root $(TESTS_DIR) --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = file.m

@ -9,7 +9,7 @@ TESTS_DIR = ../../..
ANALYZER = linters
CLANG_OPTIONS = -fobjc-arc -c
INFER_OPTIONS = --cxx --linters-def-file linters_example.al --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --cxx --linters-def-file linters_example.al --project-root $(TESTS_DIR) --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \

@ -9,7 +9,7 @@ TESTS_DIR = ../../..
ANALYZER = linters
CLANG_OPTIONS = -x objective-c -fobjc-arc -c
INFER_OPTIONS = --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \

@ -16,7 +16,7 @@ CLANG_OPTIONS = -x objective-c \
-mios-simulator-version-min=8.2 --target=x86_64-apple-darwin14 -c \
ANALYZER = quandary
INFER_OPTIONS = --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --iphoneos-target-sdk-version 8.0 --no-failures-allowed
INFER_OPTIONS = --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --iphoneos-target-sdk-version 8.0 --no-keep-going
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \

@ -15,7 +15,7 @@ CLANG_OPTIONS = -x objective-c++ -std=c++11 \
-isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \
-mios-simulator-version-min=8.2 --target=x86_64-apple-darwin14 -c \
INFER_OPTIONS = --no-failures-allowed
INFER_OPTIONS = --no-keep-going
SOURCES = \
$(wildcard */*.mm) \

@ -9,7 +9,7 @@ TESTS_DIR = ../../..
ANALYZER = linters
CLANG_OPTIONS = -x objective-c++ -std=c++11 -fobjc-arc -c
INFER_OPTIONS = --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed \
INFER_OPTIONS = --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-keep-going \
--enable-checks GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL
INFERPRINT_OPTIONS = --issues-tests

Loading…
Cancel
Save