diff --git a/ptests/ptests.ml b/ptests/ptests.ml index 94fd7bc07f9a6d8c2388de74a98ea8db8cdc67c2..c1aed8cf914d023c58553ce0eb5bd7f81fed8425 100644 --- a/ptests/ptests.ml +++ b/ptests/ptests.ml @@ -819,7 +819,10 @@ end = struct dc_timeout = ""; } - let scan_execnow ~once dir ex_macros ex_timeout (s:string) = + let scan_execnow ~warn ~once ~file dir ex_macros ex_timeout (s:string) = + if once=false then + lock_eprintf "%s: using EXEC directive (DEPRECATED): %s@." + file s; let rec aux (s:execnow) = try Scanf.sscanf s.ex_cmd "%_[ ]LOG%_[ ]%[-A-Za-z0-9_',+=:.\\@@]%_[ ]%s@\n" @@ -834,21 +837,31 @@ end = struct try Scanf.sscanf s.ex_cmd "%_[ ]make%_[ ]%s@\n" (fun cmd -> + (* It should be better to use a specific macro into the command (such as @MAKE@) for that. *) let s = aux ({ s with ex_cmd = cmd; }) in - { s with ex_cmd = !do_make^" "^cmd; } ) + let r = { s with ex_cmd = !do_make^" "^cmd; } in + if warn then + Format.eprintf "%s: EXEC%s directive with a make command (DEPRECATED): %s@." + file (if once then "NOW" else "") r.ex_cmd; + r) with Scanf.Scan_failure _ -> s in - aux - { ex_cmd = s; - ex_macros; - ex_log = []; - ex_bin = []; - ex_dir = dir; - ex_once = once; - ex_done = ref false; - ex_timeout; - } + let execnow = aux + { ex_cmd = s; + ex_macros; + ex_log = []; + ex_bin = []; + ex_dir = dir; + ex_once = once; + ex_done = ref false; + ex_timeout; + } + in + if warn && execnow.ex_log = [] && execnow.ex_bin = [] then + Format.eprintf "%s: EXEC%s without LOG nor BIN target (DEPRECATED): %s@." + file (if once then "NOW" else "") s; + execnow type parsing_env = { current_default_toplevel: string; @@ -899,10 +912,10 @@ end = struct List.fold_right (fun x s -> s ^ " " ^ x) opts "" (* how to process options *) - let config_exec ~once ~file:_ dir s current = + let config_exec ~warn ~once ~file dir s current = { current with dc_execnow = - scan_execnow ~once dir current.dc_macros current.dc_timeout s :: current.dc_execnow } + scan_execnow ~warn ~once ~file dir current.dc_macros current.dc_timeout s :: current.dc_execnow } let config_macro ~file _dir s current = let regex = Str.regexp "[ \t]*\\([^ \t@]+\\)\\([ \t]+\\(.*\\)\\|$\\)" in @@ -937,7 +950,7 @@ end = struct if String.(deps = "") then current else begin let make_cmd = Macros.expand current.dc_macros "@PTEST_MAKE_MODULE@" in - config_exec ~once:true ~file dir (make_cmd ^ deps) current + config_exec ~warn:false ~once:true ~file dir (make_cmd ^ deps) current end let update_module_macros modules macros = @@ -1036,8 +1049,8 @@ end = struct "DONTRUN", (fun ~file:_ _ s current -> { current with dc_dont_run = true }); - "EXECNOW", config_exec ~once:true; - "EXEC", config_exec ~once:false; + "EXECNOW", config_exec ~warn:true ~once:true; + "EXEC", config_exec ~warn:true ~once:false; "MACRO", config_macro; diff --git a/tests/callgraph/function_pointer.i b/tests/callgraph/function_pointer.i index b28287119069e61b95d7115a89eeb8592e7e8412..4d2a1df1ad8a95527dc4a5bfded076b19114d0a0 100644 --- a/tests/callgraph/function_pointer.i +++ b/tests/callgraph/function_pointer.i @@ -1,10 +1,11 @@ /* run.config COMMENT: Test option -cg-function-pointers - EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs - OPT: -cg-function-pointers -no-autoload-plugins -load-module eva,@PTEST_DIR@/@PTEST_NAME@.cmxs - OPT: -cg-no-services -cg-function-pointers -no-autoload-plugins -load-module eva,@PTEST_DIR@/@PTEST_NAME@.cmxs - OPT: -cg-no-function-pointers -no-autoload-plugins -load-module eva,@PTEST_DIR@/@PTEST_NAME@.cmxs - OPT: -cg-no-services -cg-no-function-pointers -no-autoload-plugins -load-module eva,@PTEST_DIR@/@PTEST_NAME@.cmxs + MODULE: @PTEST_NAME@ + PLUGIN: @PTEST_PLUGIN@,eva + OPT: -cg-function-pointers + OPT: -cg-no-services -cg-function-pointers + OPT: -cg-no-function-pointers + OPT: -cg-no-services -cg-no-function-pointers */ int (*fptr)(int); diff --git a/tests/compliance/check-json.i b/tests/compliance/check-json.i index 1a3c99c12ae8d2d29779fb562ff4a14844816887..88d6a106f0362fafce2346750cd8442688257a5d 100644 --- a/tests/compliance/check-json.i +++ b/tests/compliance/check-json.i @@ -1,7 +1,8 @@ /*run.config - NOFRAMAC: - EXECNOW: LOG json_@PTEST_NAME@_1.txt python3 -m json.tool < share/compliance/c11_functions.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_1.txt 2> @DEV_NULL@ - EXECNOW: LOG json_@PTEST_NAME@_2.txt python3 -m json.tool < share/compliance/glibc_functions.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_2.txt 2> @DEV_NULL@ - EXECNOW: LOG json_@PTEST_NAME@_3.txt python3 -m json.tool < share/compliance/nonstandard_identifiers.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_3.txt 2> @DEV_NULL@ - EXECNOW: LOG json_@PTEST_NAME@_4.txt python3 -m json.tool < share/compliance/posix_identifiers.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_4.txt 2> @DEV_NULL@ + MACRO: SHARE share/compliance + NOFRAMAC: + EXECNOW: LOG json_@PTEST_NAME@_1.txt python3 -m json.tool < @SHARE@/c11_functions.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_1.txt 2> @DEV_NULL@ + EXECNOW: LOG json_@PTEST_NAME@_2.txt python3 -m json.tool < @SHARE@/glibc_functions.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_2.txt 2> @DEV_NULL@ + EXECNOW: LOG json_@PTEST_NAME@_3.txt python3 -m json.tool < @SHARE@/nonstandard_identifiers.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_3.txt 2> @DEV_NULL@ + EXECNOW: LOG json_@PTEST_NAME@_4.txt python3 -m json.tool < @SHARE@/posix_identifiers.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_4.txt 2> @DEV_NULL@ */ diff --git a/tests/dynamic/dynamic.i b/tests/dynamic/dynamic.i index 2e7d88279ff52ccf97b5fc13b2d1e2d2fee4bc71..c9cccd8e7c2e0e292cb9dab261eba0bae715624f 100644 --- a/tests/dynamic/dynamic.i +++ b/tests/dynamic/dynamic.i @@ -1,6 +1,5 @@ /*run.config - EXECNOW: make tests/dynamic/empty.cmo tests/dynamic/abstract.cmo tests/dynamic/abstract2.cmo - CMD: FRAMAC_PLUGIN=tests/dynamic bin/toplevel.byte OPT: -add-path tests/dynamic/file_path -add-path tests/dynamic/directory_path -add-path tests/dynamic/none - OPT: -load-module tests/dynamic/empty.cmo,tests/dynamic/abstract.cmo,tests/dynamic/abstract2.cmo + MODULE: empty abstract abstract2 + OPT: */ diff --git a/tests/journal/control.i b/tests/journal/control.i index 6a365c6c81a98cc996f01ef7b0a2117caf37cd7c..c18372e0716882a5fed2cab7451138cd9ac98841 100644 --- a/tests/journal/control.i +++ b/tests/journal/control.i @@ -1,14 +1,14 @@ /* run.config COMMENT: do not compare generated journals since they depend on current time PLUGIN: @EVA_PLUGINS@ - EXECNOW: BIN control_journal.ml @frama-c@ @PTEST_FILE@ -journal-enable -eva -deps -out @EVA_OPTIONS@ -main f -journal-name control_journal.ml > @DEV_NULL@ 2> @DEV_NULL@ - OPT: -load-script control_journal.ml + EXECNOW: BIN control_journal.ml @frama-c@ @PTEST_FILE@ -journal-enable -eva -deps -out @EVA_OPTIONS@ -main f -journal-name @PTEST_RESULT@/control_journal.ml > @DEV_NULL@ 2> @DEV_NULL@ + OPT: -load-script @PTEST_RESULT@/control_journal.ml MODULE: - EXECNOW: BIN control_journal_bis.ml cp control_journal.ml control_journal_bis.ml > @DEV_NULL@ 2> @DEV_NULL@ - OPT: -calldeps -load-script control_journal_bis.ml + EXECNOW: BIN control_journal_bis.ml cp @PTEST_RESULT@/control_journal.ml @PTEST_RESULT@/control_journal_bis.ml > @DEV_NULL@ 2> @DEV_NULL@ + OPT: -calldeps -load-script @PTEST_RESULT@/control_journal_bis.ml MODULE: abstract_cpt use_cpt - EXECNOW: BIN abstract_cpt_journal.ml @frama-c@ -journal-enable -journal-name abstract_cpt_journal.ml > @DEV_NULL@ 2> @DEV_NULL@ - OPT: -load-script abstract_cpt_journal.ml + EXECNOW: BIN abstract_cpt_journal.ml @frama-c@ -journal-enable -journal-name @PTEST_RESULT@/abstract_cpt_journal.ml > @DEV_NULL@ 2> @DEV_NULL@ + OPT: -load-script @PTEST_RESULT@/abstract_cpt_journal.ml */ int x,y,c,d; diff --git a/tests/misc/my_visitor.c b/tests/misc/my_visitor.c index 9ce70834706be3ccc9798f57e77d6e9e52258308..67f7b93d4e96b40a03ccf1b3824d21104de6992e 100644 --- a/tests/misc/my_visitor.c +++ b/tests/misc/my_visitor.c @@ -1,8 +1,10 @@ /* run.config -EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs -EXECNOW: LOG my_visitor_sav.res LOG my_visitor_sav.err BIN my_visitor.sav FRAMAC_PLUGIN=./lib/plugins @frama-c@ @PTEST_FILE@ -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -main f -save @PTEST_DIR@/@PTEST_NAME@.sav > @PTEST_DIR@/result/@PTEST_NAME@_sav.res 2> @PTEST_DIR@/result/@PTEST_NAME@_sav.err -OPT: -load @PTEST_DIR@/@PTEST_NAME@.sav -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -no-my-visitor -print -OPT: -load @PTEST_DIR@/@PTEST_NAME@.sav -no-autoload-plugins -print + PLUGIN: + MODULE: @PTEST_NAME@ + EXECNOW: LOG my_visitor_sav.res LOG my_visitor_sav.err BIN my_visitor.sav @frama-c@ @PTEST_FILE@ -main f -save @PTEST_DIR@/@PTEST_NAME@.sav > @PTEST_DIR@/result/@PTEST_NAME@_sav.res 2> @PTEST_DIR@/result/@PTEST_NAME@_sav.err + OPT: -load @PTEST_DIR@/@PTEST_NAME@.sav -no-my-visitor -print + MODULE: + OPT: -load @PTEST_DIR@/@PTEST_NAME@.sav -print */ int f() { int y = 0; diff --git a/tests/slicing/horwitz.i b/tests/slicing/horwitz.i index d12de9261ad6bc3aeafd7a22b559eb3ecb9ade0e..74125fa8ac32f3fcc4fb0a7d90bc25cda6d07e58 100644 --- a/tests/slicing/horwitz.i +++ b/tests/slicing/horwitz.i @@ -1,9 +1,9 @@ /* run.config - EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs - CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs + MODULE: libSelect @PTEST_NAME@ OPT: @EVA_OPTIONS@ -deps -slicing-level 0 -journal-disable */ + /* bin/toplevel.opt -deps -eva @PTEST_DIR@/@PTEST_NAME@.c */ /* bin/toplevel.opt -deps -pdg-debug -pdg @PTEST_DIR@/@PTEST_NAME@.c */ /* cf aussi @PTEST_DIR@/@PTEST_NAME@.ml */