It suddenly dawned on my otherwise benighted cogitatation-device a few days ago, that a good answer to the problem of adding more regression tests to Emdros would be to have a file, in which MQL queries and their expected output were placed together.

Last night I designed a simple little file format which fits this need.  It is processed with a small Python script to a C++ header file containing an array of QueryAnswer objects. A QueryAnswer is an object that holds both a query and its expected answer, along with a few booleans such as whether a compiler error is expected, and whether to create a new database before this query starts.

I then proceeded to adding more than 135 regression tests. As a result, I caught five obscure bugs in Emdros. Most of the bugs are so obscure that it is unlikely that many would have run into these bugs.  Except for one of them, which involved a segfault on queries of the type GET OBJECTS HAVING MONADS IN [myObjectType GET ALL], the operative clause being "GET ALL".

Most of the MQL engine is now tested with the regression test machinery, including most error messages. The machinery even checks that the correct/expected error message is emitted in case an error is expected.  Although I should say, the statement that "most" of the MQL engine is tested remains a conjecture.  Hence, I look forward to trying with gcov to see what the real percentage of coverage is.