1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 11:25:35 +02:00

Bug 263977: parsing of Visual C++ errors on Linux with Wine

This commit is contained in:
Andrew Gvozdev 2009-07-08 19:35:06 +00:00
parent e9d2fc6b56
commit 81ff9fe6a8
2 changed files with 23 additions and 1 deletions

View file

@ -1279,5 +1279,25 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1,problemMarkerInfo.lineNumber);
assertEquals("error",problemMarkerInfo.description);
}
/**
* Checks if a file from error output can be found.
*
* @throws Exception...
*/
public void testWindowsPathOnLinux_Bug263977() throws Exception {
String fileName = "testWindowsPathOnLinux_Bug263977.c";
ResourceHelper.createFolder(fProject, "Folder/Subfolder");
ResourceHelper.createFile(fProject, "Folder/Subfolder/"+fileName);
// Note that main intention of this test is to run on *Linux*, see bug 263977
parseOutput("W:\\Folder\\Subfolder\\"+fileName+":1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
assertEquals("L/FindMatchingFilesTest/Folder/Subfolder/"+fileName,problemMarkerInfo.file.toString());
assertEquals("error",problemMarkerInfo.description);
}
}

View file

@ -346,13 +346,15 @@ public class ErrorParserManager extends OutputStream {
org.eclipse.core.filesystem.URIUtil.equals(getWorkingDirectoryURI(), cachedWorkingDirectory))
return cachedFile;
IPath path = new Path(partialLoc);
// To be able to parse Windows paths on Linux systems, see bug 263977
IPath path = new Path(partialLoc.replace('\\', IPath.SEPARATOR));
// Try to find exact match. If path is not absolute - searching in working directory.
IFile file = findFileInWorkspace(path);
// Try to find best match considering known partial path
if (file==null) {
path = path.setDevice(null);
IProject[] prjs = new IProject[] { fProject };
IFile[] files = ResourceLookup.findFilesByName(path, prjs, false);
if (files.length == 0)