Create .start file when infer starts

Reviewed By: jberdine, cristianoc

Differential Revision: D2926803

fb-gh-sync-id: 5992487
shipit-source-id: 5992487
master
Andrzej Kotulski 9 years ago committed by facebook-github-bot-1
parent 5db8fa4539
commit 3db68bcb4c

@ -121,6 +121,7 @@ def main():
if imported_module:
analyze.create_results_dir(args.infer_out)
analyze.reset_start_file(args.infer_out)
utils.configure_logging(args)
logging.info('Running command %s', ' '.join(sys.argv))

@ -198,6 +198,11 @@ def create_results_dir(results_dir):
utils.mkdir_if_not_exists(os.path.join(results_dir, 'sources'))
def reset_start_file(results_dir):
# create new empty file - this will update modified timestamp
open(os.path.join(results_dir, '.start'), 'w').close()
def clean(infer_out):
directories = ['multicore', 'classnames', 'sources', jwlib.FILELISTS]
extensions = ['.cfg', '.cg']

@ -332,3 +332,15 @@ let is_source_file path =
IList.exists
(fun ext -> Filename.check_suffix path ext)
Config.source_file_extentions
let infer_start_time = lazy
(file_modified_time (Results_dir.path_to_filename Results_dir.Abs_root [Config.start_filename]))
(** Return whether filename was updated after analysis started. File doesn't have to exist *)
let file_was_updated_after_start fname =
if file_exists fname then
let file_mtime = file_modified_time fname in
file_mtime >= Lazy.force infer_start_time
else
(* since file doesn't exist, it wasn't modified *)
false

@ -27,6 +27,8 @@ val filename_add_suffix : filename -> string -> filename
val file_exists : filename -> bool
val file_remove : filename -> unit
val file_modified_time : filename -> float (** Return the time when a file was last modified. The file must exist. *)
(** Return whether filename was updated after analysis started. File doesn't have to exist *)
val file_was_updated_after_start : filename -> bool
(** {2 Results Directory} *)

@ -396,6 +396,8 @@ let weak = "<\"Weak\">"
let assign = "<\"Assign\">"
let start_filename = ".start"
(** Programming language. *)
type language = C_CPP | Java

Loading…
Cancel
Save