# HG changeset patch # User Ed Swartz # Date 1270823604 18000 # Node ID 3229f07471de658b186695c29e64a03f08a9a199 # Parent e0412d845ffbeadbc28237149c33349ea5f8c1b7 Fix error parser tests. We were using deprecated APIs. Also, fix some buggy extraction of filenames from linker errors. diff -r e0412d845ffb -r 3229f07471de builder/com.nokia.carbide.cdt.builder.test/data/errorpatterns/bugzilla/2969.gcce.regression.xml --- a/builder/com.nokia.carbide.cdt.builder.test/data/errorpatterns/bugzilla/2969.gcce.regression.xml Fri Apr 09 07:51:50 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder.test/data/errorpatterns/bugzilla/2969.gcce.regression.xml Fri Apr 09 09:33:24 2010 -0500 @@ -1,7 +1,7 @@ - + diff -r e0412d845ffb -r 3229f07471de builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/CarbideErrorParserTestHarness.java --- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/CarbideErrorParserTestHarness.java Fri Apr 09 07:51:50 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/CarbideErrorParserTestHarness.java Fri Apr 09 09:33:24 2010 -0500 @@ -103,6 +103,7 @@ try { // pick out the stdout stream directly, where CDT error parser sniff // for error messages from build console + ideProblemMarkerInfoList.clear(); stdoutStream.getProject().deleteMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE); // clear UI list before we start stdoutStream.clearScratchBuffer(); // some error parser do multiple lines consoleOutput += "\n"; // force the input file to flush all lines @@ -117,18 +118,15 @@ // need to intercept and keep track ourself // reportProblems() calls this from base class public void addMarker(ProblemMarkerInfo problemMarkerInfo) { + if (problemMarkerInfo.variableName == null || problemMarkerInfo.variableName.length() == 0) + problemMarkerInfo.variableName = EMPTY; + if (problemMarkerInfo.description == null || problemMarkerInfo.description.length() == 0) + problemMarkerInfo.description = EMPTY; + ideProblemMarkerInfoList.add(problemMarkerInfo); super.addMarker(problemMarkerInfo); } - // Read in error markers from IDE to this test harness and set up internal marker list - public void getMarkersFromIde() { - // flush out markers into project, that's the only way to tap into - // markers reported by error parsers in current API - ideProblemMarkerInfoList.clear(); - stdoutStream.reportProblems(); - } - /** * Do the comparison of the parsed results from the console and the expected results (control file) * @param consoleOutput - The output from the real build @@ -163,7 +161,6 @@ */ public boolean testIdeMarkerAgainstXML(InputStream xmlInputStream) { // load data from IDE and control file - getMarkersFromIde(); readControlXML(xmlInputStream); if (ideProblemMarkerInfoList.size() != xmlFilePromblemMarkerInfoList.size()) { diff -r e0412d845ffb -r 3229f07471de builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/ErrorParserRegressionGenerator.java --- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/ErrorParserRegressionGenerator.java Fri Apr 09 07:51:50 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/ErrorParserRegressionGenerator.java Fri Apr 09 09:33:24 2010 -0500 @@ -123,7 +123,6 @@ // This is how we capture a control case try { harness.writeFileContentsToStdout(FileUtils.pluginRelativeFile(TestPlugin.getDefault(), "data/errorpatterns/regression_capture/your.input.errorparser.txt")); - harness.getMarkersFromIde(); java.io.File file = FileUtils.pluginRelativeFile(TestPlugin.getDefault(), "data/errorpatterns/regression_capture/regression.capture.xml"); if (!file.exists()) { file.createNewFile(); diff -r e0412d845ffb -r 3229f07471de builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/error/parsers/AbstractGCCEErrorParser.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/error/parsers/AbstractGCCEErrorParser.java Fri Apr 09 07:51:50 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/error/parsers/AbstractGCCEErrorParser.java Fri Apr 09 09:33:24 2010 -0500 @@ -39,7 +39,8 @@ * int severity */ // arm-none-symbianelf-g++: \test\test.cpp: No such file or directory - new ErrorPattern("(.*):\\s*(.*):\\s*(.*(?:[Nn]o such file:\\s*)?[Nn]o such file or directory)", 2, 0, 3, 0, IMarkerGenerator.SEVERITY_ERROR_RESOURCE), //$NON-NLS-1$ + // arm-none-symbianelf-ld: \S60\devices\S60_3rd_FP2_SDK_v1.1\epoc32\release\ARMV5\LIB\foo.dso: No such file: No such file or directory + new ErrorPattern("(.*?):\\s*(.*?):\\s*(.*(?:[Nn]o such file:\\s*)?[Nn]o such file or directory)", 2, 0, 3, 0, IMarkerGenerator.SEVERITY_ERROR_RESOURCE), //$NON-NLS-1$ // arm-none-symbianelf-g++: no input files new ErrorPattern("(.*):\\s*(.*[Nn]o input files)", 0, 0, 2, 0, IMarkerGenerator.SEVERITY_ERROR_RESOURCE), //$NON-NLS-1$ //arm-none-symbianelf-g++: warning: `-x c++' after last input file has no effect