mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
update error parser junits to read a set of files with output to feed parser
current and only file contains build output which causes to error parser to hang
This commit is contained in:
parent
67a47ed1f9
commit
2ff46eeeab
6 changed files with 662 additions and 161 deletions
|
@ -10,14 +10,12 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
bin.includes = plugin.xml,\
|
bin.includes = plugin.xml,\
|
||||||
about.html,\
|
about.html,\
|
||||||
plugin.properties,\
|
|
||||||
cdtcoretests.jar,\
|
cdtcoretests.jar,\
|
||||||
test.xml,\
|
test.xml,\
|
||||||
resources/,\
|
resources/,\
|
||||||
META-INF/
|
META-INF/
|
||||||
src.includes = plugin.properties
|
|
||||||
output.cdtcoretests.jar = bin/
|
output.cdtcoretests.jar = bin/
|
||||||
about.html =
|
|
||||||
source.cdtcoretests.jar = failures/,\
|
source.cdtcoretests.jar = failures/,\
|
||||||
model/,\
|
model/,\
|
||||||
parser/,\
|
parser/,\
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.eclipse.cdt.core.internal.errorparsers.tests;
|
||||||
|
|
||||||
|
import junit.framework.Test;
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
|
||||||
|
public class ErrorParserTests {
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
TestSuite suite = new TestSuite(ErrorParserTests.class.getName());
|
||||||
|
|
||||||
|
// Just add more test cases here as you create them for
|
||||||
|
// each class being tested
|
||||||
|
suite.addTest(GCCErrorParserTests.suite());
|
||||||
|
suite.addTest(FileBasedErrorParserTests.suite());
|
||||||
|
return suite;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package org.eclipse.cdt.core.internal.errorparsers.tests;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import junit.framework.Test;
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.testplugin.CTestPlugin;
|
||||||
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
|
public class FileBasedErrorParserTests extends GenericErrorParserTests {
|
||||||
|
|
||||||
|
File errorFile;
|
||||||
|
|
||||||
|
public FileBasedErrorParserTests(File file) {
|
||||||
|
super("testErrorsInFiles");
|
||||||
|
errorFile = file;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return super.getName() + " " + errorFile.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testErrorsInFiles() throws IOException {
|
||||||
|
InputStream stream = new FileInputStream(errorFile);
|
||||||
|
|
||||||
|
runParserTest(stream, -1, -1, null, null, new String[]{GCC_ERROR_PARSER_ID});
|
||||||
|
stream.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
TestSuite suite = new TestSuite(FileBasedErrorParserTests.class.getName());
|
||||||
|
File dir = CTestPlugin.getDefault().getFileInPlugin(new Path("resources/errortests/"));
|
||||||
|
File[] testsfiles = dir.listFiles();
|
||||||
|
for (int i = 0; i < testsfiles.length; i++) {
|
||||||
|
suite.addTest(new FileBasedErrorParserTests(testsfiles[i]));
|
||||||
|
}
|
||||||
|
return suite;
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,37 +10,28 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.internal.errorparsers.tests;
|
package org.eclipse.cdt.core.internal.errorparsers.tests;
|
||||||
|
|
||||||
import java.io.StringBufferInputStream;
|
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.ErrorParserManager;
|
|
||||||
import org.eclipse.core.resources.IFile;
|
|
||||||
import org.eclipse.core.resources.IProject;
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test is designed to exercise the error parser capabilities.
|
* This test is designed to exercise the error parser capabilities.
|
||||||
*/
|
*/
|
||||||
public class GCCErrorParserTests extends GenericErrorParserTests {
|
public class GCCErrorParserTests extends GenericErrorParserTests {
|
||||||
public static final String GCC_ERROR_PARSER_ID = "org.eclipse.cdt.core.GCCErrorParser";
|
|
||||||
public static final String[] GCC_ERROR_STREAM1 = {
|
public static final String[] GCC_ERROR_STREAM1 = {
|
||||||
"qcc -c -I/qnx630/target/qnx6/usr/include -I/qnx630/target/qnx6/usr/include/photon -V3.3.1,gcc_ntox86 -w5 -O2 -I. ../abmain.c abmain.o",
|
"qcc -c -I/qnx630/target/qnx6/usr/include -I/qnx630/target/qnx6/usr/include/photon -V3.3.1,gcc_ntox86 -w5 -O2 -I. ../abmain.c abmain.o",
|
||||||
"In file included from ../globals.h:9,",
|
"In file included from ../globals.h:9,", " from ../abmain.c:36:",
|
||||||
" from ../abmain.c:36:",
|
"../_combolist.h:34:24: warning: no newline at end of file",};
|
||||||
"../_combolist.h:34:24: warning: no newline at end of file",
|
|
||||||
};
|
|
||||||
public static final int GCC_ERROR_STREAM1_WARNINGS = 1;
|
public static final int GCC_ERROR_STREAM1_WARNINGS = 1;
|
||||||
public static final int GCC_ERROR_STREAM1_ERRORS = 0;
|
public static final int GCC_ERROR_STREAM1_ERRORS = 0;
|
||||||
public static final String[] GCC_ERROR_STREAM1_FILENAMES = {"_combolist.h"};
|
public static final String[] GCC_ERROR_STREAM1_FILENAMES = {"_combolist.h"};
|
||||||
|
|
||||||
public static final String [] GCC_ERROR_STREAM2 = {
|
public static final String[] GCC_ERROR_STREAM2 = {"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:234: warning: `",
|
||||||
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:234: warning: `",
|
|
||||||
" RPNEvaluator<NumericType>::OperandConstant' is implicitly a typename",
|
" RPNEvaluator<NumericType>::OperandConstant' is implicitly a typename",
|
||||||
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:234: warning: implicit typename",
|
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:234: warning: implicit typename",
|
||||||
" is deprecated, please see the documentation for details"
|
" is deprecated, please see the documentation for details"};
|
||||||
};
|
|
||||||
public static final int GCC_ERROR_STREAM2_WARNINGS = 2;
|
public static final int GCC_ERROR_STREAM2_WARNINGS = 2;
|
||||||
public static final int GCC_ERROR_STREAM2_ERRORS = 0;
|
public static final int GCC_ERROR_STREAM2_ERRORS = 0;
|
||||||
public static final String[] GCC_ERROR_STREAM2_FILENAMES = {"RPNEvaluator.hpp"};
|
public static final String[] GCC_ERROR_STREAM2_FILENAMES = {"RPNEvaluator.hpp"};
|
||||||
|
@ -49,35 +40,32 @@ public class GCCErrorParserTests extends GenericErrorParserTests {
|
||||||
public static final String[] GCC_ERROR_STREAM3 = {
|
public static final String[] GCC_ERROR_STREAM3 = {
|
||||||
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:370: error: ISO C++ says that `",
|
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:370: error: ISO C++ says that `",
|
||||||
" char& String::operator[](unsigned int)' and `operator[]' are ambiguous even ",
|
" char& String::operator[](unsigned int)' and `operator[]' are ambiguous even ",
|
||||||
" though the worst conversion for the former is better than the worst ",
|
" though the worst conversion for the former is better than the worst ", " conversion for the latter"};
|
||||||
" conversion for the latter"
|
|
||||||
};
|
|
||||||
public static final int GCC_ERROR_STREAM3_WARNINGS = 0;
|
public static final int GCC_ERROR_STREAM3_WARNINGS = 0;
|
||||||
public static final int GCC_ERROR_STREAM3_ERRORS = 1;
|
public static final int GCC_ERROR_STREAM3_ERRORS = 1;
|
||||||
public static final String[] GCC_ERROR_STREAM3_FILENAMES = {"RPNEvaluator.hpp"};
|
public static final String[] GCC_ERROR_STREAM3_FILENAMES = {"RPNEvaluator.hpp"};
|
||||||
public static final String [] GCC_ERROR_STREAM3_DESCRIPTIONS = { "ISO C++", "are ambiguous", "worst conversion", "conversion for the latter" };
|
public static final String[] GCC_ERROR_STREAM3_DESCRIPTIONS = {"ISO C++", "are ambiguous", "worst conversion",
|
||||||
|
"conversion for the latter"};
|
||||||
|
|
||||||
public static final String [] GCC_ERROR_STREAM4 = {
|
public static final String[] GCC_ERROR_STREAM4 = {"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp: In member function `",
|
||||||
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp: In member function `",
|
" NumericType RPNEvaluator<NumericType>::evaluate(const char*) [with ", " NumericType = int8]':",
|
||||||
" NumericType RPNEvaluator<NumericType>::evaluate(const char*) [with ",
|
|
||||||
" NumericType = int8]':",
|
|
||||||
"C:/QNX630/workspace/System/src/CommonScriptClasses.cpp:609: instantiated from here",
|
"C:/QNX630/workspace/System/src/CommonScriptClasses.cpp:609: instantiated from here",
|
||||||
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:370: error: ISO C++ says that `",
|
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:370: error: ISO C++ says that `",
|
||||||
" char& String::operator[](unsigned int)' and `operator[]' are ambiguous even ",
|
" char& String::operator[](unsigned int)' and `operator[]' are ambiguous even ",
|
||||||
" though the worst conversion for the former is better than the worst ",
|
" though the worst conversion for the former is better than the worst ", " conversion for the latter"};
|
||||||
" conversion for the latter"
|
|
||||||
};
|
|
||||||
public static final int GCC_ERROR_STREAM4_WARNINGS = 0;
|
public static final int GCC_ERROR_STREAM4_WARNINGS = 0;
|
||||||
public static final int GCC_ERROR_STREAM4_ERRORS = 1;
|
public static final int GCC_ERROR_STREAM4_ERRORS = 1;
|
||||||
public static final String[] GCC_ERROR_STREAM4_FILENAMES = {"RPNEvaluator.hpp"};
|
public static final String[] GCC_ERROR_STREAM4_FILENAMES = {"RPNEvaluator.hpp"};
|
||||||
public static final String [] GCC_ERROR_STREAM4_DESCRIPTIONS = { "ISO C++", "are ambiguous", "worst conversion for", "conversion for the latter" };
|
public static final String[] GCC_ERROR_STREAM4_DESCRIPTIONS = {"ISO C++", "are ambiguous", "worst conversion for",
|
||||||
|
"conversion for the latter"};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for IndexManagerTest.
|
* Constructor for IndexManagerTest.
|
||||||
|
*
|
||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
public GCCErrorParserTests(String name) {
|
public GCCErrorParserTests() {
|
||||||
super(name);
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
|
@ -86,81 +74,22 @@ public class GCCErrorParserTests extends GenericErrorParserTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testMultipleIncludesError() {
|
public void testMultipleIncludesError() {
|
||||||
runParserTest(GCC_ERROR_STREAM1,
|
runParserTest(GCC_ERROR_STREAM1, GCC_ERROR_STREAM1_ERRORS, GCC_ERROR_STREAM1_WARNINGS, GCC_ERROR_STREAM1_FILENAMES, null,
|
||||||
GCC_ERROR_STREAM1_ERRORS,
|
new String[]{GCC_ERROR_PARSER_ID});
|
||||||
GCC_ERROR_STREAM1_WARNINGS,
|
|
||||||
GCC_ERROR_STREAM1_FILENAMES,
|
|
||||||
null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testMultiLineDescriptionError() {
|
public void testMultiLineDescriptionError() {
|
||||||
runParserTest(GCC_ERROR_STREAM2,
|
runParserTest(GCC_ERROR_STREAM2, GCC_ERROR_STREAM2_ERRORS, GCC_ERROR_STREAM2_WARNINGS, GCC_ERROR_STREAM2_FILENAMES,
|
||||||
GCC_ERROR_STREAM2_ERRORS,
|
GCC_ERROR_STREAM2_DESCRIPTIONS, new String[]{GCC_ERROR_PARSER_ID});
|
||||||
GCC_ERROR_STREAM2_WARNINGS,
|
|
||||||
GCC_ERROR_STREAM2_FILENAMES,
|
|
||||||
GCC_ERROR_STREAM2_DESCRIPTIONS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testLongMultiLineDescriptionError() {
|
public void testLongMultiLineDescriptionError() {
|
||||||
runParserTest(GCC_ERROR_STREAM3,
|
runParserTest(GCC_ERROR_STREAM3, GCC_ERROR_STREAM3_ERRORS, GCC_ERROR_STREAM3_WARNINGS, GCC_ERROR_STREAM3_FILENAMES,
|
||||||
GCC_ERROR_STREAM3_ERRORS,
|
GCC_ERROR_STREAM3_DESCRIPTIONS, new String[]{GCC_ERROR_PARSER_ID});
|
||||||
GCC_ERROR_STREAM3_WARNINGS,
|
|
||||||
GCC_ERROR_STREAM3_FILENAMES,
|
|
||||||
GCC_ERROR_STREAM3_DESCRIPTIONS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testMultiFileMultiLineSingleError() {
|
public void testMultiFileMultiLineSingleError() {
|
||||||
runParserTest(GCC_ERROR_STREAM4,
|
runParserTest(GCC_ERROR_STREAM4, GCC_ERROR_STREAM4_ERRORS, GCC_ERROR_STREAM4_WARNINGS, GCC_ERROR_STREAM4_FILENAMES,
|
||||||
GCC_ERROR_STREAM4_ERRORS,
|
GCC_ERROR_STREAM4_DESCRIPTIONS, new String[]{GCC_ERROR_PARSER_ID});
|
||||||
GCC_ERROR_STREAM4_WARNINGS,
|
|
||||||
GCC_ERROR_STREAM4_FILENAMES,
|
|
||||||
GCC_ERROR_STREAM4_DESCRIPTIONS);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void runParserTest(String [] dataStream,
|
|
||||||
int expectedErrorCount,
|
|
||||||
int expectedWarningCount,
|
|
||||||
String [] expectedFileNames,
|
|
||||||
String [] expectedDescriptions ) {
|
|
||||||
String [] parserID = { GCC_ERROR_PARSER_ID };
|
|
||||||
CountingMarkerGenerator markerGenerator = new CountingMarkerGenerator();
|
|
||||||
|
|
||||||
IProject project = getTempProject();
|
|
||||||
assertNotNull(project);
|
|
||||||
|
|
||||||
ErrorParserManager manager;
|
|
||||||
manager = new ImaginaryFilesErrorParserManager(project, markerGenerator, parserID);
|
|
||||||
|
|
||||||
String errorStream = makeStringFromArray(dataStream, "\n");
|
|
||||||
StringBufferInputStream inputStream = new StringBufferInputStream(errorStream);
|
|
||||||
assertNotNull(inputStream);
|
|
||||||
|
|
||||||
try {
|
|
||||||
transferInputStreamToOutputStream(inputStream, manager.getOutputStream(), 1024);
|
|
||||||
} catch(Exception ex) {
|
|
||||||
assertTrue(false);
|
|
||||||
} finally {
|
|
||||||
try {
|
|
||||||
manager.close();
|
|
||||||
} catch(Exception ex) {
|
|
||||||
/* Ignore */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
manager.reportProblems();
|
|
||||||
|
|
||||||
assertEquals(expectedErrorCount, markerGenerator.numErrors);
|
|
||||||
assertEquals(expectedWarningCount, markerGenerator.numWarnings);
|
|
||||||
assertEquals(expectedFileNames.length, markerGenerator.uniqFiles.size());
|
|
||||||
for(int i= 0; i < expectedFileNames.length; i++) {
|
|
||||||
IPath path = ((IFile)markerGenerator.uniqFiles.get(i)).getLocation();
|
|
||||||
assertEquals(expectedFileNames[i], path.lastSegment());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(expectedDescriptions != null) {
|
|
||||||
assertNotNull(markerGenerator.lastDescription);
|
|
||||||
for(int i = 0; i < expectedDescriptions.length; i++) {
|
|
||||||
assertTrue(markerGenerator.lastDescription.matches(expectedDescriptions[i]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -10,10 +10,10 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.internal.errorparsers.tests;
|
package org.eclipse.cdt.core.internal.errorparsers.tests;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.StringBufferInputStream;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
@ -33,16 +33,23 @@ import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
* This test is designed to exercise the error parser capabilities.
|
* This test is designed to exercise the error parser capabilities.
|
||||||
*/
|
*/
|
||||||
public class GenericErrorParserTests extends TestCase {
|
public class GenericErrorParserTests extends TestCase {
|
||||||
|
public static final String GCC_ERROR_PARSER_ID = "org.eclipse.cdt.core.GCCErrorParser";
|
||||||
|
|
||||||
protected IProject fTempProject;
|
protected IProject fTempProject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for IndexManagerTest.
|
* Constructor for IndexManagerTest.
|
||||||
|
*
|
||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
public GenericErrorParserTests(String name) {
|
public GenericErrorParserTests(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GenericErrorParserTests() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @see TestCase#setUp()
|
* @see TestCase#setUp()
|
||||||
*/
|
*/
|
||||||
|
@ -94,8 +101,68 @@ public class GenericErrorParserTests extends TestCase {
|
||||||
buffer = null;
|
buffer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void runParserTest(InputStream inputStream, int expectedErrorCount, int expectedWarningCount,
|
||||||
|
String[] expectedFileNames, String[] expectedDescriptions, String[] parserID) {
|
||||||
|
|
||||||
|
assertNotNull(inputStream);
|
||||||
|
|
||||||
|
CountingMarkerGenerator markerGenerator = new CountingMarkerGenerator();
|
||||||
|
|
||||||
|
IProject project = getTempProject();
|
||||||
|
assertNotNull(project);
|
||||||
|
|
||||||
|
ErrorParserManager manager;
|
||||||
|
manager = new ImaginaryFilesErrorParserManager(project, markerGenerator, parserID);
|
||||||
|
|
||||||
|
try {
|
||||||
|
transferInputStreamToOutputStream(inputStream, manager.getOutputStream(), 1024);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
assertTrue(false);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
manager.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
/* Ignore */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
manager.reportProblems();
|
||||||
|
|
||||||
|
if (expectedErrorCount >= 0) {
|
||||||
|
assertEquals(expectedErrorCount, markerGenerator.numErrors);
|
||||||
|
}
|
||||||
|
if (expectedWarningCount >= 0) {
|
||||||
|
assertEquals(expectedWarningCount, markerGenerator.numWarnings);
|
||||||
|
}
|
||||||
|
if (expectedFileNames != null) {
|
||||||
|
assertEquals(expectedFileNames.length, markerGenerator.uniqFiles.size());
|
||||||
|
for (int i = 0; i < expectedFileNames.length; i++) {
|
||||||
|
IPath path = ((IFile)markerGenerator.uniqFiles.get(i)).getLocation();
|
||||||
|
assertEquals(expectedFileNames[i], path.lastSegment());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (expectedDescriptions != null) {
|
||||||
|
assertNotNull(markerGenerator.lastDescription);
|
||||||
|
for (int i = 0; i < expectedDescriptions.length; i++) {
|
||||||
|
assertTrue(markerGenerator.lastDescription.matches(expectedDescriptions[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void runParserTest(String[] dataStream, int expectedErrorCount, int expectedWarningCount, String[] expectedFileNames,
|
||||||
|
String[] expectedDescriptions, String[] parserID) {
|
||||||
|
String errorStream = makeStringFromArray(dataStream, "\n");
|
||||||
|
|
||||||
|
ByteArrayInputStream inputStream = new ByteArrayInputStream(errorStream.getBytes());
|
||||||
|
|
||||||
|
runParserTest(inputStream, expectedErrorCount, expectedWarningCount, expectedFileNames, expectedDescriptions, parserID);
|
||||||
|
}
|
||||||
|
|
||||||
class FileNameComparator implements Comparator {
|
class FileNameComparator implements Comparator {
|
||||||
/* (non-Javadoc)
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
|
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public int compare(Object arg0, Object arg1) {
|
public int compare(Object arg0, Object arg1) {
|
||||||
|
@ -114,6 +181,7 @@ public class GenericErrorParserTests extends TestCase {
|
||||||
* Expand and grow this class to make it more usefull.
|
* Expand and grow this class to make it more usefull.
|
||||||
*/
|
*/
|
||||||
class CountingMarkerGenerator implements IMarkerGenerator {
|
class CountingMarkerGenerator implements IMarkerGenerator {
|
||||||
|
|
||||||
public int numErrors;
|
public int numErrors;
|
||||||
public int numWarnings;
|
public int numWarnings;
|
||||||
public int numMarkers;
|
public int numMarkers;
|
||||||
|
@ -146,10 +214,11 @@ public class GenericErrorParserTests extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class allows us to run error parsers for files which don't
|
* This class allows us to run error parsers for files which don't really
|
||||||
* really exist by just using the strings that come out as error codes.
|
* exist by just using the strings that come out as error codes.
|
||||||
*/
|
*/
|
||||||
class ImaginaryFilesErrorParserManager extends ErrorParserManager {
|
class ImaginaryFilesErrorParserManager extends ErrorParserManager {
|
||||||
|
|
||||||
IProject fProject;
|
IProject fProject;
|
||||||
|
|
||||||
public ImaginaryFilesErrorParserManager(IProject project, IMarkerGenerator generator, String[] ids) {
|
public ImaginaryFilesErrorParserManager(IProject project, IMarkerGenerator generator, String[] ids) {
|
||||||
|
@ -164,7 +233,7 @@ public class GenericErrorParserTests extends TestCase {
|
||||||
IFile file = fProject.getFile(fileName);
|
IFile file = fProject.getFile(fileName);
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
try {
|
try {
|
||||||
InputStream stream = new StringBufferInputStream("TestFile");
|
InputStream stream = new ByteArrayInputStream("TestFile".getBytes());
|
||||||
file.create(stream, true, new NullProgressMonitor());
|
file.create(stream, true, new NullProgressMonitor());
|
||||||
stream.close();
|
stream.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
@ -178,7 +247,7 @@ public class GenericErrorParserTests extends TestCase {
|
||||||
IFile file = fProject.getFile(path.lastSegment());
|
IFile file = fProject.getFile(path.lastSegment());
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
try {
|
try {
|
||||||
InputStream stream = new StringBufferInputStream("TestFile");
|
InputStream stream = new ByteArrayInputStream("TestFile".getBytes());
|
||||||
file.create(stream, true, new NullProgressMonitor());
|
file.create(stream, true, new NullProgressMonitor());
|
||||||
stream.close();
|
stream.close();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
443
core/org.eclipse.cdt.core.tests/resources/errortests/output-1
Normal file
443
core/org.eclipse.cdt.core.tests/resources/errortests/output-1
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue