[clang] Run direct tests with --no-failures-allowed flag

Reviewed By: dulmarod

Differential Revision: D4674385

fbshipit-source-id: 0816239
master
Andrzej Kotulski 8 years ago committed by Facebook Github Bot
parent 55b18df306
commit e08d9341c8

@ -21,6 +21,10 @@ struct
(* Translates the method/function's body into nodes of the cfg. *) (* Translates the method/function's body into nodes of the cfg. *)
let add_method trans_unit_ctx tenv cg cfg class_decl_opt procname body has_return_param let add_method trans_unit_ctx tenv cg cfg class_decl_opt procname body has_return_param
is_objc_method outer_context_opt extra_instrs = is_objc_method outer_context_opt extra_instrs =
let handle_translation_failure () =
Cfg.remove_proc_desc cfg procname;
CMethod_trans.create_external_procdesc cfg procname is_objc_method None
in
Logging.out_debug Logging.out_debug
"@\n@\n>>---------- ADDING METHOD: '%s' ---------<<@\n@." (Procname.to_string procname); "@\n@\n>>---------- ADDING METHOD: '%s' ---------<<@\n@." (Procname.to_string procname);
try try
@ -48,11 +52,12 @@ struct
(* this shouldn't happen, because self or [a class] should always be arguments of (* this shouldn't happen, because self or [a class] should always be arguments of
functions. This is to make sure I'm not wrong. *) functions. This is to make sure I'm not wrong. *)
assert false assert false
| CTrans_utils.TemplatedCodeException _ ->
Logging.out "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.failures_allowed ->
Logging.out "Fatal error: exception Assert_failure(%s, %d, %d)\n%!" file line column; Logging.out "Fatal error: exception Assert_failure(%s, %d, %d)\n%!" file line column;
Cfg.remove_proc_desc cfg procname; handle_translation_failure ()
CMethod_trans.create_external_procdesc cfg procname is_objc_method None;
()
let function_decl trans_unit_ctx tenv cfg cg func_decl block_data_opt = let function_decl trans_unit_ctx tenv cfg cg func_decl block_data_opt =
let captured_vars, outer_context_opt = let captured_vars, outer_context_opt =

@ -2665,6 +2665,13 @@ struct
| VAArgExpr (_, _, expr_info) -> | VAArgExpr (_, _, expr_info) ->
trans_into_undefined_expr trans_state expr_info trans_into_undefined_expr trans_state expr_info
(* Infer somehow ended up in templated non instantiated code - right now
it's not supported and failure in those cases is expected. *)
| SubstNonTypeTemplateParmExpr _
| SubstNonTypeTemplateParmPackExpr _
| CXXDependentScopeMemberExpr _ -> raise (CTrans_utils.TemplatedCodeException instr)
| s -> (Logging.out | s -> (Logging.out
"\n!!!!WARNING: found statement %s. \nACTION REQUIRED: \ "\n!!!!WARNING: found statement %s. \nACTION REQUIRED: \
Translation need to be defined. Statement ignored.... \n" Translation need to be defined. Statement ignored.... \n"

@ -14,6 +14,8 @@ module Hashtbl = Caml.Hashtbl
module L = Logging module L = Logging
exception TemplatedCodeException of Clang_ast_t.stmt
(* Extract the element of a singleton list. If the list is not a singleton *) (* Extract the element of a singleton list. If the list is not a singleton *)
(* It stops the computation giving a warning. We use this because we *) (* It stops the computation giving a warning. We use this because we *)
(* assume in many places that a list is just a singleton. We use the *) (* assume in many places that a list is just a singleton. We use the *)

@ -40,6 +40,8 @@ type trans_result = {
is_cpp_call_virtual : bool; is_cpp_call_virtual : bool;
} }
exception TemplatedCodeException of Clang_ast_t.stmt
val empty_res_trans: trans_result val empty_res_trans: trans_result
val undefined_expression: unit -> Exp.t val undefined_expression: unit -> Exp.t

@ -12,7 +12,7 @@ TESTS_DIR = ../../..
ANALYZER = bufferoverrun ANALYZER = bufferoverrun
CLANG_OPTIONS = -c CLANG_OPTIONS = -c
INFER_OPTIONS = -nf --project-root $(TESTS_DIR) INFER_OPTIONS = -nf --project-root $(TESTS_DIR) --no-failures-allowed
INFERPRINT_OPTIONS = --issues-tests INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \

@ -9,7 +9,7 @@ TESTS_DIR = ../../..
ANALYZER = infer ANALYZER = infer
CLANG_OPTIONS = -c CLANG_OPTIONS = -c
INFER_OPTIONS = --report-custom-error --developer-mode --no-filtering --debug-exceptions --project-root $(TESTS_DIR) INFER_OPTIONS = --report-custom-error --developer-mode --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
# we need to disable traces in C tests because assertions/assertion_failure.c has different traces # 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 # 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 INFERPRINT_OPTIONS = --issues-fields "file,procedure,line_offset,bug_type" --issues-tests

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

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

@ -12,7 +12,7 @@ ANALYZER = infer
# Use the system headers of our own clang. This way, we always use the same system headers # Use the system headers of our own clang. This way, we always use the same system headers
# regardless of the libraries installed on the machine. # regardless of the libraries installed on the machine.
CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c
INFER_OPTIONS = --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) INFER_OPTIONS = --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFERPRINT_OPTIONS = --issues-tests INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \

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

@ -10,7 +10,7 @@ TESTS_DIR = ../../..
ANALYZER = quandary ANALYZER = quandary
# see explanations in cpp/errors/Makefile for the custom isystem # 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 CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c
INFER_OPTIONS = --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) INFER_OPTIONS = --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFERPRINT_OPTIONS = --issues-tests INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \

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

@ -17,7 +17,7 @@ CLANG_OPTIONS = -x objective-c \
ANALYZER = linters ANALYZER = linters
INFER_OPTIONS = --no-filtering --debug-exceptions --project-root $(TESTS_DIR) \ INFER_OPTIONS = --no-filtering --debug-exceptions --project-root $(TESTS_DIR) \
--iphoneos-target-sdk-version 8.0 --iphoneos-target-sdk-version 8.0 --no-failures-allowed
INFERPRINT_OPTIONS = --issues-tests INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \

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

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

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

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

Loading…
Cancel
Save