Fix error in TAP test logger's regex to recognize QVERIFY() output

The regex used a greedy .+ to match an actual dot and a space,
preceding an open parenthesis, with the result that if the message
contained any parentheses that .+ swallowed everything up to the last
of them. Correct the regex so that recently-added tests' error
messages show up correctly.

Change-Id: I6e52c9b2a6e7959335fcddbb4266f65b589eba68
Reviewed-by: Jason McDonald <macadder1@gmail.com>
This commit is contained in:
Edward Welbourne 2022-08-01 16:56:46 +02:00
parent 16f5132b21
commit abab3c5dad
3 changed files with 5 additions and 5 deletions

View File

@ -292,7 +292,7 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
// the expected and actual values to the loggers (yet).
static const QRegularExpression verifyRegex(
u"^'(?<actualexpression>.*)' returned "
"(?<actual>\\w+).+\\((?<message>.*)\\)$"_s);
"(?<actual>\\w+)\\. \\((?<message>.*)\\)$"_s);
static const QRegularExpression compareRegex(
u"^(?<message>.*)\n"

View File

@ -547,7 +547,7 @@ not ok 65 - verify()
not ok 66 - verify2()
---
type: QVERIFY
message: as expected, in fact)
message: 42 >= 2 (as expected, in fact)
wanted: true (opaqueFunc() < 2)
found: false (opaqueFunc() < 2)
expected: true (opaqueFunc() < 2)

View File

@ -11,7 +11,7 @@ not ok 2 - fail()
not ok 2 - fail()
---
type: QVERIFY
message: )
message: QTestEventLoop exited prematurely in cleanup()
wanted: true (loop.timeout())
found: false (loop.timeout())
expected: true (loop.timeout())
@ -35,7 +35,7 @@ not ok 3 - skip()
not ok 3 - skip()
---
type: QVERIFY
message: )
message: QTestEventLoop exited prematurely in cleanup()
wanted: true (loop.timeout())
found: false (loop.timeout())
expected: true (loop.timeout())
@ -59,7 +59,7 @@ not ok 4 - pass()
not ok 4 - pass()
---
type: QVERIFY
message: )
message: QTestEventLoop exited prematurely in cleanup()
wanted: true (loop.timeout())
found: false (loop.timeout())
expected: true (loop.timeout())