| 41 | return true; |
| 42 | } |
| 43 | bool runTests(const QVariantMap& testData, T object) |
| 44 | { |
| 45 | QVariantMap expectedFails = expectedFailures(testData); |
| 46 | QVariantMap::const_iterator it; |
| 47 | DelayedOutput::Delay delay(&DelayedOutput::self()); |
| 48 | for (it = testData.begin(); it != testData.end(); ++it) { |
| 49 | if (it.key() == EXPECT_FAIL()) |
| 50 | continue; |
| 51 | |
| 52 | QString result = m_testFunctions.value(it.key(), &TestSuite<T>::noSuchTest)(it.value(), object); |
| 53 | QString expectedFailure = expectedFails.value(it.key(), QString()).toString(); |
| 54 | |
| 55 | //Either ("expected failure" & "no result failure") or ("no expected failure" & "result failure") |
| 56 | if (expectedFailure.isEmpty() ^ result.isEmpty()) { |
| 57 | DelayedOutput::self().push(result.isEmpty() ? FAILED_TO_FAIL().arg(it.key(), expectedFailure, |
| 58 | objectInformation(object)) : |
| 59 | FAIL().arg(it.key(), result, objectInformation(object))); |
| 60 | return false; |
| 61 | } |
| 62 | |
| 63 | if (!expectedFailure.isEmpty()) |
| 64 | qDebug() << EXPECTED_FAIL().arg(it.key(), expectedFailure, objectInformation(object)).toUtf8().data(); |
| 65 | } |
| 66 | |
| 67 | return true; |
| 68 | } |
| 69 | |
| 70 | private: |
| 71 | QVariantMap expectedFailures(const QVariantMap& testData) |
no test coverage detected