diff options
author | Christian Stenger <christian.stenger@qt.io> | 2021-03-10 10:10:28 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2021-03-11 07:09:26 +0000 |
commit | f0004333b2f32971f8f4e2028054e136e7032562 (patch) | |
tree | 7dc99fa5a73f248591c327e779f640a47d8b52e5 | |
parent | b6164e7b72a3cdaea00f47e6e4be4f361541b464 (diff) |
PE: Fix expectations of LinkSpecs test on Windows
The output parser detects Windows paths on Unix differently which
makes the format differ from the one that is generated on a
Windows host.
Beside this remove BOM from msvcparser again and do not perform
the format check if there is no expected format specified.
Amends 9e4e9924ad26c708.
Change-Id: Icb0d292a8908cdd2f86b13fde6d2d287f3a96dd6
Reviewed-by: hjk <hjk@qt.io>
-rw-r--r-- | src/plugins/projectexplorer/gccparser.cpp | 50 | ||||
-rw-r--r-- | src/plugins/projectexplorer/msvcparser.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/outputparser_test.cpp | 3 |
3 files changed, 46 insertions, 9 deletions
diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp index 52bbfecd72..33f820a34f 100644 --- a/src/plugins/projectexplorer/gccparser.cpp +++ b/src/plugins/projectexplorer/gccparser.cpp @@ -389,6 +389,14 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() 8)) << QString(); + QVector<QTextLayout::FormatRange> formatRanges; + if (HostOsInfo::isWindowsHost()) { + formatRanges << formatRange(51, 28) + << formatRange(79, 31, "olpfile://C:/temp/test/untitled8/main.cpp::8::-1") + << formatRange(110, 54); + } else { + formatRanges << formatRange(51, 113); + } QTest::newRow("Undefined reference (debug)") << QString::fromLatin1("main.o: In function `main':\n" "C:\\temp\\test\\untitled8/main.cpp:8: undefined reference to `MainWindow::doSomething()'\n" @@ -402,12 +410,19 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "C:\\temp\\test\\untitled8/main.cpp:8: undefined reference to `MainWindow::doSomething()'", FilePath::fromUserInput("C:\\temp\\test\\untitled8/main.cpp"), 8, - QVector<QTextLayout::FormatRange>() - << formatRange(51, 113)) + formatRanges) << CompileTask(Task::Error, "collect2: ld returned 1 exit status")) << QString(); + formatRanges.clear(); + if (HostOsInfo::isWindowsHost()) { + formatRanges << formatRange(51, 28) + << formatRange(79, 31, "olpfile://C:/temp/test/untitled8/main.cpp::0::-1") + << formatRange(110, 65); + } else { + formatRanges << formatRange(51, 124); + } QTest::newRow("Undefined reference (release)") << QString::fromLatin1("main.o: In function `main':\n" "C:\\temp\\test\\untitled8/main.cpp:(.text+0x40): undefined reference to `MainWindow::doSomething()'\n" @@ -421,8 +436,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "C:\\temp\\test\\untitled8/main.cpp:(.text+0x40): undefined reference to `MainWindow::doSomething()'", FilePath::fromUserInput("C:\\temp\\test\\untitled8/main.cpp"), -1, - QVector<QTextLayout::FormatRange>() - << formatRange(51, 124)) + formatRanges) << CompileTask(Task::Error, "collect2: ld returned 1 exit status")) << QString(); @@ -654,6 +668,14 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() 54)) << QString(); + formatRanges.clear(); + if (HostOsInfo::isWindowsHost()) { + formatRanges << formatRange(46, 44) + << formatRange(90, 39, "olpfile://M:/Development/x64/QtPlot/qplotaxis.cpp::26::-1") + << formatRange(129, 50); + } else { + formatRanges << formatRange(46, 133); + } QTest::newRow("QTCREATORBUG-597") << QString::fromLatin1("debug/qplotaxis.o: In function `QPlotAxis':\n" "M:\\Development\\x64\\QtPlot/qplotaxis.cpp:26: undefined reference to `vtable for QPlotAxis'\n" @@ -668,8 +690,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "M:\\Development\\x64\\QtPlot/qplotaxis.cpp:26: undefined reference to `vtable for QPlotAxis'", FilePath::fromUserInput("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), 26, - QVector<QTextLayout::FormatRange>() - << formatRange(46, 133)) + formatRanges) << CompileTask(Task::Error, "undefined reference to `vtable for QPlotAxis'", FilePath::fromUserInput("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), @@ -708,6 +729,20 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << formatRange(23, 85))) << QString(); + formatRanges.clear(); + if (HostOsInfo::isWindowsHost()) { + formatRanges << formatRange(33, 22) + << formatRange(55, 38, "olpfile://C:/Symbian_SDK/epoc32/include/e32cmn.h::6792::-1") + << formatRange(93, 29) + << formatRange(122, 38, "olpfile://C:/Symbian_SDK/epoc32/include/e32std.h::25::-1") + << formatRange(160, 5) + << formatRange(165, 40, "olpfile://C:/Symbian_SDK/epoc32/include/e32cmn.inl::0::-1") + << formatRange(205, 69) + << formatRange(274, 40, "olpfile://C:/Symbian_SDK/epoc32/include/e32cmn.inl::7094::-1") + << formatRange(314, 48); + } else { + formatRanges << formatRange(33, 329); + } QTest::newRow("GCCE from lines") << QString::fromLatin1("In file included from C:/Symbian_SDK/epoc32/include/e32cmn.h:6792,\n" " from C:/Symbian_SDK/epoc32/include/e32std.h:25,\n" @@ -723,8 +758,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "C:/Symbian_SDK/epoc32/include/e32cmn.inl:7094: warning: returning reference to temporary", FilePath::fromUserInput("C:/Symbian_SDK/epoc32/include/e32cmn.inl"), 7094, - QVector<QTextLayout::FormatRange>() - << formatRange(33, 329))} + formatRanges)} << QString(); QTest::newRow("In constructor 2") << QString::fromUtf8("perfattributes.cpp: In constructor ‘PerfEventAttributes::PerfEventAttributes()’:\n" diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp index a0b1039f2b..2ed0366902 100644 --- a/src/plugins/projectexplorer/msvcparser.cpp +++ b/src/plugins/projectexplorer/msvcparser.cpp @@ -1,4 +1,4 @@ -/**************************************************************************** +/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp index 65718f5a46..18e3a7ae19 100644 --- a/src/plugins/projectexplorer/outputparser_test.cpp +++ b/src/plugins/projectexplorer/outputparser_test.cpp @@ -92,6 +92,9 @@ void OutputParserTester::testParsing(const QString &lines, msgFileComparisonFail(m_receivedTasks.at(i).file, tasks.at(i).file)); QCOMPARE(m_receivedTasks.at(i).line, tasks.at(i).line); QCOMPARE(static_cast<int>(m_receivedTasks.at(i).type), static_cast<int>(tasks.at(i).type)); + // Skip formats check if we haven't specified expected + if (tasks.at(i).formats.size() == 0) + continue; QCOMPARE(m_receivedTasks.at(i).formats.size(), tasks.at(i).formats.size()); for (int j = 0; j < tasks.at(i).formats.size(); ++j) { QCOMPARE(m_receivedTasks.at(i).formats.at(j).start, tasks.at(i).formats.at(j).start); |