Skip to main content
summaryrefslogtreecommitdiffstats
blob: 7793053068ed5fee1794c00c670ace98a682e4e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*******************************************************************************
 * Copyright (c) 2000, 2009 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.wst.jsdt.core.tests.compiler;

import java.util.ArrayList;
import java.util.Iterator;

import junit.framework.Test;
import junit.framework.TestSuite;

import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.tests.compiler.parser.SyntaxErrorTest;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.BasicAnalyseTests;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.BasicParserTests;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.BasicResolveTests;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.CharOperationTest;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.InferTypesTests;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.UtilTest;
import org.eclipse.wst.jsdt.core.tests.compiler.util.ExclusionTests;
import org.eclipse.wst.jsdt.core.tests.interpret.BasicInterpretTest;

/**
 * Run all compiler regression tests
 */
public class JSDTCompilerTests extends TestSuite {

static {
	JavaScriptCore.getPlugin().getPluginPreferences().setValue("semanticValidation", true);
}

public JSDTCompilerTests() {
	this("JavaScript Model Tests");
}

public JSDTCompilerTests(String testName) {
	super(testName);
}
public static Test suite() {

	ArrayList standardTests = new ArrayList();
	
	// regression tests
	standardTests.add(BasicParserTests.class);
	standardTests.add(InferTypesTests.class);
	standardTests.add(BasicResolveTests.class);
	standardTests.add(BasicAnalyseTests.class);
	standardTests.add(CharOperationTest.class);
	standardTests.add(UtilTest.class);
	
	// parser tests
	standardTests.add(SyntaxErrorTest.class);
	
	// interpret tests
	standardTests.add(BasicInterpretTest.class);
	
	
	
	
//	standardTests.addAll(JavadocTest.allTestClasses);

//	standardTests.add(BasicErrorTests.class);

	//	// add all javadoc tests
//	for (int i=0, l=JavadocTest.ALL_CLASSES.size(); i<l; i++) {
//		standardTests.add(JavadocTest.ALL_CLASSES.get(i));
//	}
//
	TestSuite all = new TestSuite("JSDT 'Compiler' Tests");
	all.addTest(ExclusionTests.suite());
	
	
//	int possibleComplianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
//	if ((possibleComplianceLevels & AbstractCompilerTest.F_1_3) != 0) {
//		ArrayList tests_1_3 = (ArrayList)standardTests.clone();
//		tests_1_3.add(Compliance_1_3.class);
//		tests_1_3.add(JavadocTest_1_3.class);
//		// Reset forgotten subsets tests
//		TestCase.TESTS_PREFIX = null;
//		TestCase.TESTS_NAMES = null;
//		TestCase.TESTS_NUMBERS= null;
//		TestCase.TESTS_RANGE = null;
//		TestCase.RUN_ONLY_ID = null;
//		all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_3, tests_1_3));
//	}
//	if ((possibleComplianceLevels & AbstractCompilerTest.F_1_4) != 0) {
//		ArrayList tests_1_4 = (ArrayList)standardTests.clone();
//		tests_1_4.add(AssertionTest.class);
//		tests_1_4.add(Compliance_1_4.class);
//		tests_1_4.add(ClassFileReaderTest_1_4.class);
//		tests_1_4.add(JavadocTest_1_4.class);
//		// Reset forgotten subsets tests
//		TestCase.TESTS_PREFIX = null;
//		TestCase.TESTS_NAMES = null;
//		TestCase.TESTS_NUMBERS= null;
//		TestCase.TESTS_RANGE = null;
//		TestCase.RUN_ONLY_ID = null;
//		all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_4, tests_1_4));
//	}
//	if ((possibleComplianceLevels & AbstractCompilerTest.F_1_5) != 0) {
//		ArrayList tests_1_5 = (ArrayList)standardTests.clone();
//		tests_1_5.addAll(RunComparableTests.ALL_CLASSES);
//		tests_1_5.add(AssertionTest.class);
//		tests_1_5.add(ClassFileReaderTest_1_5.class);
//		tests_1_5.add(GenericTypeSignatureTest.class);
//		tests_1_5.add(InternalHexFloatTest.class);
//		tests_1_5.add(JavadocTest_1_5.class);
//		tests_1_5.add(BatchCompilerTest.class);
//		tests_1_5.add(ExternalizeStringLiterals15Test.class);
//		// Reset forgotten subsets tests
//		TestCase.TESTS_PREFIX = null;
//		TestCase.TESTS_NAMES = null;
//		TestCase.TESTS_NUMBERS= null;
//		TestCase.TESTS_RANGE = null;
//		TestCase.RUN_ONLY_ID = null;
//		all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_5, tests_1_5));
//	}
//	if ((possibleComplianceLevels & AbstractCompilerTest.F_1_6) != 0) {
//		ArrayList tests_1_6 = (ArrayList)standardTests.clone();
//		tests_1_6.addAll(RunComparableTests.ALL_CLASSES);
//		tests_1_6.add(AssertionTest.class);
//		tests_1_6.add(ClassFileReaderTest_1_5.class);
//		tests_1_6.add(GenericTypeSignatureTest.class);
//		tests_1_6.add(InternalHexFloatTest.class);
//		tests_1_6.add(JavadocTest_1_5.class);
//		tests_1_6.add(BatchCompilerTest.class);
//		tests_1_6.add(ExternalizeStringLiterals15Test.class);
//		tests_1_6.add(StackMapAttributeTest.class);
//		// Reset forgotten subsets tests
//		TestCase.TESTS_PREFIX = null;
//		TestCase.TESTS_NAMES = null;
//		TestCase.TESTS_NUMBERS= null;
//		TestCase.TESTS_RANGE = null;
//		TestCase.RUN_ONLY_ID = null;
//		all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_6, tests_1_6));
//	}
	for (Iterator iter = standardTests.iterator(); iter.hasNext();) {
		Class test = (Class) iter.next();
		all.addTestSuite(test); 
	}
	return all;
} 
}

Back to the top