Proof of concept code for matching regular expressions on stdout and stderr.
The code is a bit messy and needs cleaning up, and there's no handling of illegal regular expressions, but the general idea is there and not too tricky.
However, I would like some feedback from you on usability. Currently there's one macro EXPECT_REGEX() that takes the source (stdout or stderr) and a regular expression.
Is there a need for two sets of macros EXPECT_REGEX() and FAIL_ON_REGEX(), or some other name suggesting the idea that the regular expression must not match? If so, should both be allowed in parallel, requiring both to be true for the test to succeed?
How about multi-line matching? Should it always match the entire output regardless of regex::m, or should it match line by line if not multi-line, and consider any match (like the exit code from grep?)
Please comment below.