Skip to content

Commit

Permalink
[test.real] command_exist
Browse files Browse the repository at this point in the history
  • Loading branch information
FissoreD committed Nov 26, 2024
1 parent 6c7ea0c commit f93090e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test.real.ml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ let print_csv plot results =
end
| None -> ());
close_out oc;
if Sys.command "which lua5.1 &>/dev/null" = 0 && Sys.command "which gnuplot &> /dev/null" = 0 then begin
let command_exists cmd =
Sys.command ("command -v " ^ cmd ^ " 2> /dev/null || exit 1 ") = 0 in
if command_exists "lua5.1" && command_exists "gnuplot" then begin
ignore(Sys.command (plot ^ " data.csv"));
ignore(Sys.command "gnuplot data.csv.plot")
end
Expand Down

0 comments on commit f93090e

Please sign in to comment.