1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

renamed a lot of the LR parser tests

This commit is contained in:
Mike Kucera 2008-04-29 17:50:47 +00:00
parent 4b12c3a302
commit 6890b6b24e
47 changed files with 379 additions and 523 deletions

View file

@ -3,16 +3,13 @@ Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0 Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.eclipse.cdt.core.lrparser.tests Bundle-SymbolicName: org.eclipse.cdt.core.lrparser.tests
Bundle-Version: 4.0.0.qualifier Bundle-Version: 4.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.core.lrparser.tests.c99.Activator
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: org.eclipse.core.runtime,
org.junit, org.junit,
org.eclipse.cdt.core.tests, org.eclipse.cdt.core.tests,
org.eclipse.cdt.core, org.eclipse.cdt.core,
org.eclipse.core.resources, org.eclipse.core.resources,
org.eclipse.cdt.core.lrparser;bundle-version="4.0.1" org.eclipse.cdt.core.lrparser;bundle-version="4.0.1"
Export-Package: org.eclipse.cdt.core.lrparser.tests, Export-Package: org.eclipse.cdt.core.lrparser.tests
org.eclipse.cdt.core.lrparser.tests.c99,
org.eclipse.cdt.core.lrparser.tests.cpp
Bundle-Vendor: %Bundle-Vendor.0 Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-RequiredExecutionEnvironment: J2SE-1.5

View file

@ -1,20 +1,19 @@
package org.eclipse.cdt.core.lrparser.tests.cpp; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage; import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.AST2CPPSpecTest; import org.eclipse.cdt.core.parser.tests.ast2.AST2CPPSpecTest;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class ISOCPPSpecTest extends AST2CPPSpecTest { public class LRCPPSpecTest extends AST2CPPSpecTest {
public ISOCPPSpecTest() { } public LRCPPSpecTest() { }
public ISOCPPSpecTest(String name) { super(name); } public LRCPPSpecTest(String name) { super(name); }
@Override @Override

View file

@ -1,4 +1,4 @@
package org.eclipse.cdt.core.lrparser.tests.cpp; package org.eclipse.cdt.core.lrparser.tests;
import junit.framework.AssertionFailedError; import junit.framework.AssertionFailedError;
import junit.framework.TestSuite; import junit.framework.TestSuite;
@ -6,25 +6,24 @@ import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.AST2CPPTests; import org.eclipse.cdt.core.parser.tests.ast2.AST2CPPTests;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class ISOCPPTests extends AST2CPPTests { public class LRCPPTests extends AST2CPPTests {
public static TestSuite suite() { public static TestSuite suite() {
return suite(ISOCPPTests.class); return suite(LRCPPTests.class);
} }
public ISOCPPTests() { public LRCPPTests() {
} }
public ISOCPPTests(String name) { public LRCPPTests(String name) {
super(name); super(name);
} }

View file

@ -8,25 +8,23 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import junit.framework.AssertionFailedError; import junit.framework.AssertionFailedError;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.AST2CSpecTest; import org.eclipse.cdt.core.parser.tests.ast2.AST2CSpecTest;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99SpecTests extends AST2CSpecTest { public class LRCSpecTests extends AST2CSpecTest {
public C99SpecTests() { } public LRCSpecTests() { }
public C99SpecTests(String name) { super(name); } public LRCSpecTests(String name) { super(name); }
@Override @Override
@ -41,11 +39,11 @@ public class C99SpecTests extends AST2CSpecTest {
return ParseHelper.parse(code, language, true, checkBindings, expectedProblemBindings ); return ParseHelper.parse(code, language, true, checkBindings, expectedProblemBindings );
} }
protected BaseExtensibleLanguage getCLanguage() { protected ILanguage getCLanguage() {
return C99Language.getDefault(); return C99Language.getDefault();
} }
protected BaseExtensibleLanguage getCPPLanguage() { protected ILanguage getCPPLanguage() {
return ISOCPPLanguage.getDefault(); return ISOCPPLanguage.getDefault();
} }

View file

@ -8,21 +8,20 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.dom.ast.IASTComment; import org.eclipse.cdt.core.dom.ast.IASTComment;
import org.eclipse.cdt.core.dom.ast.IASTFileLocation; import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.CommentTests; import org.eclipse.cdt.core.parser.tests.ast2.CommentTests;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99CommentTests extends CommentTests { public class LRCommentTests extends CommentTests {
@Override @Override

View file

@ -8,19 +8,18 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import junit.framework.AssertionFailedError; import junit.framework.AssertionFailedError;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.CompleteParser2Tests; import org.eclipse.cdt.core.parser.tests.ast2.CompleteParser2Tests;
public class C99CompleteParser2Tests extends CompleteParser2Tests { public class LRCompleteParser2Tests extends CompleteParser2Tests {
@Override @Override
@SuppressWarnings("unused") @SuppressWarnings("unused")

View file

@ -8,7 +8,7 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; import org.eclipse.cdt.core.dom.ast.IASTCompletionNode;
import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTName;
@ -17,16 +17,15 @@ import org.eclipse.cdt.core.dom.ast.IFunction;
import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.prefix.BasicCompletionTest; import org.eclipse.cdt.core.parser.tests.prefix.BasicCompletionTest;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99CompletionBasicTest extends BasicCompletionTest { public class LRCompletionBasicTest extends BasicCompletionTest {
public C99CompletionBasicTest() { } public LRCompletionBasicTest() { }
@Override @Override

View file

@ -8,7 +8,7 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -24,19 +24,18 @@ import org.eclipse.cdt.core.dom.ast.IEnumerator;
import org.eclipse.cdt.core.dom.ast.IField; import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.IVariable; import org.eclipse.cdt.core.dom.ast.IVariable;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper; import org.eclipse.cdt.core.model.ILanguage;
/** /**
* Reuse the completion parse tests from the old parser for now. * Reuse the completion parse tests from the old parser for now.
*/ */
@SuppressWarnings("nls") @SuppressWarnings("nls")
public class C99CompletionParseTest extends TestCase { public class LRCompletionParseTest extends TestCase {
public C99CompletionParseTest() { } public LRCompletionParseTest() { }
public C99CompletionParseTest(String name) { super(name); } public LRCompletionParseTest(String name) { super(name); }
protected IASTCompletionNode parse(String code, int offset) throws Exception { protected IASTCompletionNode parse(String code, int offset) throws Exception {
@ -63,7 +62,7 @@ public class C99CompletionParseTest extends TestCase {
} }
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getC99Language() {
return C99Language.getDefault(); return C99Language.getDefault();
} }
@ -288,11 +287,10 @@ public class C99CompletionParseTest extends TestCase {
public void testCompletionStructPointer() throws Exception { public void testCompletionStructPointer() throws Exception {
StringBuffer sb = new StringBuffer(); String code =
sb.append(" struct Temp { char * total; };" ); " struct Temp { char * total; };" +
sb.append(" int f(struct Temp * t) {" ); " int f(struct Temp * t) {" +
sb.append(" t->t[5] = t->" ); " t->t[5] = t->";
String code = sb.toString();
int index = code.indexOf("= t->"); int index = code.indexOf("= t->");
@ -310,19 +308,18 @@ public class C99CompletionParseTest extends TestCase {
public void testCompletionEnum() throws Exception { public void testCompletionEnum() throws Exception {
StringBuffer sb = new StringBuffer(); String code =
sb.append( "typedef int DWORD;\n" ); //$NON-NLS-1$ "typedef int DWORD;\n" +
sb.append( "typedef char BYTE;\n"); //$NON-NLS-1$ "typedef char BYTE;\n" +
sb.append( "#define MAKEFOURCC(ch0, ch1, ch2, ch3) \\\n"); //$NON-NLS-1$ "#define MAKEFOURCC(ch0, ch1, ch2, ch3) \\\n" +
sb.append( "((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \\\n"); //$NON-NLS-1$ "((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \\\n" +
sb.append( "((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))\n"); //$NON-NLS-1$ "((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))\n" +
sb.append( "enum e {\n"); //$NON-NLS-1$ "enum e {\n" +
sb.append( "blah1 = 5,\n"); //$NON-NLS-1$ "blah1 = 5,\n" +
sb.append( "blah2 = MAKEFOURCC('a', 'b', 'c', 'd'),\n"); //$NON-NLS-1$ "blah2 = MAKEFOURCC('a', 'b', 'c', 'd'),\n" +
sb.append( "blah3\n"); //$NON-NLS-1$ "blah3\n" +
sb.append( "};\n"); //$NON-NLS-1$ "};\n" +
sb.append( "e mye = bl\n"); //$NON-NLS-1$ "e mye = bl\n";
String code = sb.toString();
int index = code.indexOf("= bl"); int index = code.indexOf("= bl");
@ -342,12 +339,11 @@ public class C99CompletionParseTest extends TestCase {
public void testCompletionStructArray() throws Exception { public void testCompletionStructArray() throws Exception {
StringBuffer sb = new StringBuffer(); String code =
sb.append( "struct packet { int a; int b; };\n" ); //$NON-NLS-1$ "struct packet { int a; int b; };\n" +
sb.append( "struct packet buffer[5];\n" ); //$NON-NLS-1$ "struct packet buffer[5];\n" +
sb.append( "int main(int argc, char **argv) {\n" ); //$NON-NLS-1$ "int main(int argc, char **argv) {\n" +
sb.append( " buffer[2]." ); //$NON-NLS-1$ " buffer[2].";
String code = sb.toString();
int index = code.indexOf("[2]."); int index = code.indexOf("[2].");
@ -376,12 +372,11 @@ public class C99CompletionParseTest extends TestCase {
} }
public void testCompletionPreprocessorMacro() throws Exception { public void testCompletionPreprocessorMacro() throws Exception {
StringBuffer sb = new StringBuffer(); String code =
sb.append( "#define AMACRO 99 \n"); "#define AMACRO 99 \n" +
sb.append( "int main() { \n"); "int main() { \n" +
sb.append( " int AVAR; \n"); " int AVAR; \n" +
sb.append( " int x = A \n"); " int x = A \n";
String code = sb.toString();
int index = code.indexOf("= A"); int index = code.indexOf("= A");
@ -394,13 +389,11 @@ public class C99CompletionParseTest extends TestCase {
} }
public void testCompletionInsidePreprocessorDirective() throws Exception { public void testCompletionInsidePreprocessorDirective() throws Exception {
StringBuffer sb = new StringBuffer(); String code =
sb.append( "#define MAC1 99 \n"); "#define MAC1 99 \n" +
sb.append( "#define MAC2 99 \n"); "#define MAC2 99 \n" +
sb.append( "#ifdef MA"); "#ifdef MA";
String code = sb.toString();
int index = code.length(); int index = code.length();

View file

@ -8,7 +8,7 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
@ -23,16 +23,16 @@ import org.eclipse.cdt.internal.core.dom.SavedCodeReaderFactory;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99DOMLocationInclusionTests extends DOMLocationInclusionTests { public class LRDOMLocationInclusionTests extends DOMLocationInclusionTests {
public C99DOMLocationInclusionTests() { public LRDOMLocationInclusionTests() {
} }
public C99DOMLocationInclusionTests(String name, Class<Object> className) { public LRDOMLocationInclusionTests(String name, Class<Object> className) {
super(name, className); super(name, className);
} }
public C99DOMLocationInclusionTests(String name) { public LRDOMLocationInclusionTests(String name) {
super(name); super(name);
} }

View file

@ -8,27 +8,26 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.DOMLocationMacroTests; import org.eclipse.cdt.core.parser.tests.ast2.DOMLocationMacroTests;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99DOMLocationMacroTests extends DOMLocationMacroTests { public class LRDOMLocationMacroTests extends DOMLocationMacroTests {
public C99DOMLocationMacroTests() { public LRDOMLocationMacroTests() {
super(); super();
} }
public C99DOMLocationMacroTests(String name) { public LRDOMLocationMacroTests(String name) {
super(name); super(name);
} }

View file

@ -8,24 +8,23 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import junit.framework.AssertionFailedError; import junit.framework.AssertionFailedError;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.DOMLocationTests; import org.eclipse.cdt.core.parser.tests.ast2.DOMLocationTests;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99DOMLocationTests extends DOMLocationTests { public class LRDOMLocationTests extends DOMLocationTests {
public C99DOMLocationTests() { } public LRDOMLocationTests() { }
public C99DOMLocationTests(String name) { super(name); } public LRDOMLocationTests(String name) { super(name); }
@Override @Override
@SuppressWarnings("unused") @SuppressWarnings("unused")

View file

@ -8,19 +8,18 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.DOMPreprocessorInformationTest; import org.eclipse.cdt.core.parser.tests.ast2.DOMPreprocessorInformationTest;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99DOMPreprocessorInformationTest extends DOMPreprocessorInformationTest { public class LRDOMPreprocessorInformationTest extends DOMPreprocessorInformationTest {
@Override @Override
@SuppressWarnings("unused") @SuppressWarnings("unused")

View file

@ -8,7 +8,7 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import junit.framework.TestCase; import junit.framework.TestCase;
@ -31,38 +31,40 @@ import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTStatement; import org.eclipse.cdt.core.dom.ast.IASTStatement;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression; import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper; import org.eclipse.cdt.core.model.ILanguage;
/**
* TODO these tests can be moved into the core
*/
@SuppressWarnings("nls") @SuppressWarnings("nls")
public class C99DigraphTrigraphTests extends TestCase { public class LRDigraphTrigraphTests extends TestCase {
public C99DigraphTrigraphTests() { } public LRDigraphTrigraphTests() { }
public C99DigraphTrigraphTests(String name) { super(name); } public LRDigraphTrigraphTests(String name) { super(name); }
protected IASTTranslationUnit parse(String code) { protected IASTTranslationUnit parse(String code) {
return ParseHelper.parse(code, getLanguage(), true); return ParseHelper.parse(code, getCLanguage(), true);
} }
protected BaseExtensibleLanguage getLanguage() { protected ILanguage getCLanguage() {
return C99Language.getDefault(); return C99Language.getDefault();
} }
public void testTrigraphSequences() { public void testTrigraphSequences() {
StringBuffer sb = new StringBuffer(); String code =
sb.append("??=define SIZE ??/ \n"); // trigraph used as backslash to ignore newline "??=define SIZE ??/ \n" + // trigraph used as backslash to ignore newline
sb.append("99 \n"); "99 \n" +
sb.append("int main(void)??< \n"); "int main(void)??< \n" +
sb.append(" int arr??(SIZE??); \n"); " int arr??(SIZE??); \n" +
sb.append(" arr??(4??) = '0' - (??-0 ??' 1 ??! 2); \n"); " arr??(4??) = '0' - (??-0 ??' 1 ??! 2); \n" +
sb.append(" printf(\"%c??/n\", arr??(4??)); \n"); " printf(\"%c??/n\", arr??(4??)); \n" +
sb.append("??> \n"); "??> \n";
String code = sb.toString();
IASTTranslationUnit tu = parse(code); IASTTranslationUnit tu = parse(code);
assertNotNull(tu); assertNotNull(tu);
@ -107,23 +109,22 @@ public class C99DigraphTrigraphTests extends TestCase {
public void testTrigraphEscapeSequences() { public void testTrigraphEscapeSequences() {
// a ??/ trigraph should act just like a backslash in a string literal // a ??/ trigraph should act just like a backslash in a string literal
StringBuffer sb = new StringBuffer(); String code =
sb.append("int main(void)??< \n"); "int main(void)??< \n" +
sb.append(" char str[] = \"??/\"??/n\"; \n"); " char str[] = \"??/\"??/n\"; \n" +
sb.append(" char c = '??/u0000'; \n"); " char c = '??/u0000'; \n" +
sb.append("??> \n"); "??> \n";
String code = sb.toString();
parse(code); // will throw an exception if there are parse errors parse(code); // will throw an exception if there are parse errors
} }
public void testDigraphSequences() { public void testDigraphSequences() {
StringBuffer sb = new StringBuffer(); String code =
sb.append("%:define join(a, b) a %:%: b \n"); "%:define join(a, b) a %:%: b \n" +
sb.append("int main() <% \n"); "int main() <% \n" +
sb.append(" int arr<:5:>; \n"); " int arr<:5:>; \n" +
sb.append("%> \n"); "%> \n";
String code = sb.toString();
IASTTranslationUnit tu = parse(code); // will throw an exception if there are parse errors IASTTranslationUnit tu = parse(code); // will throw an exception if there are parse errors
@ -143,16 +144,15 @@ public class C99DigraphTrigraphTests extends TestCase {
public void testTrigraphAndDigraphSequecesInPreprocessorDirectives() { public void testTrigraphAndDigraphSequecesInPreprocessorDirectives() {
StringBuffer sb = new StringBuffer(); String code =
sb.append("%:define join1(a, b) a %:%: b \n"); "%:define join1(a, b) a %:%: b \n" +
sb.append("%:define str1(a) %: a \n"); "%:define str1(a) %: a \n" +
sb.append("??=define join2(a, b) a ??=??= b \n"); "??=define join2(a, b) a ??=??= b \n" +
sb.append("??=define str2(a) ??= a \n"); "??=define str2(a) ??= a \n" +
sb.append("int main() <% \n"); "int main() <% \n" +
sb.append(" int join1(x, y) = str1(its all good); \n"); " int join1(x, y) = str1(its all good); \n" +
sb.append(" int join2(a, b) = str2(its still good); \n"); " int join2(a, b) = str2(its still good); \n" +
sb.append("%> \n"); "%> \n";
String code = sb.toString();
IASTTranslationUnit tu = parse(code); // will throw an exception if there are parse errors IASTTranslationUnit tu = parse(code); // will throw an exception if there are parse errors

View file

@ -8,22 +8,21 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.GCCTests; import org.eclipse.cdt.core.parser.tests.ast2.GCCTests;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99GCCTests extends GCCTests { public class LRGCCTests extends GCCTests {
public C99GCCTests() {} public LRGCCTests() {}
public C99GCCTests(String name) { super(name); } public LRGCCTests(String name) { super(name); }
@Override @Override

View file

@ -8,12 +8,11 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.AST2KnRTests; import org.eclipse.cdt.core.parser.tests.ast2.AST2KnRTests;
@ -23,7 +22,7 @@ import org.eclipse.cdt.internal.core.parser.ParserException;
* @author Mike Kucera * @author Mike Kucera
*/ */
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99KnRTests extends AST2KnRTests { public class LRKnRTests extends AST2KnRTests {
@Override @Override

View file

@ -10,8 +10,7 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.lrparser.tests.c99.*;
import org.eclipse.cdt.core.lrparser.tests.cpp.ISOCPPParserTestSuite;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestSuite; import junit.framework.TestSuite;
@ -28,12 +27,35 @@ public class LRParserTestSuite extends TestSuite {
// and perhaps others // and perhaps others
public static Test suite() { public static Test suite() {
TestSuite suite = new TestSuite(); return new TestSuite() {{
suite.addTest(C99ParserTestSuite.suite()); addTestSuite(LRTests.class); // has some tests that do fail
suite.addTest(ISOCPPParserTestSuite.suite());
return suite; addTestSuite(LRCSpecTests.class); // a couple of failures
addTestSuite(LRKnRTests.class); // mostly fail due to ambiguities
// The majority of the content assist test are in the ui tests plugin
addTestSuite(LRCompletionBasicTest.class);
addTestSuite(LRCompletionParseTest.class);
// this one still has a lot of failing tests though
addTestSuite(LRSelectionParseTest.class);
addTestSuite(LRDOMLocationInclusionTests.class);
addTestSuite(LRDOMLocationTests.class);
addTestSuite(LRDOMLocationMacroTests.class);
addTestSuite(LRDOMPreprocessorInformationTest.class);
addTestSuite(LRCommentTests.class);
addTestSuite(LRDigraphTrigraphTests.class);
addTestSuite(LRGCCTests.class);
addTestSuite(LRUtilOldTests.class);
addTestSuite(LRUtilTests.class);
addTestSuite(LRCompleteParser2Tests.class);
addTestSuite(LRTaskParserTest.class);
addTestSuite(LRCPPSpecTest.class);
addTestSuite(LRCPPTests.class);
}};
} }
} }

View file

@ -8,14 +8,13 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.dom.ICodeReaderFactory; import org.eclipse.cdt.core.dom.ICodeReaderFactory;
import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.CodeReader; import org.eclipse.cdt.core.parser.CodeReader;
import org.eclipse.cdt.core.parser.IScannerInfo; import org.eclipse.cdt.core.parser.IScannerInfo;
@ -27,10 +26,10 @@ import org.eclipse.cdt.internal.core.parser.ParserException;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99SelectionParseTest extends AST2SelectionParseTest { public class LRSelectionParseTest extends AST2SelectionParseTest {
public C99SelectionParseTest() {} public LRSelectionParseTest() {}
public C99SelectionParseTest(String name) { super(name); } public LRSelectionParseTest(String name) { super(name); }
@Override @Override
protected IASTNode parse(String code, ParserLanguage lang, int offset, int length) throws ParserException { protected IASTNode parse(String code, ParserLanguage lang, int offset, int length) throws ParserException {

View file

@ -8,19 +8,18 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.TaskParserTest; import org.eclipse.cdt.core.parser.tests.ast2.TaskParserTest;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99TaskParserTest extends TaskParserTest { public class LRTaskParserTest extends TaskParserTest {
@Override @Override
@SuppressWarnings("unused") @SuppressWarnings("unused")

View file

@ -8,7 +8,7 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import junit.framework.TestSuite; import junit.framework.TestSuite;
@ -18,7 +18,6 @@ import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.c.ICASTSimpleDeclSpecifier; import org.eclipse.cdt.core.dom.ast.c.ICASTSimpleDeclSpecifier;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.AST2Tests; import org.eclipse.cdt.core.parser.tests.ast2.AST2Tests;
@ -31,13 +30,13 @@ import org.eclipse.cdt.internal.core.parser.ParserException;
* *
*/ */
@SuppressWarnings({ "nls", "restriction" }) @SuppressWarnings({ "nls", "restriction" })
public class C99Tests extends AST2Tests { public class LRTests extends AST2Tests {
public static TestSuite suite() { public static TestSuite suite() {
return suite(C99Tests.class); return suite(LRTests.class);
} }
public C99Tests(String name) { public LRTests(String name) {
super(name); super(name);
} }

View file

@ -8,21 +8,20 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import junit.framework.AssertionFailedError; import junit.framework.AssertionFailedError;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.AST2UtilOldTests; import org.eclipse.cdt.core.parser.tests.ast2.AST2UtilOldTests;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99UtilOldTests extends AST2UtilOldTests { public class LRUtilOldTests extends AST2UtilOldTests {
@Override @Override

View file

@ -8,19 +8,18 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99; package org.eclipse.cdt.core.lrparser.tests;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage; import org.eclipse.cdt.core.dom.lrparser.cpp.ISOCPPLanguage;
import org.eclipse.cdt.core.lrparser.tests.ParseHelper;
import org.eclipse.cdt.core.model.ILanguage; import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.AST2UtilTests; import org.eclipse.cdt.core.parser.tests.ast2.AST2UtilTests;
import org.eclipse.cdt.internal.core.parser.ParserException; import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class C99UtilTests extends AST2UtilTests { public class LRUtilTests extends AST2UtilTests {
@Override @Override
protected IASTTranslationUnit parse( String code, ParserLanguage lang ) throws ParserException { protected IASTTranslationUnit parse( String code, ParserLanguage lang ) throws ParserException {

View file

@ -1,54 +0,0 @@
/*******************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.cdt.core.parser.c99.tests"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -1,56 +0,0 @@
/*******************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.c99;
import junit.framework.Test;
import junit.framework.TestSuite;
public class C99ParserTestSuite extends TestSuite {
// TODO: the following test are not being reused
//
// DOMGCCSelectionParseExtensionsTest
// DOMSelectionParseTest
// GCCCompleteParseExtensionsTest
// QuickParser2Tests
//
// and perhaps others
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(C99Tests.class); // has some tests that do fail
suite.addTestSuite(C99SpecTests.class); // a couple of failures
suite.addTestSuite(C99KnRTests.class); // mostly fail due to ambiguities
// The majority of the content assist test are in the ui tests plugin
suite.addTestSuite(C99CompletionBasicTest.class);
suite.addTestSuite(C99CompletionParseTest.class);
// this one still has a lot of failing tests though
suite.addTestSuite(C99SelectionParseTest.class);
suite.addTestSuite(C99DOMLocationInclusionTests.class);
suite.addTestSuite(C99DOMLocationTests.class);
suite.addTestSuite(C99DOMLocationMacroTests.class);
suite.addTestSuite(C99DOMPreprocessorInformationTest.class);
suite.addTestSuite(C99CommentTests.class);
suite.addTestSuite(C99DigraphTrigraphTests.class);
suite.addTestSuite(C99GCCTests.class);
suite.addTestSuite(C99UtilOldTests.class);
suite.addTestSuite(C99UtilTests.class);
suite.addTestSuite(C99CompleteParser2Tests.class);
suite.addTestSuite(C99TaskParserTest.class);
return suite;
}
}

View file

@ -1,27 +0,0 @@
/*******************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests.cpp;
import junit.framework.Test;
import junit.framework.TestSuite;
public class ISOCPPParserTestSuite extends TestSuite {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(ISOCPPSpecTest.class);
suite.addTestSuite(ISOCPPTests.class);
return suite;
}
}

View file

@ -1,26 +0,0 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99CompletionParseTest;
public class UPCC99CompletionParseTest extends C99CompletionParseTest {
public UPCC99CompletionParseTest() { }
public UPCC99CompletionParseTest(String name) { super(name); }
@Override
protected BaseExtensibleLanguage getC99Language() {
return UPCLanguage.getDefault();
}
}

View file

@ -1,30 +0,0 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99DOMLocationInclusionTests;
public class UPCC99DOMLocationInclusionTests extends C99DOMLocationInclusionTests {
public UPCC99DOMLocationInclusionTests() {
}
public UPCC99DOMLocationInclusionTests(String name) {
super(name);
}
@Override
protected BaseExtensibleLanguage getC99Language() {
return UPCLanguage.getDefault();
}
}

View file

@ -1,27 +0,0 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99DigraphTrigraphTests;
public class UPCC99DigraphTrigraphTests extends C99DigraphTrigraphTests {
public UPCC99DigraphTrigraphTests() { }
public UPCC99DigraphTrigraphTests(String name) { super(name); }
@Override
protected BaseExtensibleLanguage getLanguage() {
return UPCLanguage.getDefault();
}
}

View file

@ -1,27 +0,0 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99SelectionParseTest;
public class UPCC99SelectionParseTest extends C99SelectionParseTest {
public UPCC99SelectionParseTest() { }
public UPCC99SelectionParseTest(String name) { super(name); }
@Override
protected BaseExtensibleLanguage getC99Language() {
return UPCLanguage.getDefault();
}
}

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,17 +10,21 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99KnRTests; import org.eclipse.cdt.core.lrparser.tests.LRCSpecTests;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99KnRTests extends C99KnRTests { public class UPCCSpecTests extends LRCSpecTests {
public UPCC99KnRTests() { public UPCCSpecTests() {
}
public UPCCSpecTests(String name) {
super(name);
} }
@Override @Override
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getCLanguage() {
return UPCLanguage.getDefault(); return UPCLanguage.getDefault();
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,14 +10,14 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99CommentTests; import org.eclipse.cdt.core.lrparser.tests.LRCommentTests;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99CommentTests extends C99CommentTests { public class UPCCommentTests extends LRCommentTests {
@Override @Override
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getC99Language() {
return UPCLanguage.getDefault(); return UPCLanguage.getDefault();
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,14 +10,14 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99UtilOldTests; import org.eclipse.cdt.core.lrparser.tests.LRCompleteParser2Tests;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99UtilOldTests extends C99UtilOldTests { public class UPCCompleteParser2Tests extends LRCompleteParser2Tests {
@Override @Override
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getC99Language() {
return UPCLanguage.getDefault(); return UPCLanguage.getDefault();
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,16 +10,16 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.lrparser.c99.C99Language; import org.eclipse.cdt.core.dom.lrparser.c99.C99Language;
import org.eclipse.cdt.core.lrparser.tests.c99.C99CompletionBasicTest; import org.eclipse.cdt.core.lrparser.tests.LRCompletionBasicTest;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99CompletionBasicTest extends C99CompletionBasicTest { public class UPCCompletionBasicTest extends LRCompletionBasicTest {
public UPCC99CompletionBasicTest() { } public UPCCompletionBasicTest() { }
@Override @Override
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getC99Language() {
return C99Language.getDefault(); return C99Language.getDefault();
} }

View file

@ -0,0 +1,26 @@
/*******************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.LRCompletionParseTest;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCCompletionParseTest extends LRCompletionParseTest {
public UPCCompletionParseTest() { }
public UPCCompletionParseTest(String name) { super(name); }
@Override
protected ILanguage getC99Language() {
return UPCLanguage.getDefault();
}
}

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,22 +10,21 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99GCCTests; import org.eclipse.cdt.core.lrparser.tests.LRDOMLocationInclusionTests;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99GCCTests extends C99GCCTests { public class UPCDOMLocationInclusionTests extends LRDOMLocationInclusionTests {
public UPCC99GCCTests() { public UPCDOMLocationInclusionTests() {
} }
public UPCC99GCCTests(String message) { public UPCDOMLocationInclusionTests(String name) {
super(message); super(name);
} }
@Override @Override
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getC99Language() {
return UPCLanguage.getDefault(); return UPCLanguage.getDefault();
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,15 +10,17 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99DOMPreprocessorInformationTest; import org.eclipse.cdt.core.lrparser.tests.LRDOMLocationMacroTests;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99DOMPreprocessorInformationTest extends C99DOMPreprocessorInformationTest { public class UPCDOMLocationMacroTests extends LRDOMLocationMacroTests {
@Override public UPCDOMLocationMacroTests() {
protected BaseExtensibleLanguage getC99Language() {
return UPCLanguage.getDefault();
} }
@Override
protected ILanguage getC99Language() {
return UPCLanguage.getDefault();
}
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,21 +10,21 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99DOMLocationTests; import org.eclipse.cdt.core.lrparser.tests.LRDOMLocationTests;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99DOMLocationTests extends C99DOMLocationTests { public class UPCDOMLocationTests extends LRDOMLocationTests {
public UPCC99DOMLocationTests() { public UPCDOMLocationTests() {
} }
public UPCC99DOMLocationTests(String name) { public UPCDOMLocationTests(String name) {
super(name); super(name);
} }
@Override @Override
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getC99Language() {
return UPCLanguage.getDefault(); return UPCLanguage.getDefault();
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,17 +10,15 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99DOMLocationMacroTests; import org.eclipse.cdt.core.lrparser.tests.LRDOMPreprocessorInformationTest;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99DOMLocationMacroTests extends C99DOMLocationMacroTests { public class UPCDOMPreprocessorInformationTest extends LRDOMPreprocessorInformationTest {
public UPCC99DOMLocationMacroTests() {
}
@Override @Override
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getC99Language() {
return UPCLanguage.getDefault(); return UPCLanguage.getDefault();
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,22 +10,18 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99SpecTests; import org.eclipse.cdt.core.lrparser.tests.LRDigraphTrigraphTests;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99SpecTests extends C99SpecTests {
public UPCC99SpecTests() { public class UPCDigraphTrigraphTests extends LRDigraphTrigraphTests {
}
public UPCC99SpecTests(String name) { public UPCDigraphTrigraphTests() { }
super(name); public UPCDigraphTrigraphTests(String name) { super(name); }
}
@Override @Override
protected BaseExtensibleLanguage getCLanguage() { protected ILanguage getCLanguage() {
return UPCLanguage.getDefault(); return UPCLanguage.getDefault();
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,14 +10,21 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99CompleteParser2Tests; import org.eclipse.cdt.core.lrparser.tests.LRGCCTests;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99CompleteParser2Tests extends C99CompleteParser2Tests { public class UPCGCCTests extends LRGCCTests {
public UPCGCCTests() {
}
public UPCGCCTests(String message) {
super(message);
}
@Override @Override
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getC99Language() {
return UPCLanguage.getDefault(); return UPCLanguage.getDefault();
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,14 +10,17 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99UtilTests; import org.eclipse.cdt.core.lrparser.tests.LRKnRTests;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99UtilTests extends C99UtilTests { public class UPCKnRTests extends LRKnRTests {
public UPCKnRTests() {
}
@Override @Override
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getC99Language() {
return UPCLanguage.getDefault(); return UPCLanguage.getDefault();
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -16,27 +16,25 @@ import junit.framework.TestSuite;
public class UPCParserTestSuite extends TestSuite { public class UPCParserTestSuite extends TestSuite {
public static Test suite() { public static Test suite() {
TestSuite suite = new TestSuite(); return new TestSuite() {{
addTestSuite(UPCCommentTests.class);
suite.addTestSuite(UPCC99CommentTests.class); addTestSuite(UPCCompletionBasicTest.class);
suite.addTestSuite(UPCC99CompletionBasicTest.class); addTestSuite(UPCCompletionParseTest.class);
suite.addTestSuite(UPCC99CompletionParseTest.class); addTestSuite(UPCDOMLocationInclusionTests.class);
suite.addTestSuite(UPCC99DOMLocationInclusionTests.class); addTestSuite(UPCDOMLocationMacroTests.class);
suite.addTestSuite(UPCC99DOMLocationMacroTests.class); addTestSuite(UPCDOMLocationTests.class);
suite.addTestSuite(UPCC99DOMLocationTests.class); addTestSuite(UPCDOMPreprocessorInformationTest.class);
suite.addTestSuite(UPCC99DOMPreprocessorInformationTest.class); addTestSuite(UPCKnRTests.class);
suite.addTestSuite(UPCC99KnRTests.class); addTestSuite(UPCSelectionParseTest.class);
suite.addTestSuite(UPCC99SelectionParseTest.class); addTestSuite(UPCCSpecTests.class);
suite.addTestSuite(UPCC99SpecTests.class); addTestSuite(UPCTests.class);
suite.addTestSuite(UPCC99Tests.class); addTestSuite(UPCLanguageExtensionTests.class);
suite.addTestSuite(UPCLanguageExtensionTests.class); addTestSuite(UPCDigraphTrigraphTests.class);
suite.addTestSuite(UPCC99DigraphTrigraphTests.class); addTestSuite(UPCGCCTests.class);
suite.addTestSuite(UPCC99GCCTests.class); addTestSuite(UPCUtilOldTests.class);
suite.addTestSuite(UPCC99UtilOldTests.class); addTestSuite(UPCUtilTests.class);
suite.addTestSuite(UPCC99UtilTests.class); addTestSuite(UPCCompleteParser2Tests.class);
suite.addTestSuite(UPCC99CompleteParser2Tests.class); addTestSuite(UPCTaskParserTest.class);
suite.addTestSuite(UPCC99TaskParserTest.class); }};
return suite;
} }
} }

View file

@ -0,0 +1,27 @@
/*******************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.LRSelectionParseTest;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCSelectionParseTest extends LRSelectionParseTest {
public UPCSelectionParseTest() { }
public UPCSelectionParseTest(String name) { super(name); }
@Override
protected ILanguage getC99Language() {
return UPCLanguage.getDefault();
}
}

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -10,14 +10,14 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests; package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99TaskParserTest; import org.eclipse.cdt.core.lrparser.tests.LRTaskParserTest;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCC99TaskParserTest extends C99TaskParserTest { public class UPCTaskParserTest extends LRTaskParserTest {
@Override @Override
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getC99Language() {
return UPCLanguage.getDefault(); return UPCLanguage.getDefault();
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. * Copyright (c) 2006, 2008 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
@ -12,25 +12,25 @@ package org.eclipse.cdt.core.parser.upc.tests;
import junit.framework.TestSuite; import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.lrparser.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.upc.UPCLanguage; import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.c99.C99Tests; import org.eclipse.cdt.core.lrparser.tests.LRTests;
import org.eclipse.cdt.core.model.ILanguage;
/** /**
* Run the C99 tests against the UPC parser * Run the C99 tests against the UPC parser
* *
*/ */
public class UPCC99Tests extends C99Tests { public class UPCTests extends LRTests {
public static TestSuite suite() { public static TestSuite suite() {
return suite(UPCC99Tests.class); return suite(UPCTests.class);
} }
public UPCC99Tests(String name) { public UPCTests(String name) {
super(name); super(name);
} }
@Override @Override
protected BaseExtensibleLanguage getC99Language() { protected ILanguage getC99Language() {
return UPCLanguage.getDefault(); return UPCLanguage.getDefault();
} }

View file

@ -0,0 +1,24 @@
/*******************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.LRUtilOldTests;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCUtilOldTests extends LRUtilOldTests {
@Override
protected ILanguage getC99Language() {
return UPCLanguage.getDefault();
}
}

View file

@ -0,0 +1,24 @@
/*******************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser.upc.tests;
import org.eclipse.cdt.core.dom.upc.UPCLanguage;
import org.eclipse.cdt.core.lrparser.tests.LRUtilTests;
import org.eclipse.cdt.core.model.ILanguage;
public class UPCUtilTests extends LRUtilTests {
@Override
protected ILanguage getC99Language() {
return UPCLanguage.getDefault();
}
}