Example usage for org.eclipse.jdt.core.tests.util AbstractCompilerTest buildComplianceTestSuite

List of usage examples for org.eclipse.jdt.core.tests.util AbstractCompilerTest buildComplianceTestSuite

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.tests.util AbstractCompilerTest buildComplianceTestSuite.

Prototype

public static Test buildComplianceTestSuite(long complianceLevel, List testClasses) 

Source Link

Document

Build a test suite for a compliance and a list of test suites.

Usage

From source file:de.fau.cs.i2.jamp.testsuite.TestAll.java

License:Open Source License

public static Test suite() {

    // Common test suites
    ArrayList standardTests = new ArrayList();

    // Tests to run when compliance is greater than 1.3
    ArrayList since_1_4 = new ArrayList();

    // Tests to run when compliance is greater than 1.4
    ArrayList since_1_5 = new ArrayList();

    // Tests to run when compliance is greater than 1.5
    ArrayList since_1_6 = new ArrayList();
    since_1_5.add(JampBarrierTest.class);
    since_1_5.add(JampCustomLoopSliceTest.class);
    since_1_5.add(JampFirstPrivateTest.class);
    since_1_5.add(JampForSemanticTest.class);
    since_1_5.add(JampForTest.class);
    since_1_5.add(JampIfTest.class);
    since_1_5.add(JampLockTest.class);
    since_1_5.add(JampMasterTest.class);
    since_1_5.add(JampParallelSyntaxTest.class);
    since_1_5.add(JampPrivateTest.class);
    since_1_5.add(JampReductionTest.class);
    since_1_5.add(JampScheduleTest.class);
    since_1_5.add(JampSectionsSyntaxTest.class);
    since_1_5.add(JampManagedTest.class);
    since_1_5.add(JampSpecification25Test.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;// w ww  .j  a  v a  2s .co m
        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;
}