blob: 563ec650c9afe9409f1a365035bd7b3648cf72a2 [file] [log] [blame]
/*******************************************************************************
* 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.regression;
import java.util.ArrayList;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase;
import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
/**
* Run all compiler regression tests
*/
public class TestAll extends junit.framework.TestCase {
public TestAll(String testName) {
super(testName);
}
public static Test suite() {
// Common test suites
ArrayList standardTests = new ArrayList();
standardTests.add(AssignmentTest.class);
// standardTests.add(ClassFileComparatorTest.class);
// standardTests.add(CollisionCase.class);
// standardTests.add(ConstantTest.class);
standardTests.add(ScannerTest.class);
standardTests.add(UtilTest.class);
standardTests.add(InternalScannerTest.class);
standardTests.add(CharOperationTest.class);
standardTests.add(NullReferenceTest.class);
standardTests.add(CompilerInvocationTests.class);
// standardTests.add(LineNumberAttributeTest.class);
// add all javadoc tests
for (int i=0, l=JavadocTest.ALL_CLASSES.size(); i<l; i++) {
standardTests.add(JavadocTest.ALL_CLASSES.get(i));
}
// Tests to run when compliance is greater than 1.3
ArrayList since_1_4 = new ArrayList();
// since_1_4.add(AssertionTest.class);
// Tests to run when compliance is greater than 1.4
ArrayList since_1_5 = new ArrayList();
// since_1_5.add(BatchCompilerTest.class);
// since_1_5.add(Deprecated15Test.class);
// Tests to run when compliance is greater than 1.5
ArrayList since_1_6 = new ArrayList();
// since_1_6.add(StackMapAttributeTest.class);
// Build final test suite
TestSuite all = new TestSuite(TestAll.class.getName());
int possibleComplianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
if ((possibleComplianceLevels & AbstractCompilerTest.F_1_3) != 0) {
ArrayList tests_1_3 = (ArrayList)standardTests.clone();
// 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.addAll(since_1_4);
// 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(since_1_4);
tests_1_5.addAll(since_1_5);
// 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(since_1_4);
tests_1_6.addAll(since_1_5);
tests_1_6.addAll(since_1_6);
// 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));
}
if ((possibleComplianceLevels & AbstractCompilerTest.F_1_7) != 0) {
ArrayList tests_1_7 = (ArrayList)standardTests.clone();
tests_1_7.addAll(since_1_4);
tests_1_7.addAll(since_1_5);
tests_1_7.addAll(since_1_6);
// 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_7, tests_1_7));
}
return all;
}
}