Fatal error: exception Failure("Unrecognised qtest pragma: ` T foo'")
You have written something like (*$ T foo; there must not be any space between (*$ and the pragma.
Warning: likely qtest syntax error: `(* $T foo'. Done.
Self-explanatory; if $ is the first real character of a comment, it’s likely a mistyped qtest pragma. This is only a warning though.
Fatal error: exception Core.Bad_header_char("M", "Mod.foo")
You have used a qualified name in a header, for instance (*$T Mod.foo. You cannot do that, the name must be unqualified and defined under the local scope. Furthermore, it must be public, unless you have used pragmas to deal with private functions.
Error: Comment not terminated Fatal error: exception Core.Unterminated_test(_, 0)
Most probably, you forgot the comment-closing *) to close some test.
Fatal error: exception Failure("runaway test body terminator: n))*)")
The comment-closing *) must be on a line of its own; or, put another way, every statement must be ended by a line break.