Skip to content
Snippets Groups Projects
Commit 933a4319 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[ptests] Allows arobases in options of ptests.

Juste use `@@` as in `Format` :stuck_out_tongue:
parent 7ca00ea0
No related branches found
No related tags found
No related merge requests found
...@@ -493,7 +493,7 @@ end = struct ...@@ -493,7 +493,7 @@ end = struct
end end
let macro_regex = Str.regexp "\\([^@]*\\)@\\([^@]+\\)@\\(.*\\)" let macro_regex = Str.regexp "\\([^@]*\\)@\\([^@]*\\)@\\(.*\\)"
type execnow = type execnow =
{ {
...@@ -585,15 +585,19 @@ let replace_macros macros s = ...@@ -585,15 +585,19 @@ let replace_macros macros s =
let rest = Str.matched_group 3 s in let rest = Str.matched_group 3 s in
let new_n = Str.group_end 1 in let new_n = Str.group_end 1 in
let n, new_s = let n, new_s =
try if macro = "" then begin
if !verbosity >= 2 then lock_printf "macro is %s\n%!" macro; new_n + 1, String.sub s 0 new_n ^ "@" ^ rest
let replacement = StringMap.find macro macros in end else begin
if !verbosity >= 1 then try
lock_printf "replacement for %s is %s\n%!" macro replacement; if !verbosity >= 2 then lock_printf "macro is %s\n%!" macro;
new_n, let replacement = StringMap.find macro macros in
String.sub s 0 n ^ start ^ replacement ^ rest if !verbosity >= 1 then
with lock_printf "replacement for %s is %s\n%!" macro replacement;
new_n,
String.sub s 0 n ^ start ^ replacement ^ rest
with
| Not_found -> Str.group_end 2 + 1, s | Not_found -> Str.group_end 2 + 1, s
end
in in
if !verbosity >= 2 then lock_printf "new string is %s\n%!" new_s; if !verbosity >= 2 then lock_printf "new string is %s\n%!" new_s;
let new_acc = ptest_file_matched, new_s in let new_acc = ptest_file_matched, new_s in
......
/* run.config /* run.config
EXECNOW: make -s @PTEST_DIR@/rte_api/rte_get_annot.cmxs EXECNOW: make -s @PTEST_DIR@/rte_api/rte_get_annot.cmxs
OPT: -load-module @PTEST_DIR@/rte_api/rte_get_annot -journal-disable OPT: -rte-select @@all -load-module @PTEST_DIR@/rte_api/rte_get_annot -journal-disable
*/ */
......
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