~ubuntu-branches/ubuntu/trusty/kdevelop/trusty

« back to all changes in this revision

Viewing changes to projectmanagers/custom-buildsystem/tests/custombuildsystemplugintest.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2013-12-09 18:54:59 UTC
  • mfrom: (1.7.19)
  • Revision ID: package-import@ubuntu.com-20131209185459-zlxv7jo7up8gthne
Tags: 4:4.6.0-0ubuntu1
* New upstream release (LP: #1259220)
* Update install files 

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <project/projectmodel.h>
37
37
#include <kconfiggroup.h>
38
38
 
 
39
#include "testconfig.h"
 
40
 
39
41
using KDevelop::Core;
40
42
using KDevelop::ICore;
41
43
using KDevelop::IProject;
43
45
using KDevelop::AutoTestShell;
44
46
using KDevelop::KDevSignalSpy;
45
47
 
46
 
void deleteDir( QDir dir )
47
 
{
48
 
    foreach( const QString& f, dir.entryList( QDir::NoDotAndDotDot | QDir::AllEntries ) ) {
49
 
        if( QFileInfo( f ).isDir() ) {
50
 
            deleteDir( QDir( dir.absoluteFilePath( f ) ) );
51
 
            dir.rmdir( f );
52
 
        } else {
53
 
            dir.remove( f );
54
 
        }
55
 
    }
56
 
}
57
 
 
58
48
void CustomBuildSystemPluginTest::cleanupTestCase()
59
49
{
60
 
    QDir sessiondir( KDevelop::SessionController::sessionDirectory() );
61
 
    QString sessionid = m_core->activeSession()->id().toString();
62
 
    m_core->cleanup();
63
 
    delete m_core;
64
 
 
65
 
    // Delete the session dir and remove the default session entry from the config.
66
 
    deleteDir( sessiondir.absoluteFilePath( sessionid ) );
67
 
    sessiondir.rmdir( sessionid );
68
 
    KGlobal::config()->group( KDevelop::SessionController::cfgSessionGroup() ).deleteEntry( KDevelop::SessionController::cfgActiveSessionEntry() );
69
 
    KGlobal::config()->sync();
 
50
    TestCore::shutdown();
70
51
}
71
52
void CustomBuildSystemPluginTest::initTestCase()
72
53
{
73
54
    AutoTestShell::init();
74
 
    m_core = new KDevelop::TestCore();
75
 
    m_core->initialize( Core::Default );
 
55
    TestCore::initialize();
76
56
}
77
57
 
78
58
void CustomBuildSystemPluginTest::loadSimpleProject()