Ejemplo n.º 1
0
void BenchmarkCodeCompletion::initTestCase()
{
    AutoTestShell::init();
    TestCore* core = new TestCore();
    core->initialize(KDevelop::Core::NoUi);

    DUChain::self()->disablePersistentStorage();

    // make sure we have a valid duchain for the global file
    DUChainReadLocker lock(DUChain::lock());
    if ( !DUChain::self()->chainForDocument(internalFunctionFile()) ) {
        kDebug() << "no internal function file found in DUChain, loading it manually";
        QString fileName = internalFunctionFile().str();
        QString mimeType = KMimeType::findByPath(fileName, 0, false)->name ();
        QIODevice* file = KFilterDev::deviceForFile (fileName, mimeType, false);
        if ( !file->open(QIODevice::ReadOnly) ) {
            kDebug() << "Could not open file" << fileName;
            return;
        }
        lock.unlock();
        parseAdditionalFile(internalFunctionFile(), file->readAll());
        delete file;
        DUChain::self()->storeToDisk();
    }
}
Ejemplo n.º 2
0
void TestParseJob::initTestCase()
{
    AutoTestShell::init();
    TestCore* core = TestCore::initialize(Core::NoUi);
    m_projectController = new TestProjectController(core);
    core->setProjectController(m_projectController);
}
Ejemplo n.º 3
0
void TestDUChainMultipleFiles::initTestCase()
{
    DUChainTestBase::initTestCase();
    TestCore* core = dynamic_cast<TestCore*>(ICore::self());
    Q_ASSERT(core);
    m_projectController = new TestProjectController(core);
    core->setProjectController(m_projectController);
}
Ejemplo n.º 4
0
void TestCore::initialize( Core::Setup mode, const QString& session )
{
    qRegisterMetaType<KUrl::List>("KUrl::List");

    if (!Core::m_self) {
        new TestCore;
    }

    TestCore* core = dynamic_cast<TestCore*>(Core::m_self);
    Q_ASSERT(core);
    core->initializeNonStatic(mode, session);

    if (mode == Default) {
        // we don't want the window to be visible, hide it
        // the unit tests should work anyways
        core->uiController()->activeMainWindow()->hide();
    }
}