diff --git a/plugins/clang/util/clangdebug.cpp b/plugins/clang/util/clangdebug.cpp index d7e21514be..109a22f7cc 100644 --- a/plugins/clang/util/clangdebug.cpp +++ b/plugins/clang/util/clangdebug.cpp @@ -1,71 +1,71 @@ /* * Copyright 2014 Kevin Funk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "clangdebug.h" #include "clangtypes.h" #include #include const QtMsgType defaultMsgType = QtInfoMsg; -Q_LOGGING_CATEGORY(KDEV_CLANG, "kdevelop.languages.clang", defaultMsgType) +Q_LOGGING_CATEGORY(KDEV_CLANG, "kdevelop.plugins.clang", defaultMsgType) using namespace KDevelop; QDebug operator<<(QDebug dbg, CXString string) { dbg << ClangString(string).c_str(); return dbg; } QDebug operator<<(QDebug dbg, CXSourceLocation location) { dbg << DocumentCursor(ClangLocation(location)); return dbg; } QDebug operator<<(QDebug dbg, CXSourceRange range) { dbg << ClangRange(range).toDocumentRange(); return dbg; } QDebug operator<<(QDebug dbg, CXCursor cursor) { return dbg << clang_getCursorKind(cursor) << clang_getCursorDisplayName(cursor) << clang_getCursorType(cursor) << clang_getCursorLocation(cursor); } QDebug operator<<(QDebug dbg, CXCursorKind kind) { return dbg << clang_getCursorKindSpelling(kind); } QDebug operator<<(QDebug dbg, CXType type) { return dbg << type.kind << clang_getTypeSpelling(type); } QDebug operator<<(QDebug dbg, CXTypeKind typeKind) { return dbg << clang_getTypeKindSpelling(typeKind); } diff --git a/plugins/docker/tests/test_docker.cpp b/plugins/docker/tests/test_docker.cpp index 8dee9f16d7..20cca1cef3 100644 --- a/plugins/docker/tests/test_docker.cpp +++ b/plugins/docker/tests/test_docker.cpp @@ -1,153 +1,153 @@ /*************************************************************************** * This file was partly taken from KDevelop's cvs plugin * * Copyright 2017 Aleix Pol Gonzalez * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * * published by the Free Software Foundation; either version 2 of * * the License or (at your option) version 3 or any later version * * accepted by the membership of KDE e.V. (or its successor approved * * by the membership of KDE e.V.), which shall act as a proxy * * defined in Section 14 of version 3 of the license. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include using namespace KDevelop; static QString s_testedImage = QStringLiteral("ubuntu:17.04"); class DockerTest: public QObject { Q_OBJECT public: DockerTest() { - QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false\ndefault.debug=true\nkdevplatform.plugins.docker=true\n")); + QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false\ndefault.debug=true\nkdevelop.plugins.docker=true\n")); } IRuntime* m_initialRuntime = nullptr; private Q_SLOTS: void initTestCase() { auto ret = QProcess::execute("docker", {"pull", s_testedImage}); if (ret != 0) { QSKIP("Couldn't successfully call docker"); return; } AutoTestShell::init({QStringLiteral("kdevdocker"), QStringLiteral("KDevGenericManager")}); TestCore::initialize(); m_initialRuntime = ICore::self()->runtimeController()->currentRuntime(); auto plugin = ICore::self()->pluginController()->loadPlugin("kdevdocker"); QVERIFY(plugin); QSignalSpy spy(plugin, SIGNAL(imagesListed())); QVERIFY(spy.wait()); auto projectPath = QUrl::fromLocalFile(QFINDTESTDATA("testproject/test.kdev4")); TestCore::self()->projectController()->openProject(projectPath); QSignalSpy spy2(TestCore::self()->projectController(), &IProjectController::projectOpened); QVERIFY(spy2.wait()); } void init() { QVERIFY(ICore::self()->runtimeController()->currentRuntime() == m_initialRuntime); const auto& availableRuntimes = ICore::self()->runtimeController()->availableRuntimes(); for (IRuntime* runtime : availableRuntimes) { if (s_testedImage == runtime->name()) { ICore::self()->runtimeController()->setCurrentRuntime(runtime); } } QVERIFY(ICore::self()->runtimeController()->currentRuntime() != m_initialRuntime); } void paths() { auto rt = ICore::self()->runtimeController()->currentRuntime(); QVERIFY(rt); const Path root("/"); const Path hostDir = rt->pathInHost(root); QCOMPARE(root, rt->pathInRuntime(hostDir)); } void projectPath() { auto rt = ICore::self()->runtimeController()->currentRuntime(); QVERIFY(rt); auto project = ICore::self()->projectController()->projects().first(); QVERIFY(project); const Path file = project->projectItem()->folder()->fileList().first()->path(); const Path fileRuntime = rt->pathInRuntime(file); QCOMPARE(fileRuntime, Path("/src/test/testfile.sh")); QCOMPARE(rt->pathInHost(fileRuntime), file); QCOMPARE(project->path(), rt->pathInHost(rt->pathInRuntime(project->path()))); } void projectDirectory() { auto rt = ICore::self()->runtimeController()->currentRuntime(); QVERIFY(rt); auto project = ICore::self()->projectController()->projects().first(); QVERIFY(project); const Path projectDir = project->path(); const Path dirRuntime = rt->pathInRuntime(projectDir); QCOMPARE(dirRuntime, Path("/src/test/")); QCOMPARE(rt->pathInHost(dirRuntime), projectDir); QCOMPARE(project->path(), rt->pathInHost(rt->pathInRuntime(project->path()))); } void envs() { auto rt = ICore::self()->runtimeController()->currentRuntime(); QVERIFY(rt); QCOMPARE(rt->getenv("PATH"), QByteArray("/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")); } void runProcess() { auto rt = ICore::self()->runtimeController()->currentRuntime(); QVERIFY(rt); auto project = ICore::self()->projectController()->projects().first(); QVERIFY(project); const Path projectPath = rt->pathInRuntime(project->path()); QProcess process; process.setProgram("ls"); process.setArguments({projectPath.toLocalFile()}); rt->startProcess(&process); QVERIFY(process.waitForFinished()); QCOMPARE(process.exitCode(), 0); QCOMPARE(process.readAll(), QByteArray("test.kdev4\ntestfile.sh\n")); } void cleanup() { ICore::self()->runtimeController()->setCurrentRuntime(m_initialRuntime); } }; QTEST_MAIN( DockerTest ) #include "test_docker.moc" diff --git a/plugins/subversion/tests/test_svnimport.cpp b/plugins/subversion/tests/test_svnimport.cpp index 41393f46a7..c5b3084d48 100644 --- a/plugins/subversion/tests/test_svnimport.cpp +++ b/plugins/subversion/tests/test_svnimport.cpp @@ -1,166 +1,166 @@ /*************************************************************************** * This file is part of KDevelop * * Copyright 2009 Fabian Wiesel * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "test_svnimport.h" #include #include #include #include #include #include #include #include #include #include #include #define VERBOSE #if defined(VERBOSE) #define TRACE(X) qDebug() << X #else #define TRACE(X) { line = line; } #endif using namespace KDevelop; void validatingExecJob(VcsJob* j, VcsJob::JobStatus status = VcsJob::JobSucceeded) { QVERIFY(j); if (!j->exec()) { qDebug() << j->errorString(); // On error, wait for key in order to allow manual state inspection } QCOMPARE(j->status(), status); } void setupLocalRepository( const QString& name, VcsLocation & reposLoc ) { KProcess cmd; cmd.setWorkingDirectory(name); cmd << QStringLiteral("svnadmin") << QStringLiteral("create") << name; QCOMPARE(cmd.execute(10000), 0); reposLoc.setRepositoryServer("file://" + name ); } void setupSampleProject( const QString& name, const QString& content ) { QFile sampleFile( name + "/sample.file" ); sampleFile.open( QIODevice::WriteOnly ); sampleFile.write( content.toUtf8() ); sampleFile.close(); } void TestSvnImport::initTestCase() { - QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false\ndefault.debug=true\nkdevplatform.plugins.svn.debug=true\n")); + QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false\ndefault.debug=true\nkdevelop.plugins.svn.debug=true\n")); AutoTestShell::init({QStringLiteral("kdevsubversion"), QStringLiteral("KDevStandardOutputView")}); TestCore::initialize(); const QList plugins = Core::self()->pluginController()->allPluginsForExtension(QStringLiteral("org.kdevelop.IBasicVersionControl")); for (IPlugin* p : plugins) { qDebug() << "checking plugin" << p; ICentralizedVersionControl* icentr = p->extension(); if (!icentr) continue; if (icentr->name() == QLatin1String("Subversion")) { vcs = icentr; break; } } qDebug() << "ok, got vcs" << vcs; QVERIFY(vcs); } void TestSvnImport::cleanupTestCase() { TestCore::shutdown(); } void TestSvnImport::testBasic() { QTemporaryDir reposDir; VcsLocation reposLoc; setupLocalRepository( reposDir.path(), reposLoc ); QTemporaryDir projectDir; QString origcontent = QStringLiteral("This is a Test"); setupSampleProject( projectDir.path(), origcontent ); VcsJob* job = vcs->import( QStringLiteral("import test"), QUrl::fromLocalFile( projectDir.path() ), reposLoc ); validatingExecJob(job); QTemporaryDir checkoutDir; validateImport( reposLoc.repositoryServer(), checkoutDir, origcontent ); } void TestSvnImport::testImportWithMissingDirs() { QTemporaryDir reposDir; VcsLocation reposLoc; setupLocalRepository( reposDir.path(), reposLoc ); QTemporaryDir projectDir; QString origcontent = QStringLiteral("This is a Test"); setupSampleProject( projectDir.path(), origcontent ); reposLoc.setRepositoryServer( reposLoc.repositoryServer() + "/foobar/" + QDir( projectDir.path() ).dirName() ); VcsJob* job = vcs->import( QStringLiteral("import test"), QUrl::fromLocalFile( projectDir.path() ), reposLoc ); validatingExecJob(job); QTemporaryDir checkoutDir; validateImport( reposLoc.repositoryServer(), checkoutDir, origcontent ); } void TestSvnImport::testImportIntoDir() { QTemporaryDir reposDir; VcsLocation reposLoc; setupLocalRepository( reposDir.path(), reposLoc ); QTemporaryDir projectDir; QString origcontent = QStringLiteral("This is a Test"); setupSampleProject( projectDir.path(), origcontent ); reposLoc.setRepositoryServer( reposLoc.repositoryServer() + '/' + QDir( projectDir.path() ).dirName() ); VcsJob* job = vcs->import( QStringLiteral("import test"), QUrl::fromLocalFile( projectDir.path() ), reposLoc ); validatingExecJob(job); QTemporaryDir checkoutDir; validateImport( reposLoc.repositoryServer(), checkoutDir, origcontent ); } void TestSvnImport::validateImport( const QString& repourl, QTemporaryDir& checkoutdir, const QString& origcontent ) { VcsLocation reposLoc; reposLoc.setRepositoryServer( repourl ); VcsJob* job = vcs->createWorkingCopy( reposLoc, QUrl::fromLocalFile(checkoutdir.path()) ); validatingExecJob(job); QFile newfile( checkoutdir.path() + "/sample.file" ); QVERIFY(newfile.exists()); QVERIFY(newfile.open(QIODevice::ReadOnly)); QCOMPARE(QString::fromUtf8( newfile.readAll() ), origcontent); } QTEST_MAIN(TestSvnImport)