Commit 2805e0fc authored by POTTIER Francois's avatar POTTIER Francois

Complete the handling of the positive tests.

parent 29a2ca0d
......@@ -9,6 +9,8 @@ open Auxiliary
-- set the verbosity on the command line
-- allow running just one test?
-- allow recreating all expected output files (just remove them and run)
-- also check the contents of .conflicts and .automaton?
-- run menhir --explain with -lg 2 -la 2 -lc 2
*)
(* -------------------------------------------------------------------------- *)
......@@ -238,6 +240,29 @@ let process_positive_test basenames : unit =
(thisfile basenames)
cmd;
(* Run menhir. *)
let out = id ^ ".out" in
let cmd = sep (
"cd" :: good :: "&&" ::
menhir :: "--explain" :: base :: flags
:: mlys basenames @ sprintf ">%s" out :: "2>&1" :: []
) in
if command cmd <> 0 then begin
let cmd = sep ["more"; good_slash out] in
fail id "menhir fails on %s.\n%s\n" (thisfile basenames) cmd
end;
(* Check that the file [exp] exists. *)
let exp = id ^ ".exp" in
check_expected good id out exp;
(* Check that the output coincides with what was expected. *)
let cmd = sep ("cd" :: good :: "&&" :: "diff" :: exp :: out :: []) in
if command (silent cmd) <> 0 then
fail id "menhir --explain accepts %s,\nbut produces incorrect output.\n(%s)\n"
(thisfile basenames)
cmd;
(* Succeed. *)
log 1 "[OK] %s\n%!" id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment