Skip to content
Snippets Groups Projects
Commit b49818ce authored by Patrick Baudin's avatar Patrick Baudin Committed by Andre Maroneze
Browse files

[ptests] redefining CMD as @frama-c@ @PTEST_OPTIONS@ won't add missing @PTEST_FILE@

parent 0ae70c2e
No related branches found
No related tags found
No related merge requests found
...@@ -358,7 +358,7 @@ let macro_options = ref "@PTEST_PRE_OPTIONS@ @PTEST_OPT@ @PTEST_POST_OPTIONS@" ...@@ -358,7 +358,7 @@ let macro_options = ref "@PTEST_PRE_OPTIONS@ @PTEST_OPT@ @PTEST_POST_OPTIONS@"
let macro_default_options = ref "-journal-disable -check -no-autoload-plugins" let macro_default_options = ref "-journal-disable -check -no-autoload-plugins"
let macro_frama_c_cmd = ref "@frama-c-exe@ @PTEST_DEFAULT_OPTIONS@" let macro_frama_c_cmd = ref "@frama-c-exe@ @PTEST_DEFAULT_OPTIONS@"
let macro_frama_c = ref "@frama-c-exe@ @PTEST_DEFAULT_OPTIONS@ @PTEST_LOAD_OPTIONS@" let macro_frama_c = ref "@frama-c-exe@ @PTEST_DEFAULT_OPTIONS@ @PTEST_LOAD_OPTIONS@"
let default_toplevel = ref "@frama-c@" let default_toplevel = ref "@frama-c@"
(* Those variables are read from a ptests_config file *) (* Those variables are read from a ptests_config file *)
...@@ -1585,23 +1585,21 @@ end = struct ...@@ -1585,23 +1585,21 @@ end = struct
let process_macros s = Macros.expand macros s in let process_macros s = Macros.expand macros s in
let toplevel = let toplevel =
let toplevel = log_default_filter cmd.toplevel in let toplevel = log_default_filter cmd.toplevel in
let in_toplevel,toplevel= Macros.does_expand macros toplevel in let in_toplevel,toplevel = Macros.does_expand macros toplevel in
if not cmd.execnow then begin if cmd.execnow || in_toplevel.has_ptest_opt then toplevel
let has_ptest_file, options = else begin
if in_toplevel.has_ptest_opt then in_toplevel.has_ptest_file, [] let has_ptest_file,options =
else let in_option,options = Macros.does_expand macros cmd.options in
let in_option,options= Macros.does_expand macros cmd.options in (in_option.has_ptest_file || in_toplevel.has_ptest_file),
(in_option.has_ptest_file || in_toplevel.has_ptest_file), (if in_toplevel.has_frama_c_exe then
(if in_toplevel.has_frama_c_exe then [ process_macros "@PTEST_PRE_OPTIONS@" ;
[ process_macros "@PTEST_PRE_OPTIONS@" ; options ;
options ; process_macros "@PTEST_POST_OPTIONS@" ;
process_macros "@PTEST_POST_OPTIONS@" ; ]
] else [ options ])
else [ options ])
in in
String.concat " " (toplevel::(if has_ptest_file then options else ptest_file::options)) String.concat " " (toplevel::(if has_ptest_file then options else ptest_file::options))
end end
else toplevel
in in
let toplevel = get_ptest_toplevel cmd (dune_feature_cmd toplevel) in let toplevel = get_ptest_toplevel cmd (dune_feature_cmd toplevel) in
{ cmd with { cmd with
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment