aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ajcHarnessTests.xml
blob: d4b370080ce0b879c82cb9c27e7cb696b5ae2ac0 (plain)
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">

<!--
    To log unexpected results, run
        with -logPass -ajctestRequireKeywords=expect-fail
     or with -logFail -ajctestSkipKeywords=expect-fail

     Also pick out "incremental" keyword for incremental tests.
-->
<suite>

    <ajc-test dir="noSuchDir"
      title="no such directory - report as error (AjcTest specification)"
     keywords="expect-fail">
        <compile files="NoSuchFile.java"/>
    </ajc-test>

    <ajc-test dir="harness"
      title="2 error">
        <compile files="ErrorTest.java">
            <message kind="error" line="5"/>
            <message kind="error" line="6"/>
        </compile>
    </ajc-test>

    <ajc-test dir="harness"
      title="2 error, with filenames">
        <compile files="ErrorTest.java">
            <message kind="error" line="5" file="ErrorTest.java"/>
            <message kind="error" line="6" file="ErrorTest.java"/>
        </compile>
    </ajc-test>

    <ajc-test dir="harness"
      title="2 error, three expected"
     keywords="expect-fail">
        <compile files="ErrorTest.java">
            <message kind="error" line="5"/>
            <message kind="error" line="6"/>
            <message kind="error" line="8"/>
        </compile>
    </ajc-test>

    <ajc-test dir="harness"
      title="2 error, one unexpected"
     keywords="expect-fail">
        <compile files="ErrorTest.java">
            <message kind="error" line="6"/>
        </compile>
    </ajc-test>

    <ajc-test dir="harness"
      title="2 error, one with with error line wrong"
     keywords="expect-fail">
        <compile files="ErrorTest.java">
            <message kind="error" line="5"/>
            <message kind="error" line="7" text="Wrong line number"/>
        </compile>
    </ajc-test>

    <ajc-test dir="harness"
      title="2 error, one with with kind wrong"
     keywords="expect-fail">
        <compile files="ErrorTest.java">
            <message kind="error" line="5"/>
            <message kind="warning" line="6"/>
        </compile>
    </ajc-test>
    
    <ajc-test dir="harness"
      title="1 warning">
        <compile files="WarningTest.java">
            <message kind="warning" line="14"/>
        </compile>
    </ajc-test>
    
    <ajc-test dir="harness"
      title="1 warning with kind wrong"
     keywords="expect-fail">
        <compile files="WarningTest.java">
            <message kind="error" line="14"/>
        </compile>
    </ajc-test>

    <ajc-test dir="harness"
      title="1 warning with line wrong"
     keywords="expect-fail">
        <compile files="WarningTest.java">
            <message kind="warning" line="15"/>
        </compile>
    </ajc-test>

    <ajc-test dir="harness" title="checks and events, failed to specify 6 expected fails"
     keywords="expect-fail">
        <compile files="TestTesterFail.java"/>
        <run class="TestTesterFail"/>
    </ajc-test>

    <ajc-test dir="harness" title="one missing note"
     keywords="expect-fail">
        <compile files="TesterNotesFail.java"/>
        <run class="TesterNotesFail"/>
    </ajc-test>

    <ajc-test dir="harness" title="checks and events, all should pass">
        <compile files="TestTester.java"/>
        <run class="TestTester"/>
    </ajc-test>

    <ajc-test dir="harness" title="event files">
        <compile files="TestTesterFile.java"/>
        <run class="TestTesterFile"/>
    </ajc-test>

    <ajc-test dir="harness" title="compile and run, no tester required">
        <compile files="TestNoTester.java"/>
        <run class="TestNoTester" skipTester="true"/>
    </ajc-test>

    <ajc-test dir="harness/classpathTest"
      title="specify jars and directories on classpath"
      keywords="purejava">
        <compile classpath="classesDir,jars/required.jar" 
                 files="Main.java"/>
        <run class="Main"/>
    </ajc-test>

    <ajc-test dir="harness/classpathTest"
      title="specify aspectpath and classpath jars and directories">
        <compile classpath="classesDir,jars/required.jar"
                 aspectpath="jars/requiredAspects.jar"
                 files="AspectMain.java"/>
        <run class="AspectMain"/>
    </ajc-test>

    <ajc-test dir="harness"  keywords="incremental"
    		title="minimal purejava sourceroots test">
        <compile sourceroots="sourceroot"/>
		<run class="packageOne.Main"/>
    </ajc-test>

    <ajc-test dir="harness"  keywords="incremental"
    		title="test of dual sourceroots with aspects">
        <compile sourceroots="sourceroot,sourceroot2"/>
		<run class="packageOne.Main"/>
    </ajc-test>

    <ajc-test dir="harness"  keywords="incremental"
    		title="minimal incremental purejava sourceroots test"
    	comment="inc-22 generates new event, expected after">
        <compile options="-incremental" 
        	sourceroots="sourceroot-inc"/>
		<run class="packageOne.Main"/>
        <inc-compile tag="22"/> 
		<run class="packageOne.Main" 
		   options="new-event"/>
    </ajc-test>

    <ajc-test dir="harness"  keywords="incremental"
    		title="rebuild minimal incremental purejava sourceroots test"
    	comment="inc-22 generates new event, expected after">
        <compile options="-incremental" 
        	sourceroots="sourceroot-inc"/>
		<run class="packageOne.Main"/>
        <inc-compile tag="22"/>
		<run class="packageOne.Main" 
		   options="new-event"/> 

        <compile options="-incremental" 
            reuseCompiler="true"
        	sourceroots="sourceroot-inc"/>
		<run class="packageOne.Main"/>
        <inc-compile tag="22"/>
		<run class="packageOne.Main" 
		   options="new-event"/>
    </ajc-test>
    
    <ajc-test dir="harness"  keywords="incremental"
    		title="rebuild fresh-same minimal incremental purejava sourceroots test"
    	comment="inc-22 generates new event, expected after">
        <compile options="-incremental" 
        	sourceroots="sourceroot-inc"/>
		<run class="packageOne.Main"/>
        <inc-compile tag="22"/> 
		<run class="packageOne.Main" 
		   options="new-event"/> 

        <inc-compile tag="same" fresh="true" />
		<run class="packageOne.Main" 
		   options="new-event"/> <!-- now expect new-event -->
    </ajc-test>
    
    <ajc-test dir="harness"  keywords="incremental"
    		title="rebuild fresh-updated minimal incremental purejava sourceroots test"
    	comment="inc-22 generates new event, expected after">
        <compile options="-incremental" 
        	sourceroots="sourceroot-inc"/>
		<run class="packageOne.Main"/>

        <inc-compile tag="22" fresh="true" /> 
		<run class="packageOne.Main" 
		   options="new-event"/> 
    </ajc-test>

    <ajc-test dir="incremental/stringliteral"  
    		title="incrementally change only string literal size">
        <compile staging="true" options="-incremental" 
        	sourceroots="src"/>
		<run class="packageOne.Main"
			options="in packageOne.Main.main(..),
					 before main packageOne.Main"/>
        <inc-compile tag="20">
        	<dir-changes updated="packageOne.Main"/>
        </inc-compile>
		<run class="packageOne.Main"
			options="in longer packageOne.Main.main(..),
					 before main packageOne.Main"/>
    </ajc-test>
    
</suite>