MCPcopy Create free account
hub / github.com/KDE/kdevelop / runTests

Function runTests

kdevplatform/tests/json/testsuite.h:43–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
70private:
71 QVariantMap expectedFailures(const QVariantMap& testData)

Callers 2

visitMethod · 0.85
ContextTestFunction · 0.85

Calls 15

EXPECT_FAILFunction · 0.85
FAILED_TO_FAILFunction · 0.85
objectInformationFunction · 0.85
FAILFunction · 0.85
EXPECTED_FAILFunction · 0.85
runTestsMethod · 0.80
QStringClass · 0.50
beginMethod · 0.45
endMethod · 0.45
keyMethod · 0.45
valueMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected