QList<ProjectExplorer::Task> Qt4SymbianTargetFactory::reportIssues(const QString &proFile) { QList<ProjectExplorer::Task> results; // Warn of strange characters in project name and path: const QString projectName = proFile.mid(proFile.lastIndexOf(QLatin1Char('/')) + 1); QString projectPath = proFile.left(proFile.lastIndexOf(QLatin1Char('/'))); #if defined (Q_OS_WIN) if (projectPath.at(1) == QLatin1Char(':') && projectPath.at(0).toUpper() >= QLatin1Char('A') && projectPath.at(0).toUpper() <= QLatin1Char('Z')) projectPath.remove(0, 2); #endif if (projectPath.contains(QLatin1Char(' '))) { results.append(Task(Task::Warning, QCoreApplication::translate("ProjectExplorer::Internal::S60ProjectChecker", "The Symbian tool chain does not handle spaces " "in the project path '%1'.").arg(projectPath), Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); } if (projectName.contains(QRegExp(QLatin1String("[^a-zA-Z0-9.-]")))) { results.append(Task(Task::Warning, QCoreApplication::translate("ProjectExplorer::Internal::S60ProjectChecker", "The Symbian tool chain does not handle special " "characters in the project name '%1' well.") .arg(projectName), Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); } return results; }
void QtSupportPlugin::testQtOutputParser_data() { QTest::addColumn<QString>("input"); QTest::addColumn<OutputParserTester::Channel>("inputChannel"); QTest::addColumn<QString>("childStdOutLines"); QTest::addColumn<QString>("childStdErrLines"); QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); QTest::addColumn<QString>("outputLines"); QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT << QString::fromLatin1("Sometext\n") << QString() << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through stderr") << QString::fromLatin1("Sometext") << OutputParserTester::STDERR << QString() << QString::fromLatin1("Sometext\n") << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through gcc infos") << QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n" "../../scriptbug/main.cpp: At global scope:\n" "../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n" "../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n" "../../scriptbug/main.cpp:22: instantiated from here") << OutputParserTester::STDERR << QString() << QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n" "../../scriptbug/main.cpp: At global scope:\n" "../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n" "../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n" "../../scriptbug/main.cpp:22: instantiated from here\n") << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("moc warning") << QString::fromLatin1("..\\untitled\\errorfile.h:0: Warning: No relevant classes found. No output generated.") << OutputParserTester::STDERR << QString() << QString() << (QList<ProjectExplorer::Task>() << Task(Task::Warning, QLatin1String("No relevant classes found. No output generated."), QLatin1String("..\\untitled\\errorfile.h"), 0, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); QTest::newRow("moc warning 2") << QString::fromLatin1("c:\\code\\test.h(96): Warning: Property declaration ) has no READ accessor function. The property will be invalid.") << OutputParserTester::STDERR << QString() << QString() << (QList<ProjectExplorer::Task>() << Task(Task::Warning, QLatin1String("Property declaration ) has no READ accessor function. The property will be invalid."), QLatin1String("c:\\code\\test.h"), 96, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); }
void MaemoDebianPackageCreationStep::checkProjectName() { const QRegExp legalName(QLatin1String("[0-9-+a-z\\.]+")); if (!legalName.exactMatch(project()->displayName())) { emit addTask(Task(Task::Warning, tr("Your project name contains characters not allowed in " "Debian packages.\nThey must only use lower-case letters, " "numbers, '-', '+' and '.'.\n""We will try to work around that, " "but you may experience problems."), QString(), -1, TASK_CATEGORY_BUILDSYSTEM)); } }
void QMakeParser::stdError(const QString &line) { QString lne = rightTrimmed(line); if (lne.startsWith(QLatin1String("Project ERROR:"))) { const QString description = lne.mid(15); emit addTask(Task(Task::Error, description, Utils::FileName() /* filename */, -1 /* linenumber */, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); return; } if (lne.startsWith(QLatin1String("Project WARNING:"))) { const QString description = lne.mid(17); emit addTask(Task(Task::Warning, description, Utils::FileName() /* filename */, -1 /* linenumber */, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); return; } if (m_error.indexIn(lne) > -1) { QString fileName = m_error.cap(1); Task::TaskType type = Task::Error; if (fileName.startsWith(QLatin1String("WARNING: "))) { type = Task::Warning; fileName = fileName.mid(9); } else if (fileName.startsWith(QLatin1String("ERROR: "))) { fileName = fileName.mid(7); } emit addTask(Task(type, m_error.cap(3) /* description */, Utils::FileName::fromUserInput(fileName), m_error.cap(2).toInt() /* line */, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); return; } IOutputParser::stdError(line); }
void QtSupportPlugin::testQtOutputParser_data() { QTest::addColumn<QString>("input"); QTest::addColumn<OutputParserTester::Channel>("inputChannel"); QTest::addColumn<QString>("childStdOutLines"); QTest::addColumn<QString>("childStdErrLines"); QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); QTest::addColumn<QString>("outputLines"); QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT << QString::fromLatin1("Sometext\n") << QString() << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through stderr") << QString::fromLatin1("Sometext") << OutputParserTester::STDERR << QString() << QString::fromLatin1("Sometext\n") << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through gcc infos") << QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n" "../../scriptbug/main.cpp: At global scope:\n" "../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n" "../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n" "../../scriptbug/main.cpp:22: instantiated from here") << OutputParserTester::STDERR << QString() << QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n" "../../scriptbug/main.cpp: At global scope:\n" "../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n" "../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n" "../../scriptbug/main.cpp:22: instantiated from here\n") << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("qdoc warning") << QString::fromLatin1("/home/user/dev/qt5/qtscript/src/script/api/qscriptengine.cpp:295: warning: Can't create link to 'Object Trees & Ownership'") << OutputParserTester::STDERR << QString() << QString() << (QList<ProjectExplorer::Task>() << Task(Task::Warning, QLatin1String("Can't create link to 'Object Trees & Ownership'"), Utils::FileName::fromUserInput(QLatin1String("/home/user/dev/qt5/qtscript/src/script/api/qscriptengine.cpp")), 295, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); QTest::newRow("moc warning") << QString::fromLatin1("..\\untitled\\errorfile.h:0: Warning: No relevant classes found. No output generated.") << OutputParserTester::STDERR << QString() << QString() << (QList<ProjectExplorer::Task>() << Task(Task::Warning, QLatin1String("No relevant classes found. No output generated."), Utils::FileName::fromUserInput(QLatin1String("..\\untitled\\errorfile.h")), 0, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); QTest::newRow("moc warning 2") << QString::fromLatin1("c:\\code\\test.h(96): Warning: Property declaration ) has no READ accessor function. The property will be invalid.") << OutputParserTester::STDERR << QString() << QString() << (QList<ProjectExplorer::Task>() << Task(Task::Warning, QLatin1String("Property declaration ) has no READ accessor function. The property will be invalid."), Utils::FileName::fromUserInput(QLatin1String("c:\\code\\test.h")), 96, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); QTest::newRow("ninja with moc") << QString::fromLatin1("E:/sandbox/creator/loaden/src/libs/utils/iwelcomepage.h(54): Error: Undefined interface") << OutputParserTester::STDERR << QString() << QString() << (QList<ProjectExplorer::Task>() << Task(Task::Error, QLatin1String("Undefined interface"), Utils::FileName::fromUserInput(QLatin1String("E:/sandbox/creator/loaden/src/libs/utils/iwelcomepage.h")), 54, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); }
void QmakeProjectManagerPlugin::testQmakeOutputParsers_data() { const Core::Id categoryBuildSystem = Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); QTest::addColumn<QString>("input"); QTest::addColumn<OutputParserTester::Channel>("inputChannel"); QTest::addColumn<QString>("childStdOutLines"); QTest::addColumn<QString>("childStdErrLines"); QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); QTest::addColumn<QString>("outputLines"); QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT << QString::fromLatin1("Sometext\n") << QString() << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through stderr") << QString::fromLatin1("Sometext") << OutputParserTester::STDERR << QString() << QString::fromLatin1("Sometext\n") << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("qMake error") << QString::fromLatin1("Project ERROR: undefined file") << OutputParserTester::STDERR << QString() << QString() << (QList<ProjectExplorer::Task>() << Task(Task::Error, QLatin1String("undefined file"), Utils::FileName(), -1, categoryBuildSystem)) << QString(); QTest::newRow("qMake Parse Error") << QString::fromLatin1("e:\\project.pro:14: Parse Error ('sth odd')") << OutputParserTester::STDERR << QString() << QString() << (QList<ProjectExplorer::Task>() << Task(Task::Error, QLatin1String("Parse Error ('sth odd')"), Utils::FileName::fromUserInput(QLatin1String("e:\\project.pro")), 14, categoryBuildSystem)) << QString(); QTest::newRow("qMake warning") << QString::fromLatin1("Project WARNING: bearer module might require ReadUserData capability") << OutputParserTester::STDERR << QString() << QString() << (QList<ProjectExplorer::Task>() << Task(Task::Warning, QLatin1String("bearer module might require ReadUserData capability"), Utils::FileName(), -1, categoryBuildSystem)) << QString(); QTest::newRow("qMake warning with location") << QString::fromLatin1("WARNING: e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl:1: Unescaped backslashes are deprecated.") << OutputParserTester::STDERR << QString() << QString() << (QList<ProjectExplorer::Task>() << Task(Task::Warning, QLatin1String("Unescaped backslashes are deprecated."), Utils::FileName::fromUserInput(QLatin1String("e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl")), 1, categoryBuildSystem)) << QString(); }