[test-filtering] remove dead option and code

Summary: Option is not used anywhere. More importantly the list of source file extensions in `Config` might give someone the impression the rest of Infer cares about it somehow.

Reviewed By: skcho

Differential Revision: D29361222

fbshipit-source-id: 22f7f66b2
master
Nikos Gorogiannis 3 years ago committed by Facebook GitHub Bot
parent c683fbd1b4
commit db0ca12d93

@ -2155,11 +2155,6 @@ INTERNAL OPTIONS
which specify the relevant arguments. (Conversely: which specify the relevant arguments. (Conversely:
--no-test-determinator) --no-test-determinator)
--test-filtering
Activates: List all the files Infer can report on (should be
called from the root of the project) (Conversely:
--no-test-filtering)
--testing-mode --testing-mode
Activates: Mode for testing, where no headers are translated, and Activates: Mode for testing, where no headers are translated, and
dot files are created (clang only) (Conversely: --no-testing-mode) dot files are created (clang only) (Conversely: --no-testing-mode)

@ -359,17 +359,3 @@ let filters_from_inferconfig inferconfig : filters =
(* Create filters based on configuration options *) (* Create filters based on configuration options *)
let create_filters () = let create_filters () =
if not Config.filter_paths then do_not_filter else filters_from_inferconfig (load_filters ()) if not Config.filter_paths then do_not_filter else filters_from_inferconfig (load_filters ())
(** This function loads and list the path that are being filtered by the analyzer. The results are
of the form: path/to/file.java -> true/false meaning that analysis results will be reported on
path/to/file.java or not *)
let test () =
let filters = create_filters () in
let matches path = filters.path_filter path in
Sys.getcwd ()
|> Utils.directory_iter (fun path ->
if DB.is_source_file path then
let source_file = SourceFile.from_abs_path path in
let matching = matches source_file in
L.result "%s -> %b@." (SourceFile.to_rel_path source_file) matching )

@ -28,6 +28,3 @@ val skip_translation_matcher : SourceFile.t -> Procname.t -> bool
val skip_implementation_matcher : SourceFile.t -> Procname.t -> bool val skip_implementation_matcher : SourceFile.t -> Procname.t -> bool
val modeled_expensive_matcher : (string -> bool) -> Procname.t -> bool val modeled_expensive_matcher : (string -> bool) -> Procname.t -> bool
val test : unit -> unit
(** Load the config file and list the files to report on *)

@ -8,7 +8,6 @@
open! IStd open! IStd
module F = Format module F = Format
module L = Logging
module Stats = struct module Stats = struct
type t = type t =
@ -349,11 +348,7 @@ module OnDisk = struct
let make_filtered_iterator_from_config ~iter ~f = let make_filtered_iterator_from_config ~iter ~f =
let filter = let filter =
if Option.is_some Config.procedures_filter then ( if Option.is_some Config.procedures_filter then Lazy.force Filtering.procedures_filter
if Config.test_filtering then (
Inferconfig.test () ;
L.exit 0 ) ;
Lazy.force Filtering.procedures_filter )
else fun _ _ -> true else fun _ _ -> true
in in
iter ~filter ~f iter ~filter ~f

@ -197,8 +197,6 @@ let save_compact_summaries = true
(** If true enables printing proposition compatible for the SMT project *) (** If true enables printing proposition compatible for the SMT project *)
let smt_output = false let smt_output = false
let source_file_extentions = [".java"; ".m"; ".mm"; ".c"; ".cc"; ".cpp"; ".h"]
let kotlin_source_extension = ".kt" let kotlin_source_extension = ".kt"
(** Enable detailed tracing information during array abstraction *) (** Enable detailed tracing information during array abstraction *)
@ -2506,11 +2504,6 @@ and test_determinator =
$(b,--profiler-samples) flags, which specify the relevant arguments." $(b,--profiler-samples) flags, which specify the relevant arguments."
and test_filtering =
CLOpt.mk_bool ~deprecated:["test_filtering"] ~long:"test-filtering"
"List all the files Infer can report on (should be called from the root of the project)"
and topl_max_conjuncts = and topl_max_conjuncts =
CLOpt.mk_int ~long:"topl-max-conjuncts" ~default:20 CLOpt.mk_int ~long:"topl-max-conjuncts" ~default:20
"Stop tracking states that reach have at least $(i,int) conjuncts" "Stop tracking states that reach have at least $(i,int) conjuncts"
@ -3510,8 +3503,6 @@ and test_determinator = !test_determinator
and export_changed_functions = !export_changed_functions and export_changed_functions = !export_changed_functions
and test_filtering = !test_filtering
and profiler_samples = !profiler_samples and profiler_samples = !profiler_samples
and testing_mode = !testing_mode and testing_mode = !testing_mode

@ -104,8 +104,6 @@ val save_compact_summaries : bool
val smt_output : bool val smt_output : bool
val source_file_extentions : string list
val unsafe_unret : string val unsafe_unret : string
val weak : string val weak : string
@ -653,8 +651,6 @@ val test_determinator : bool
val export_changed_functions : bool val export_changed_functions : bool
val test_filtering : bool
val testing_mode : bool val testing_mode : bool
val threadsafe_aliases : Yojson.Basic.t val threadsafe_aliases : Yojson.Basic.t

@ -154,6 +154,3 @@ module Results_dir = struct
let full_fname = Filename.concat (create dir_path) filename in let full_fname = Filename.concat (create dir_path) filename in
Unix.openfile full_fname ~mode:Unix.[O_WRONLY; O_CREAT; O_TRUNC] ~perm:0o777 Unix.openfile full_fname ~mode:Unix.[O_WRONLY; O_CREAT; O_TRUNC] ~perm:0o777
end end
let is_source_file path =
List.exists ~f:(fun ext -> Filename.check_suffix path ext) Config.source_file_extentions

@ -67,6 +67,3 @@ val source_dir_get_internal_file : source_dir -> string -> filename
val source_dir_from_source_file : SourceFile.t -> source_dir val source_dir_from_source_file : SourceFile.t -> source_dir
(** get the source directory corresponding to a source file *) (** get the source directory corresponding to a source file *)
val is_source_file : string -> bool
(** Check if a path is a Java, C, C++ or Objectve C source file according to the file extention *)

Loading…
Cancel
Save