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

Method test

plugins/subversion/tests/test_svnrecursiveadd.cpp:109–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void TestSvnRecursiveAdd::test()
110{
111 QTemporaryDir reposDir;
112 KProcess cmd;
113 cmd.setWorkingDirectory(reposDir.path());
114 cmd << QStringLiteral("svnadmin") << QStringLiteral("create") << reposDir.path();
115 QCOMPARE(cmd.execute(10000), 0);
116 const QList<IPlugin*> plugins = Core::self()->pluginController()->allPluginsForExtension(QStringLiteral("org.kdevelop.IBasicVersionControl"));
117 IBasicVersionControl* vcs = nullptr;
118 for (IPlugin* p : plugins) {
119 qDebug() << "checking plugin" << p;
120 auto* icentr = p->extension<ICentralizedVersionControl>();
121 if (!icentr)
122 continue;
123 if (icentr->name() == QLatin1String("Subversion")) {
124 vcs = icentr;
125 break;
126 }
127 }
128 qDebug() << "ok, got vcs" << vcs;
129 QVERIFY(vcs);
130 VcsLocation reposLoc;
131 reposLoc.setRepositoryServer("file://" + reposDir.path());
132 QTemporaryDir checkoutDir;
133 QUrl checkoutLoc = QUrl::fromLocalFile(checkoutDir.path());
134 qDebug() << "Checking out from " << reposLoc.repositoryServer() << " to " << checkoutLoc;
135 qDebug() << "creating job";
136 VcsJob* job = vcs->createWorkingCopy( reposLoc, checkoutLoc );
137 validatingExecJob(job);
138 qDebug() << "filling wc";
139 fillWorkingDirectory(checkoutDir.path());
140 QUrl addUrl = QUrl::fromLocalFile( checkoutDir.path() + '/' + vcsTestDir0() );
141 qDebug() << "Recursively adding files at " << addUrl;
142 validatingExecJob(vcs->add({addUrl}, IBasicVersionControl::Recursive));
143 qDebug() << "Recursively reverting changes at " << addUrl;
144 validatingExecJob(vcs->revert({addUrl}, IBasicVersionControl::Recursive));
145}
146
147QTEST_MAIN(TestSvnRecursiveAdd)
148

Callers 1

Calls 14

fillWorkingDirectoryFunction · 0.85
vcsTestDir0Function · 0.85
pluginControllerMethod · 0.80
setRepositoryServerMethod · 0.80
repositoryServerMethod · 0.80
validatingExecJobFunction · 0.70
setWorkingDirectoryMethod · 0.45
pathMethod · 0.45
executeMethod · 0.45
nameMethod · 0.45
createWorkingCopyMethod · 0.45

Tested by

no test coverage detected