1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Bug 462036 - Make error parsers do not handle 'entering directory' correctly in make 4.0

Change-Id: Ifdd5794c7d692dc275a9b6010ee84441f817313b
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
This commit is contained in:
Marc-Andre Laperle 2015-03-12 15:06:34 -07:00 committed by Gerrit Code Review @ Eclipse.org
parent 27dd96cb72
commit 2e98847771
3 changed files with 34 additions and 6 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2009, 2010 Andrew Gvozdev and others. * Copyright (c) 2009, 2015 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Andrew Gvozdev - Initial API and implementation * Andrew Gvozdev - Initial API and implementation
* Marc-Andre Laperle (Ericsson) - Bug 462036
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.internal.errorparsers.tests; package org.eclipse.cdt.core.internal.errorparsers.tests;
@ -1152,6 +1153,31 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals("error",problemMarkerInfo.description); assertEquals("error",problemMarkerInfo.description);
} }
/**
* Checks if a file from error output can be found. Using new single quote
* in Gnu Make 4.0.
*
* @throws Exception...
*/
public void testPushDirectorySingleQuote() throws Exception {
String fileName = "testPushDirectory.c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
ResourceHelper.createFile(fProject, "Folder/"+fileName);
String lines = "make[0]: Entering directory 'Folder'\n"
+ fileName+":1:error\n";
String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
assertEquals("L/FindMatchingFilesTest/Folder/"+fileName,problemMarkerInfo.file.toString());
assertEquals(1,problemMarkerInfo.lineNumber);
assertEquals("error",problemMarkerInfo.description);
}
/** /**
* Checks if a file from error output can be found. * Checks if a file from error output can be found.
* *

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2010 IBM Corporation and others. * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Andrew Gvozdev (Quoin Inc.) - initial API and implementation adapted from MakeErrorParser * Andrew Gvozdev (Quoin Inc.) - initial API and implementation adapted from MakeErrorParser
* Marc-Andre Laperle (Ericsson) - Bug 462036
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.errorparsers; package org.eclipse.cdt.internal.errorparsers;
@ -54,7 +55,7 @@ public class CWDLocator extends AbstractErrorParser {
return false; return false;
} }
}, },
new ErrorPattern("make\\[(.*)\\]: Entering directory `(.*)'", 0, 0) { //$NON-NLS-1$ new ErrorPattern("make\\[(.*)\\]: Entering directory [`'](.*)'", 0, 0) { //$NON-NLS-1$
@Override @Override
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) { protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
int level; int level;
@ -77,7 +78,7 @@ public class CWDLocator extends AbstractErrorParser {
} }
}, },
// This is emitted by GNU make using options -w or --print-directory. // This is emitted by GNU make using options -w or --print-directory.
new ErrorPattern("make: Entering directory `(.*)'", 0, 0) { //$NON-NLS-1$ new ErrorPattern("make: Entering directory [`'](.*)'", 0, 0) { //$NON-NLS-1$
@Override @Override
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) { protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
String dir = matcher.group(1); String dir = matcher.group(1);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2010 IBM Corporation and others. * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,6 +8,7 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Norbert Ploett (Siemens AG) - externalized strings * Norbert Ploett (Siemens AG) - externalized strings
* Marc-Andre Laperle (Ericsson) - Bug 462036
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.errorparsers; package org.eclipse.cdt.internal.errorparsers;
@ -27,7 +28,7 @@ import org.eclipse.core.runtime.Path;
@Deprecated @Deprecated
public class MakeErrorParser extends AbstractErrorParser { public class MakeErrorParser extends AbstractErrorParser {
private static final ErrorPattern[] patterns = { private static final ErrorPattern[] patterns = {
new ErrorPattern("make\\[(.*)\\]: Entering directory `(.*)'", 0, 0) { //$NON-NLS-1$ new ErrorPattern("make\\[(.*)\\]: Entering directory [`'](.*)'", 0, 0) { //$NON-NLS-1$
@Override @Override
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) { protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
int level; int level;