diff --git a/outputview/outputfilteringstrategies.cpp b/outputview/outputfilteringstrategies.cpp --- a/outputview/outputfilteringstrategies.cpp +++ b/outputview/outputfilteringstrategies.cpp @@ -264,15 +264,15 @@ // GCC ErrorFormat( QStringLiteral("^([^:\\t]+):([0-9]+):([^0-9]+)"), 1, 2, 3 ), // GCC - ErrorFormat( QStringLiteral("^(In file included from |[ ]+from )([^: \\t]+):([0-9]+)(:|,)(|[0-9]+)"), 2, 3, 5 ), + ErrorFormat( QStringLiteral("^(In file included from |[ ]+from )([^:\\t]+):([0-9]+)(:|,)(|[0-9]+)"), 2, 3, 5 ), // ICC - ErrorFormat( QStringLiteral("^([^: \\t]+)\\(([0-9]+)\\):([^0-9]+)"), 1, 2, 3, QStringLiteral("intel") ), + ErrorFormat( QStringLiteral("^([^:\\t]+)\\(([0-9]+)\\):([^0-9]+)"), 1, 2, 3, QStringLiteral("intel") ), //libtool link ErrorFormat( QStringLiteral("^(libtool):( link):( warning): "), 0, 0, 0 ), // make ErrorFormat( QStringLiteral("No rule to make target"), 0, 0, 0 ), // cmake - ErrorFormat( QStringLiteral("^([^: \\t]+):([0-9]+):"), 1, 2, 0, QStringLiteral("cmake") ), + ErrorFormat( QStringLiteral("^([^:\\t]+):([0-9]+):"), 1, 2, 0, QStringLiteral("cmake") ), // cmake ErrorFormat( QStringLiteral("CMake (Error|Warning) (|\\([a-zA-Z]+\\) )(in|at) ([^:]+):($|[0-9]+)"), 4, 5, 1, QStringLiteral("cmake") ), // cmake/automoc @@ -290,7 +290,7 @@ // GFortran ErrorFormat( QStringLiteral("^(.*):([0-9]+)\\.([0-9]+):(.*)"), 1, 2, 4, QStringLiteral("gfortran"), 3 ), // Jade - ErrorFormat( QStringLiteral("^[a-zA-Z]+:([^: \\t]+):([0-9]+):[0-9]+:[a-zA-Z]:(.*)"), 1, 2, 3 ), + ErrorFormat( QStringLiteral("^[a-zA-Z]+:([^:\\t]+):([0-9]+):[0-9]+:[a-zA-Z]:(.*)"), 1, 2, 3 ), // ifort ErrorFormat( QStringLiteral("^fortcom: (.*): (.*), line ([0-9]+):(.*)"), 2, 3, 1, QStringLiteral("intel") ), // PGI diff --git a/outputview/tests/test_filteringstrategy.cpp b/outputview/tests/test_filteringstrategy.cpp --- a/outputview/tests/test_filteringstrategy.cpp +++ b/outputview/tests/test_filteringstrategy.cpp @@ -51,6 +51,14 @@ return qstrdup("unknown"); } +inline QTestData& newRowForPathType(const char *dataTag, TestPathType pathType) +{ + if (pathType == UnixFilePathWithSpaces) { + return QTest::newRow(QString(QLatin1String(dataTag)+QLatin1String("-ws")).toUtf8().constData()); + } + return QTest::newRow(dataTag); +} + } void TestFilteringStrategy::testNoFilterStrategy_data() @@ -60,18 +68,22 @@ QTest::newRow("cppcheck-info-line") << buildCppCheckInformationLine() << FilteredItem::InvalidItem; - QTest::newRow("cppcheck-error-line") - << buildCppCheckErrorLine() << FilteredItem::InvalidItem; - QTest::newRow("compiler-line") - << buildCompilerLine() << FilteredItem::InvalidItem; - QTest::newRow("compiler-error-line") - << buildCompilerErrorLine() << FilteredItem::InvalidItem; + for (TestPathType pathType : {UnixFilePathNoSpaces, UnixFilePathWithSpaces}) { + QTest::newRowForPathType("cppcheck-error-line", pathType) + << buildCppCheckErrorLine(pathType) << FilteredItem::InvalidItem; + QTest::newRowForPathType("compiler-line", pathType) + << buildCompilerLine(pathType) << FilteredItem::InvalidItem; + QTest::newRowForPathType("compiler-error-line", pathType) + << buildCompilerErrorLine(pathType) << FilteredItem::InvalidItem; + } QTest::newRow("compiler-action-line") << buildCompilerActionLine() << FilteredItem::InvalidItem; - QTest::newRow("compiler-information-line") - << buildCompilerInformationLine() << FilteredItem::InvalidItem; - QTest::newRow("python-error-line") - << buildPythonErrorLine() << FilteredItem::InvalidItem; + for (TestPathType pathType : {UnixFilePathNoSpaces, UnixFilePathWithSpaces}) { + QTest::newRowForPathType("compiler-information-line", pathType) + << buildCompilerInformationLine(pathType) << FilteredItem::InvalidItem; + QTest::newRowForPathType("python-error-line", pathType) + << buildPythonErrorLine(pathType) << FilteredItem::InvalidItem; + } } void TestFilteringStrategy::testNoFilterStrategy() @@ -90,49 +102,58 @@ QTest::addColumn("line"); QTest::addColumn("expectedError"); QTest::addColumn("expectedAction"); + QTest::addColumn("pathType"); QTest::newRow("cppcheck-info-line") - << buildCppCheckInformationLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem; - QTest::newRow("cppcheck-error-line") - << buildCppCheckErrorLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem; - QTest::newRow("compiler-line") - << buildCompilerLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem; - QTest::newRow("compiler-error-line") - << buildCompilerErrorLine() << FilteredItem::ErrorItem << FilteredItem::InvalidItem; - QTest::newRow("compiler-information-line") - << buildCompilerInformationLine() << FilteredItem::InformationItem << FilteredItem::InvalidItem; - QTest::newRow("compiler-information-line2") - << buildInfileIncludedFromFirstLine() << FilteredItem::InformationItem << FilteredItem::InvalidItem; - QTest::newRow("compiler-information-line3") - << buildInfileIncludedFromSecondLine() << FilteredItem::InformationItem << FilteredItem::InvalidItem; + << buildCppCheckInformationLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem << UnixFilePathNoSpaces; + for (TestPathType pathType : {UnixFilePathNoSpaces, UnixFilePathWithSpaces}) { + QTest::newRowForPathType("cppcheck-error-line", pathType) + << buildCppCheckErrorLine(pathType) << FilteredItem::InvalidItem << FilteredItem::InvalidItem << pathType; + QTest::newRowForPathType("compiler-line", pathType) + << buildCompilerLine(pathType) << FilteredItem::InvalidItem << FilteredItem::InvalidItem << pathType; + QTest::newRowForPathType("compiler-error-line", pathType) + << buildCompilerErrorLine(pathType) << FilteredItem::ErrorItem << FilteredItem::InvalidItem << pathType; + QTest::newRowForPathType("compiler-information-line", pathType) + << buildCompilerInformationLine(pathType) << FilteredItem::InformationItem << FilteredItem::InvalidItem << pathType; + QTest::newRowForPathType("compiler-information-line2", pathType) + << buildInfileIncludedFromFirstLine(pathType) << FilteredItem::InformationItem << FilteredItem::InvalidItem << pathType; + QTest::newRowForPathType("compiler-information-line3", pathType) + << buildInfileIncludedFromSecondLine(pathType) << FilteredItem::InformationItem << FilteredItem::InvalidItem << pathType; + } QTest::newRow("cmake-error-line1") - << "CMake Error at CMakeLists.txt:2 (cmake_minimum_required):" << FilteredItem::ErrorItem << FilteredItem::InvalidItem; + << "CMake Error at CMakeLists.txt:2 (cmake_minimum_required):" << FilteredItem::ErrorItem << FilteredItem::InvalidItem << UnixFilePathNoSpaces; QTest::newRow("cmake-error-multiline1") - << "CMake Error: Error in cmake code at" << FilteredItem::InvalidItem << FilteredItem::InvalidItem; - QTest::newRow("cmake-error-multiline2") - << buildCmakeConfigureMultiLine() << FilteredItem::ErrorItem << FilteredItem::InvalidItem; + << "CMake Error: Error in cmake code at" << FilteredItem::InvalidItem << FilteredItem::InvalidItem << UnixFilePathNoSpaces; + for (TestPathType pathType : {UnixFilePathNoSpaces, UnixFilePathWithSpaces}) { + QTest::newRowForPathType("cmake-error-multiline2", pathType) + << buildCmakeConfigureMultiLine(pathType) << FilteredItem::ErrorItem << FilteredItem::InvalidItem << pathType; + } QTest::newRow("cmake-warning-line") - << "CMake Warning (dev) in CMakeLists.txt:" << FilteredItem::WarningItem << FilteredItem::InvalidItem; + << "CMake Warning (dev) in CMakeLists.txt:" << FilteredItem::WarningItem << FilteredItem::InvalidItem << UnixFilePathNoSpaces; QTest::newRow("cmake-automoc-error") - << "AUTOMOC: error: /foo/bar.cpp The file includes the moc file \"moc_bar1.cpp\"" << FilteredItem::ErrorItem << FilteredItem::InvalidItem; + << "AUTOMOC: error: /foo/bar.cpp The file includes the moc file \"moc_bar1.cpp\"" << FilteredItem::ErrorItem << FilteredItem::InvalidItem << UnixFilePathNoSpaces; QTest::newRow("cmake-automoc4-error") - << "automoc4: The file \"/foo/bar.cpp\" includes the moc file \"bar1.moc\"" << FilteredItem::InformationItem << FilteredItem::InvalidItem; + << "automoc4: The file \"/foo/bar.cpp\" includes the moc file \"bar1.moc\"" << FilteredItem::InformationItem << FilteredItem::InvalidItem << UnixFilePathNoSpaces; QTest::newRow("cmake-autogen-error") - << "AUTOGEN: error: /foo/bar.cpp The file includes the moc file \"moc_bar1.cpp\"" << FilteredItem::ErrorItem << FilteredItem::InvalidItem; + << "AUTOGEN: error: /foo/bar.cpp The file includes the moc file \"moc_bar1.cpp\"" << FilteredItem::ErrorItem << FilteredItem::InvalidItem << UnixFilePathNoSpaces; QTest::newRow("linker-action-line") - << "linking testCustombuild (g++)" << FilteredItem::InvalidItem << FilteredItem::ActionItem; - QTest::newRow("linker-error-line") - << buildLinkerErrorLine() << FilteredItem::ErrorItem << FilteredItem::InvalidItem; - QTest::newRow("python-error-line") - << buildPythonErrorLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem; + << "linking testCustombuild (g++)" << FilteredItem::InvalidItem << FilteredItem::ActionItem << UnixFilePathNoSpaces; + for (TestPathType pathType : {UnixFilePathNoSpaces, UnixFilePathWithSpaces}) { + QTest::newRowForPathType("linker-error-line", pathType) + << buildLinkerErrorLine(pathType) << FilteredItem::ErrorItem << FilteredItem::InvalidItem << pathType; + QTest::newRowForPathType("python-error-line", pathType) + << buildPythonErrorLine(pathType) << FilteredItem::InvalidItem << FilteredItem::InvalidItem << pathType; + } } void TestFilteringStrategy::testCompilerFilterStrategy() { QFETCH(QString, line); QFETCH(FilteredItem::FilteredOutputItemType, expectedError); QFETCH(FilteredItem::FilteredOutputItemType, expectedAction); - QUrl projecturl = QUrl::fromLocalFile( projectPath() ); + QFETCH(TestPathType, pathType); + + QUrl projecturl = QUrl::fromLocalFile( projectPath(pathType) ); CompilerFilterStrategy testee(projecturl); FilteredItem item1 = testee.errorInLine(line); QCOMPARE(item1.type, expectedError); @@ -181,16 +202,20 @@ QTest::newRow("cppcheck-info-line") << buildCppCheckInformationLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem; - QTest::newRow("cppcheck-error-line") - << buildCppCheckErrorLine() << FilteredItem::ErrorItem << FilteredItem::InvalidItem; - QTest::newRow("compiler-line") - << buildCompilerLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem; - QTest::newRow("compiler-error-line") - << buildCompilerErrorLine() << FilteredItem::ErrorItem << FilteredItem::InvalidItem; + for (TestPathType pathType : {UnixFilePathNoSpaces, UnixFilePathWithSpaces}) { + QTest::newRowForPathType("cppcheck-error-line", pathType) + << buildCppCheckErrorLine(pathType) << FilteredItem::ErrorItem << FilteredItem::InvalidItem; + QTest::newRowForPathType("compiler-line", pathType) + << buildCompilerLine(pathType) << FilteredItem::InvalidItem << FilteredItem::InvalidItem; + QTest::newRowForPathType("compiler-error-line", pathType) + << buildCompilerErrorLine(pathType) << FilteredItem::ErrorItem << FilteredItem::InvalidItem; + } QTest::newRow("compiler-action-line") << "linking testCustombuild (g++)" << FilteredItem::InvalidItem << FilteredItem::InvalidItem; - QTest::newRow("python-error-line") - << buildPythonErrorLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem; + for (TestPathType pathType : {UnixFilePathNoSpaces, UnixFilePathWithSpaces}) { + QTest::newRowForPathType("python-error-line", pathType) + << buildPythonErrorLine(pathType) << FilteredItem::InvalidItem << FilteredItem::InvalidItem; + } } void TestFilteringStrategy::testScriptErrorFilterStrategy() @@ -302,37 +327,44 @@ QTest::addColumn("line"); QTest::addColumn("expectedError"); QTest::addColumn("expectedAction"); + QTest::addColumn("pathType"); QTest::newRow("cppcheck-info-line") - << buildCppCheckInformationLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem; - QTest::newRow("cppcheck-error-line") - << buildCppCheckErrorLine() << FilteredItem::ErrorItem << FilteredItem::InvalidItem; - QTest::newRow("krazy2-error-line") - << buildKrazyErrorLine() << FilteredItem::ErrorItem << FilteredItem::InvalidItem; - QTest::newRow("krazy2-error-line-two-colons") - << buildKrazyErrorLine2() << FilteredItem::ErrorItem << FilteredItem::InvalidItem; - QTest::newRow("krazy2-error-line-error-description") - << buildKrazyErrorLine3() << FilteredItem::ErrorItem << FilteredItem::InvalidItem; - QTest::newRow("krazy2-error-line-wo-line-info") - << buildKrazyErrorLineNoLineInfo() << FilteredItem::ErrorItem << FilteredItem::InvalidItem; - QTest::newRow("compiler-line") - << buildCompilerLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem; - QTest::newRow("compiler-error-line") - << buildCompilerErrorLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem; + << buildCppCheckInformationLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem << UnixFilePathNoSpaces; + for (TestPathType pathType : {UnixFilePathNoSpaces, UnixFilePathWithSpaces}) { + QTest::newRowForPathType("cppcheck-error-line", pathType) + << buildCppCheckErrorLine(pathType) << FilteredItem::ErrorItem << FilteredItem::InvalidItem << pathType;; + QTest::newRowForPathType("krazy2-error-line", pathType) + << buildKrazyErrorLine(pathType) << FilteredItem::ErrorItem << FilteredItem::InvalidItem << pathType; + QTest::newRowForPathType("krazy2-error-line-two-colons", pathType) + << buildKrazyErrorLine2(pathType) << FilteredItem::ErrorItem << FilteredItem::InvalidItem << pathType; + QTest::newRowForPathType("krazy2-error-line-error-description", pathType) + << buildKrazyErrorLine3(pathType) << FilteredItem::ErrorItem << FilteredItem::InvalidItem << pathType; + QTest::newRowForPathType("krazy2-error-line-wo-line-info", pathType) + << buildKrazyErrorLineNoLineInfo(pathType) << FilteredItem::ErrorItem << FilteredItem::InvalidItem << pathType; + QTest::newRowForPathType("compiler-line", pathType) + << buildCompilerLine(pathType) << FilteredItem::InvalidItem << FilteredItem::InvalidItem << pathType; + QTest::newRowForPathType("compiler-error-line", pathType) + << buildCompilerErrorLine(pathType) << FilteredItem::InvalidItem << FilteredItem::InvalidItem << pathType; + } QTest::newRow("compiler-action-line") - << "linking testCustombuild (g++)" << FilteredItem::InvalidItem << FilteredItem::InvalidItem; - QTest::newRow("python-error-line") - << buildPythonErrorLine() << FilteredItem::InvalidItem << FilteredItem::InvalidItem; + << "linking testCustombuild (g++)" << FilteredItem::InvalidItem << FilteredItem::InvalidItem << UnixFilePathNoSpaces; + for (TestPathType pathType : {UnixFilePathNoSpaces, UnixFilePathWithSpaces}) { + QTest::newRowForPathType("python-error-line", pathType) + << buildPythonErrorLine(pathType) << FilteredItem::InvalidItem << FilteredItem::InvalidItem << pathType; + } } void TestFilteringStrategy::testStaticAnalysisFilterStrategy() { - // Test that url's are extracted correctly as well - QString referencePath = projectPath() + "main.cpp"; - QFETCH(QString, line); QFETCH(FilteredItem::FilteredOutputItemType, expectedError); QFETCH(FilteredItem::FilteredOutputItemType, expectedAction); + QFETCH(TestPathType, pathType); + + // Test that url's are extracted correctly as well + QString referencePath = projectPath(pathType) + "main.cpp"; + StaticAnalysisFilterStrategy testee; FilteredItem item1 = testee.errorInLine(line); QString extractedPath = item1.url.toLocalFile(); @@ -346,32 +378,38 @@ { QTest::addColumn("line"); QTest::addColumn("expectedLastDir"); - QString basepath = projectPath(); - - QTest::newRow("cmake-line1") - << "[ 25%] Building CXX object path/to/one/CMakeFiles/file.o" << QString( basepath + "/path/to/one" ); - QTest::newRow("cmake-line2") - << "[ 26%] Building CXX object path/to/two/CMakeFiles/file.o" << QString( basepath + "/path/to/two"); - QTest::newRow("cmake-line3") - << "[ 26%] Building CXX object path/to/three/CMakeFiles/file.o" << QString( basepath + "/path/to/three"); - QTest::newRow("cmake-line4") - << "[ 26%] Building CXX object path/to/four/CMakeFiles/file.o" << QString( basepath + "/path/to/four"); - QTest::newRow("cmake-line5") - << "[ 26%] Building CXX object path/to/two/CMakeFiles/file.o" << QString( basepath + "/path/to/two"); - QTest::newRow("cd-line6") - << QString("make[4]: Entering directory '" + basepath + "/path/to/one/'") << QString( basepath + "/path/to/one"); - QTest::newRow("waf-cd") - << QString("Waf: Entering directory `" + basepath + "/path/to/two/'") << QString( basepath + "/path/to/two"); - QTest::newRow("cmake-line7") - << QStringLiteral("[ 50%] Building CXX object CMakeFiles/testdeque.dir/RingBuffer.cpp.o") << QString( basepath); + QTest::addColumn("pathType"); + + for (TestPathType pathType : {UnixFilePathNoSpaces, UnixFilePathWithSpaces}) { + const QString basepath = projectPath(pathType); + + QTest::newRowForPathType("cmake-line1", pathType) + << "[ 25%] Building CXX object path/to/one/CMakeFiles/file.o" << QString( basepath + "/path/to/one" ) << pathType; + QTest::newRowForPathType("cmake-line2", pathType) + << "[ 26%] Building CXX object path/to/two/CMakeFiles/file.o" << QString( basepath + "/path/to/two") << pathType; + QTest::newRowForPathType("cmake-line3", pathType) + << "[ 26%] Building CXX object path/to/three/CMakeFiles/file.o" << QString( basepath + "/path/to/three") << pathType; + QTest::newRowForPathType("cmake-line4", pathType) + << "[ 26%] Building CXX object path/to/four/CMakeFiles/file.o" << QString( basepath + "/path/to/four") << pathType; + QTest::newRowForPathType("cmake-line5", pathType) + << "[ 26%] Building CXX object path/to/two/CMakeFiles/file.o" << QString( basepath + "/path/to/two") << pathType; + QTest::newRowForPathType("cd-line6", pathType) + << QString("make[4]: Entering directory '" + basepath + "/path/to/one/'") << QString( basepath + "/path/to/one") << pathType; + QTest::newRowForPathType("waf-cd", pathType) + << QString("Waf: Entering directory `" + basepath + "/path/to/two/'") << QString( basepath + "/path/to/two") << pathType; + QTest::newRowForPathType("cmake-line7", pathType) + << QStringLiteral("[ 50%] Building CXX object CMakeFiles/testdeque.dir/RingBuffer.cpp.o") << QString( basepath) << pathType; + } } void TestFilteringStrategy::testCompilerFilterstrategyUrlFromAction() { QFETCH(QString, line); QFETCH(QString, expectedLastDir); - QUrl projecturl = QUrl::fromLocalFile( projectPath() ); - static CompilerFilterStrategy testee(projecturl); + QFETCH(TestPathType, pathType); + + QUrl projecturl = QUrl::fromLocalFile( projectPath(pathType) ); + CompilerFilterStrategy testee(projecturl); FilteredItem item1 = testee.actionInLine(line); int last = testee.getCurrentDirs().size() - 1; QCOMPARE(testee.getCurrentDirs().at(last), expectedLastDir); diff --git a/outputview/tests/test_outputmodel.cpp b/outputview/tests/test_outputmodel.cpp --- a/outputview/tests/test_outputmodel.cpp +++ b/outputview/tests/test_outputmodel.cpp @@ -36,12 +36,14 @@ const int numLines = 10000; QStringList outputlines; do { - outputlines << buildCompilerErrorLine(); - outputlines << buildCompilerLine(); outputlines << buildCompilerActionLine(); - outputlines << buildCppCheckErrorLine(); outputlines << buildCppCheckInformationLine(); - outputlines << buildPythonErrorLine(); + for (TestPathType pathType : {UnixFilePathNoSpaces, UnixFilePathWithSpaces}) { + outputlines << buildCompilerErrorLine(pathType); + outputlines << buildCompilerLine(pathType); + outputlines << buildCppCheckErrorLine(pathType); + outputlines << buildPythonErrorLine(pathType); + } } while(outputlines.size() < numLines ); // gives us numLines (-ish) return outputlines; diff --git a/outputview/tests/testlinebuilderfunctions.h b/outputview/tests/testlinebuilderfunctions.h --- a/outputview/tests/testlinebuilderfunctions.h +++ b/outputview/tests/testlinebuilderfunctions.h @@ -20,101 +20,112 @@ #include #include -#include -#define PROJECTS_SOURCE_DIR +namespace KDevelop +{ + +enum TestPathType { + UnixFilePathNoSpaces, + UnixFilePathWithSpaces +}; + +} + +Q_DECLARE_METATYPE( KDevelop::TestPathType) namespace KDevelop { -static QString projectPath() +// TODO: extend with windows path and other potential path patterns (network shares?) +static QString projectPath(TestPathType pathType = UnixFilePathNoSpaces) { - /// Use existing directory with one file - return QFileInfo(QStringLiteral(__FILE__)).absolutePath() + QLatin1String("/onefileproject"); + return + (pathType == UnixFilePathNoSpaces) ? QStringLiteral("/some/path/to/a/project") : + /* else, UnixFilePathWithSpaces) */ QStringLiteral("/some/path with spaces/to/a/project"); } -QString buildCppCheckErrorLine() +QString buildCppCheckErrorLine(TestPathType pathType = UnixFilePathNoSpaces) { /// Test CPP check output QString outputline(QStringLiteral("[")); - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append("main.cpp:26]: (error) Memory leak: str"); return outputline; } -QString buildKrazyErrorLine() +QString buildKrazyErrorLine(TestPathType pathType = UnixFilePathNoSpaces) { /// Test krazy2 output QString outputline(QStringLiteral("\t")); - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append("main.cpp: line#22 (1)"); return outputline; } -QString buildKrazyErrorLine2() +QString buildKrazyErrorLine2(TestPathType pathType = UnixFilePathNoSpaces) { /// Test krazy2 output QString outputline(QStringLiteral("\t")); - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append("main.cpp: missing tags: email address line#2 (1)"); return outputline; } -QString buildKrazyErrorLine3() +QString buildKrazyErrorLine3(TestPathType pathType = UnixFilePathNoSpaces) { /// Test krazy2 output QString outputline(QStringLiteral("\t")); - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append("main.cpp: non-const ref iterator line#451 (1)"); return outputline; } -QString buildKrazyErrorLineNoLineInfo() +QString buildKrazyErrorLineNoLineInfo(TestPathType pathType = UnixFilePathNoSpaces) { /// Test krazy2 output QString outputline(QStringLiteral("\t")); - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append("main.cpp: missing license"); return outputline; } -QString buildCompilerLine() +QString buildCompilerLine(TestPathType pathType = UnixFilePathNoSpaces) { /// Test with compiler output QString outputline; - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append(">make"); return outputline; } -QString buildCompilerErrorLine() +QString buildCompilerErrorLine(TestPathType pathType = UnixFilePathNoSpaces) { QString outputline; - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append("main.cpp:5:5: error: ‘RingBuffer’ was not declared in this scope"); return outputline; } -QString buildCompilerInformationLine() +QString buildCompilerInformationLine(TestPathType pathType = UnixFilePathNoSpaces) { QString outputline; - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append("main.cpp:6:14: instantiated from here"); return outputline; } -QString buildInfileIncludedFromFirstLine() +QString buildInfileIncludedFromFirstLine(TestPathType pathType = UnixFilePathNoSpaces) { QString outputline(QStringLiteral("In file included from ")); - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append("PriorityFactory.h:52:0,"); return outputline; } -QString buildInfileIncludedFromSecondLine() +QString buildInfileIncludedFromSecondLine(TestPathType pathType = UnixFilePathNoSpaces) { QString outputline(QStringLiteral(" from ")); - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append("PatchBasedInpainting.hxx:29,"); return outputline; } @@ -124,24 +135,24 @@ return QStringLiteral("linking testCustombuild (g++)"); } -QString buildCmakeConfigureMultiLine() +QString buildCmakeConfigureMultiLine(TestPathType pathType = UnixFilePathNoSpaces) { QString outputline; - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append("CMakeLists.txt:10:"); return outputline; } -QString buildLinkerErrorLine() +QString buildLinkerErrorLine(TestPathType pathType = UnixFilePathNoSpaces) { - return QStringLiteral("/path/to/file/Buffer.cpp:66: undefined reference to `Buffer::does_not_exist()'"); + return projectPath(pathType) + QLatin1String("Buffer.cpp:66: undefined reference to `Buffer::does_not_exist()'"); } -QString buildPythonErrorLine() +QString buildPythonErrorLine(TestPathType pathType = UnixFilePathNoSpaces) { QString outputline(QStringLiteral("File \"")); - outputline.append(projectPath()); + outputline.append(projectPath(pathType)); outputline.append("pythonExample.py\", line 10"); return outputline; }