From 723a56f418cc19845e1f6281ab19b8f58f44eed2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 19 Apr 2010 12:33:53 +0200 Subject: [tst_bic] Cache the compilation results for a faster testing --- tests/auto/bic/tst_bic.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/auto/bic/tst_bic.cpp') diff --git a/tests/auto/bic/tst_bic.cpp b/tests/auto/bic/tst_bic.cpp index 18dce58962..cc4f65866a 100644 --- a/tests/auto/bic/tst_bic.cpp +++ b/tests/auto/bic/tst_bic.cpp @@ -59,6 +59,8 @@ public: tst_Bic(); QBic::Info getCurrentInfo(const QString &libName); + QHash cachedCurrentInfo; + private slots: void initTestCase_data(); void initTestCase(); @@ -154,7 +156,6 @@ void tst_Bic::initTestCase_data() QTest::newRow("QtWebKit") << "QtWebKit"; QTest::newRow("QtXml") << "QtXml"; QTest::newRow("QtXmlPatterns") << "QtXmlPatterns"; - } void tst_Bic::initTestCase() @@ -210,6 +211,10 @@ void tst_Bic::sizesAndVTables_data() QBic::Info tst_Bic::getCurrentInfo(const QString &libName) { + QBic::Info &inf = cachedCurrentInfo[libName]; + if (!inf.classSizes.isEmpty()) + return inf; + QTemporaryFile tmpQFile; tmpQFile.open(); QString tmpFileName = tmpQFile.fileName(); @@ -269,7 +274,7 @@ QBic::Info tst_Bic::getCurrentInfo(const QString &libName) } QString resultFileName = files.first(); - QBic::Info inf = bic.parseFile(resultFileName); + inf = bic.parseFile(resultFileName); QFile::remove(resultFileName); tmpQFile.close(); -- cgit v1.2.3