Skip to main content
summaryrefslogtreecommitdiffstats
blob: a1d9cc5aef3c3d41722e16d2115717db3f697159 (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
<?xml version="1.0" encoding="UTF-8"?>

<project
    name="testsuite"
    default="run"
    basedir=".">
    
    <!-- 
         ===================================================== 
         There should be no need to change what's above.
         (if there is, let us know if the script can be improved.)
         ===================================================== 
    -->

    <!-- should be little need to change what's above  -->
    <property
        name="plugin-name"
        value="org.eclipse.wst.jsdt.core.tests.compiler" />
    <property
        name="classname"
        value="org.eclipse.wst.jsdt.core.tests.compiler.JSDTCompilerTests" />
    <property
        name="testType"
        value="core-test" />

    <!-- should be little need to change what's below -->

    <echo message="basedir: ${basedir}" />
    <echo message="eclipse-home: ${eclipse-home}" />
    <echo message="buildDirectory: ${buildDirectory}" />
    <echo message="plugin-name: ${plugin-name}" />
    <echo message="classname: ${classname}" />
    <echo message="testType ${testType}" />


    <property
        name="library-file"
        value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml" />
    <property
        name="workspace"
        value="${eclipse-home}/junitworkspaces/${plugin-name}" />
        
    <!-- This target holds all initialization code that needs to be done for -->
    <!-- all tests that are to be run. Initialization for individual tests -->
    <!-- should be done within the body of the suite target. -->
    <target name="init">
        <tstamp />
        <delete>
            <fileset
                dir="${eclipse-home}"
                includes="${plugin-name}.*xml" />
        </delete>
        
            <!-- 
         make the workspace directory, in case path doesn't exist yet
         but delete to make sure fresh contents, if it does exist
        -->
        <delete
            dir="${workspace}"
            quiet="true" />
        <mkdir
            dir="${workspace}" />
    </target>

    <!-- This target defines the tests that need to be run. -->
    <target name="suite">

        <ant
            target="${testType}"
            antfile="${library-file}"
            dir="${eclipse-home}">
            <property
                name="data-dir"
                value="${workspace}" />
            <property
                name="plugin-name"
                value="${plugin-name}" />
            <property
                name="classname"
                value="${classname}" />
            <property
                name="plugin-path"
                value="${eclipse-home}/plugins/${plugin-name}" />
        </ant>

        <copy
            failonerror="false"
            file="${workspace}/.metadata/.log"
            tofile="${buildDirectory}/${buildLabel}/testResults/consolelogs/${plugin-name}.consolelog.txt" />

    </target>

    <!-- This target holds code to cleanup the testing environment after -->
    <!-- after all of the tests have been run. You can use this target to -->
    <!-- delete temporary files that have been created. -->
    <target name="cleanup">
        <!-- usually no need to delete workspace until next run, and leaving it allows inspection -->
        <!-- <delete dir="${workspace}" quiet="true" /> -->
    </target>

    <!-- This target runs the test suite. Any actions that need to happen -->
    <!-- after all the tests have been run should go here. -->
    <target
        name="run"
        depends="init,suite,cleanup">
        <ant
            target="collect"
            antfile="${library-file}"
            dir="${eclipse-home}">
            <property
                name="includes"
                value="${plugin-name}.*xml" />
            <property
                name="output-file"
                value="${plugin-name}.xml" />
        </ant>
    </target>

</project>

Back to the top