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

[ptests] first try at enabled_if in alias

parent ab4a6113
No related branches found
No related tags found
No related merge requests found
...@@ -1038,6 +1038,7 @@ module Fmt = struct ...@@ -1038,6 +1038,7 @@ module Fmt = struct
let plugin_as_package fmt s = Format.fprintf fmt "frama-c-%s" s let plugin_as_package fmt s = Format.fprintf fmt "frama-c-%s" s
let quote pr fmt s = Format.fprintf fmt "%S" (Format.asprintf "%a" pr s) let quote pr fmt s = Format.fprintf fmt "%S" (Format.asprintf "%a" pr s)
let list pr fmt l = List.iter (fun s -> Format.fprintf fmt " %a" pr s) l let list pr fmt l = List.iter (fun s -> Format.fprintf fmt " %a" pr s) l
let var_libavailable pr fmt s = Format.fprintf fmt "%%{lib-available:%a}" pr s
end end
let command_string ~result_fmt ~oracle_fmt command = let command_string ~result_fmt ~oracle_fmt command =
...@@ -1114,7 +1115,7 @@ let command_string ~result_fmt ~oracle_fmt command = ...@@ -1114,7 +1115,7 @@ let command_string ~result_fmt ~oracle_fmt command =
(targets %S %S %a)\n \ (targets %S %S %a)\n \
(deps %a %S (package frama-c)%a (universe))\n \ (deps %a %S (package frama-c)%a (universe))\n \
(action (with-stderr-to %S (with-stdout-to %S (with-accepted-exit-codes (or 0 1) (system %S)))))\n\ (action (with-stderr-to %S (with-stdout-to %S (with-accepted-exit-codes (or 0 1) (system %S)))))\n\
)\n" )@."
errlog errlog
res res
print_list command.log_files print_list command.log_files
...@@ -1123,7 +1124,8 @@ let command_string ~result_fmt ~oracle_fmt command = ...@@ -1123,7 +1124,8 @@ let command_string ~result_fmt ~oracle_fmt command =
Fmt.(list (package_as_deps (quote plugin_as_package))) command.plugins Fmt.(list (package_as_deps (quote plugin_as_package))) command.plugins
errlog errlog
res res
command_string; command_string
;
Format.fprintf result_fmt Format.fprintf result_fmt
"(rule\n \ "(rule\n \
(alias %S)\n \ (alias %S)\n \
...@@ -1158,8 +1160,12 @@ let command_string ~result_fmt ~oracle_fmt command = ...@@ -1158,8 +1160,12 @@ let command_string ~result_fmt ~oracle_fmt command =
(Filename.concat ".." (oracle_prefix ^ ".err.oracle")) (Filename.concat ".." (oracle_prefix ^ ".err.oracle"))
(log_prefix ^ ".err.log"); (log_prefix ^ ".err.log");
Format.fprintf result_fmt Format.fprintf result_fmt
"(alias (deps (alias %S)) (name ptests))\n" "(alias (deps (alias %S)) (name ptests)\
("diff-"^log_prefix); ; (enabled_if (and true %a))
)@."
("diff-"^log_prefix)
Fmt.(list (var_libavailable plugin_as_package )) command.plugins
;
Format.fprintf oracle_fmt Format.fprintf oracle_fmt
"(rule (target %S) (mode fallback) (action (write-file %S \"\")))\n" "(rule (target %S) (mode fallback) (action (write-file %S \"\")))\n"
(Filename.basename (oracle_prefix ^ ".err.oracle")) (Filename.basename (oracle_prefix ^ ".err.oracle"))
......
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