Skip to content
Snippets Groups Projects
Commit fcccfb88 authored by François Bobot's avatar François Bobot
Browse files

Merge branch 'feature/andre/ptests-print-output-on-execnow-error' into 'master'

[ptests] try to print stdout/stderr when EXECNOW fails

See merge request frama-c/frama-c!2335
parents 5a277076 60275796
No related branches found
No related tags found
No related merge requests found
...@@ -1490,7 +1490,20 @@ let do_diff = function ...@@ -1490,7 +1490,20 @@ let do_diff = function
let diff_string = !do_diffs ^ " " ^ oracle_file ^ " " ^ log_file in let diff_string = !do_diffs ^ " " ^ oracle_file ^ " " ^ log_file in
ignore (launch diff_string) ignore (launch diff_string)
| Target_error execnow -> | Target_error execnow ->
lock_printf "Custom command failed: %s@\n" execnow.ex_cmd lock_printf "Custom command failed: %s@\n" execnow.ex_cmd;
let print_redirected out redir_str =
try
ignore (Str.search_forward (Str.regexp redir_str) execnow.ex_cmd 0);
let file = Str.matched_group 1 execnow.ex_cmd in
lock_printf "%s redirected to %s:@\n" out file;
if not (Sys.file_exists file) then
lock_printf "error: file does not exist: %s:@\n" file
else
ignore (launch ("cat " ^ file));
with Not_found -> ()
in
print_redirected "stdout" "[^2]> ?\\([-a-zA-Z0-9_/.]+\\)";
print_redirected "stderr" "2> ?\\([-a-zA-Z0-9_/.]+\\)";
| Log_error(dir, file) -> | Log_error(dir, file) ->
let result_file = let result_file =
Filename.sanitize (SubDir.make_result_file dir file) Filename.sanitize (SubDir.make_result_file dir file)
......
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