Details
-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
None
-
None
-
None
Description
QEXPECT_FAIL() is sometimes abused to cover against flaky failures. It is usually done like this:
#if defined(Q_OS_WHATEVER) if (testedValue != expectedValue) QEXPECT_FAIL("", "test might fail on platform whatever because ...", Continue) #endif QCOMPARE(testedValue, expectedValue);
This is the wrong way to do it. Mostly because we don't get notified when the test starts passing. The correct way would be to mark the whole testcase in the BLACKLIST file.
Suggestion: QEXPECT_FAIL() should only be used unconditionally.
All the existing such uses should be changed to BLACKLIST. It's easy to find them by doing git grep -C9 QEXPECT_FAIL() but they are quite many, unfortunately.
Can we enforce somehow via qtestlib that QEXPECT_FAIL should never be conditioned?