mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fixed breakage of lrparser and xlc tests.
This commit is contained in:
parent
83a8040a2b
commit
b83af889fb
1 changed files with 13 additions and 0 deletions
|
@ -70,7 +70,19 @@ public class TestSourceReader {
|
||||||
*/
|
*/
|
||||||
public static StringBuilder[] getContentsForTest(Bundle bundle, String srcRoot, Class clazz,
|
public static StringBuilder[] getContentsForTest(Bundle bundle, String srcRoot, Class clazz,
|
||||||
final String testName, int sections) throws IOException {
|
final String testName, int sections) throws IOException {
|
||||||
|
// Walk up the class inheritance chain until we find the test method.
|
||||||
|
try {
|
||||||
|
while (clazz.getMethod(testName).getDeclaringClass() != clazz) {
|
||||||
|
clazz = clazz.getSuperclass();
|
||||||
|
}
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
Assert.fail(e.getMessage());
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
Assert.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
// Find and open the .java file for the class clazz.
|
||||||
String fqn = clazz.getName().replace('.', '/');
|
String fqn = clazz.getName().replace('.', '/');
|
||||||
fqn = fqn.indexOf("$") == -1 ? fqn : fqn.substring(0, fqn.indexOf("$"));
|
fqn = fqn.indexOf("$") == -1 ? fqn : fqn.substring(0, fqn.indexOf("$"));
|
||||||
String classFile = fqn + ".java";
|
String classFile = fqn + ".java";
|
||||||
|
@ -94,6 +106,7 @@ public class TestSourceReader {
|
||||||
|
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(in));
|
BufferedReader br = new BufferedReader(new InputStreamReader(in));
|
||||||
try {
|
try {
|
||||||
|
// Read the java file collecting comments until we encounter the test method.
|
||||||
List<StringBuilder> contents = new ArrayList<StringBuilder>();
|
List<StringBuilder> contents = new ArrayList<StringBuilder>();
|
||||||
StringBuilder content = new StringBuilder();
|
StringBuilder content = new StringBuilder();
|
||||||
for (String line = br.readLine(); line != null; line = br.readLine()) {
|
for (String line = br.readLine(); line != null; line = br.readLine()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue