aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Tassi2015-05-29 15:41:15 +0200
committerEnrico Tassi2015-05-29 15:44:47 +0200
commite47c30bf431f3c8160b41384eedb538ba16578d0 (patch)
tree24cfa371ee2aa5ed996a88af9346ff448d150d99
parentf63c0cdd3c7da642e505569e83199784bbfdc367 (diff)
Flag -test-mode intended to be used for ad-hoc prints in test-suite
Of course there is an exception to the previous commit. Fail used to print even if silenced but loading a vernac file. This behavior is useful only in tests, hence this flag.
-rw-r--r--lib/flags.ml2
-rw-r--r--lib/flags.mli2
-rw-r--r--test-suite/Makefile2
-rw-r--r--toplevel/coqtop.ml1
-rw-r--r--toplevel/vernacentries.ml2
5 files changed, 7 insertions, 2 deletions
diff --git a/lib/flags.ml b/lib/flags.ml
index 313da0c5bd..009caa9dee 100644
--- a/lib/flags.ml
+++ b/lib/flags.ml
@@ -48,6 +48,8 @@ let batch_mode = ref false
type compilation_mode = BuildVo | BuildVio | Vio2Vo
let compilation_mode = ref BuildVo
+let test_mode = ref false
+
type async_proofs = APoff | APonLazy | APon
let async_proofs_mode = ref APoff
type cache = Force
diff --git a/lib/flags.mli b/lib/flags.mli
index 1f68a88f3a..544e2a72ae 100644
--- a/lib/flags.mli
+++ b/lib/flags.mli
@@ -15,6 +15,8 @@ val batch_mode : bool ref
type compilation_mode = BuildVo | BuildVio | Vio2Vo
val compilation_mode : compilation_mode ref
+val test_mode : bool ref
+
type async_proofs = APoff | APonLazy | APon
val async_proofs_mode : async_proofs ref
type cache = Force
diff --git a/test-suite/Makefile b/test-suite/Makefile
index cffbe48196..476d850ac9 100644
--- a/test-suite/Makefile
+++ b/test-suite/Makefile
@@ -30,7 +30,7 @@
BIN := ../bin/
LIB := ..
-coqtop := $(BIN)coqtop -boot -q -batch -R prerequisite TestSuite
+coqtop := $(BIN)coqtop -boot -q -batch -test-mode -R prerequisite TestSuite
bincoqc := $(BIN)coqc -coqlib $(LIB) -R prerequisite TestSuite
bincoqchk := $(BIN)coqchk -coqlib $(LIB) -R prerequisite TestSuite
diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml
index 826381028d..81e04525c8 100644
--- a/toplevel/coqtop.ml
+++ b/toplevel/coqtop.ml
@@ -499,6 +499,7 @@ let parse_args arglist =
|"-async-proofs-never-reopen-branch" ->
Flags.async_proofs_never_reopen_branch := true;
|"-batch" -> set_batch_mode ()
+ |"-test-mode" -> test_mode := true
|"-beautify" -> make_beautify true
|"-boot" -> boot := true; no_load_rc ()
|"-bt" -> Backtrace.record_backtrace true
diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml
index 61ebc9bbe6..188d2d098f 100644
--- a/toplevel/vernacentries.ml
+++ b/toplevel/vernacentries.ml
@@ -2118,7 +2118,7 @@ let with_fail b f =
| HasNotFailed ->
errorlabstrm "Fail" (str "The command has not failed!")
| HasFailed msg ->
- if is_verbose () || !Flags.ide_slave then msg_info
+ if is_verbose () || !test_mode || !ide_slave then msg_info
(str "The command has indeed failed with message:" ++ fnl () ++ msg)
| _ -> assert false
end