Commit 2b683f0b authored by POTTIER Francois's avatar POTTIER Francois

Introduce --create-expected and --verbosity.

parent 4689ca8a
OCAMLBUILD := ocamlbuild -use-ocamlfind -classic-display
TARGET := test.byte
.PHONY: all test clean
.PHONY: all test expected clean
all:
$(OCAMLBUILD) $(TARGET)
test: all
$(MAKE) -C ../../src bootstrap
./$(TARGET)
./$(TARGET) --verbosity 1
expected: all
$(MAKE) -C ../../src bootstrap
./$(TARGET) --verbosity 1 --create-expected
clean:
rm -f *~ *.native *.byte
......
......@@ -5,17 +5,39 @@ open Filename
open Printf
open Auxiliary
(* TEMPORARY:
-- set the verbosity on the command line
-- allow running just one test?
(* TODO:
-- also check the contents of .conflicts and .automaton?
-- run menhir --explain with -lg 2 -la 2 -lc 2
*)
(* -------------------------------------------------------------------------- *)
(* Settings. *)
let create_expected =
true
ref false
let verbosity =
ref 0
let usage =
sprintf "Usage: %s\n" argv.(0)
let spec = Arg.align [
"--create-expected", Arg.Set create_expected,
" recreate the expected-output files";
"--verbosity", Arg.Int ((:=) verbosity),
" set the verbosity level (0-2)";
]
let () =
Arg.parse spec (fun _ -> ()) usage
let create_expected =
!create_expected
let verbosity =
!verbosity
(* -------------------------------------------------------------------------- *)
......@@ -25,9 +47,6 @@ let create_expected =
1 shows some progress messages;
2 is maximal verbosity. *)
let verbosity =
1
let log level format =
kprintf (fun s ->
if level <= verbosity then
......
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