You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ajcHarnessTests.xml 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
  2. <!--
  3. To log unexpected results, run
  4. with -logPass -ajctestRequireKeywords=expect-fail
  5. or with -logFail -ajctestSkipKeywords=expect-fail
  6. You can also run using -traceTestsMin and scan for
  7. unexpected results:
  8. FAIL pass {title..} # expect pass, actual fail
  9. PASS fail {title..} # expect fail, actual pass
  10. Also pick out "incremental-test" keyword for incremental tests.
  11. -->
  12. <suite>
  13. <!-- disabled so skipping expect-fail causes all to pass
  14. (error emitted before test is skipped)
  15. <ajc-test dir="noSuchDir"
  16. title="fail no such directory - report as error (AjcTest specification)"
  17. keywords="expect-fail">
  18. <compile files="NoSuchFile.java"/>
  19. </ajc-test>
  20. -->
  21. <ajc-test dir="harness"
  22. title="pass 2 error">
  23. <compile files="ErrorTest.java">
  24. <message kind="error" line="5"/>
  25. <message kind="error" line="6"/>
  26. </compile>
  27. </ajc-test>
  28. <ajc-test dir="harness"
  29. title="pass 2 error, with filenames">
  30. <compile files="ErrorTest.java">
  31. <message kind="error" line="5" file="ErrorTest.java"/>
  32. <message kind="error" line="6" file="ErrorTest.java"/>
  33. </compile>
  34. </ajc-test>
  35. <ajc-test dir="harness"
  36. title="fail 2 error, with 1 bad filename"
  37. keywords="expect-fail">
  38. <compile files="ErrorTest.java">
  39. <message kind="error" line="5" file="ErrorTest.java"/>
  40. <message kind="error" line="6" file="ErrorTest2.java"/>
  41. </compile>
  42. </ajc-test>
  43. <ajc-test dir="harness"
  44. title="fail 2 error, with 2 bad filename"
  45. keywords="expect-fail">
  46. <compile files="ErrorTest.java">
  47. <message kind="error" line="5" file="ErrorTest3.java"/>
  48. <message kind="error" line="6" file="ErrorTest2.java"/>
  49. </compile>
  50. </ajc-test>
  51. <ajc-test dir="harness"
  52. title="fail 2 error, three expected"
  53. keywords="expect-fail">
  54. <compile files="ErrorTest.java">
  55. <message kind="error" line="5"/>
  56. <message kind="error" line="6"/>
  57. <message kind="error" line="8"/>
  58. </compile>
  59. </ajc-test>
  60. <ajc-test dir="harness"
  61. title="fail 2 error, one unexpected"
  62. keywords="expect-fail">
  63. <compile files="ErrorTest.java">
  64. <message kind="error" line="6"/>
  65. </compile>
  66. </ajc-test>
  67. <ajc-test dir="harness"
  68. title="fail 2 error, one with with error line wrong"
  69. keywords="expect-fail">
  70. <compile files="ErrorTest.java">
  71. <message kind="error" line="5"/>
  72. <message kind="error" line="7" text="Wrong line number"/>
  73. </compile>
  74. </ajc-test>
  75. <ajc-test dir="harness"
  76. title="fail 2 error, one with with kind wrong"
  77. keywords="expect-fail">
  78. <compile files="ErrorTest.java">
  79. <message kind="error" line="5"/>
  80. <message kind="warning" line="6"/>
  81. </compile>
  82. </ajc-test>
  83. <ajc-test dir="harness"
  84. title="pass 1 warning">
  85. <compile files="WarningTest.java">
  86. <message kind="warning" line="14"/>
  87. </compile>
  88. </ajc-test>
  89. <ajc-test dir="harness"
  90. title="fail 1 warning with kind wrong"
  91. keywords="expect-fail">
  92. <compile files="WarningTest.java">
  93. <message kind="error" line="14"/>
  94. </compile>
  95. </ajc-test>
  96. <ajc-test dir="harness"
  97. title="fail 1 warning with line wrong"
  98. keywords="expect-fail">
  99. <compile files="WarningTest.java">
  100. <message kind="warning" line="15"/>
  101. </compile>
  102. </ajc-test>
  103. <ajc-test dir="harness"
  104. title="fail checks and events, failed to specify 6 expected fails"
  105. keywords="expect-fail">
  106. <compile files="TestTesterFail.java"/>
  107. <run class="TestTesterFail"/>
  108. </ajc-test>
  109. <ajc-test dir="harness"
  110. title="fail one missing note"
  111. keywords="expect-fail">
  112. <compile files="TesterNotesFail.java"/>
  113. <run class="TesterNotesFail"/>
  114. </ajc-test>
  115. <ajc-test dir="harness"
  116. title="pass checks and events, all should pass">
  117. <compile files="TestTester.java"/>
  118. <run class="TestTester"/>
  119. </ajc-test>
  120. <ajc-test dir="harness"
  121. title="pass event files">
  122. <compile files="TestTesterFile.java"/>
  123. <run class="TestTesterFile"/>
  124. </ajc-test>
  125. <ajc-test dir="harness"
  126. title="pass compile and run, no tester required">
  127. <compile files="TestNoTester.java"/>
  128. <run class="TestNoTester" skipTester="true"/>
  129. </ajc-test>
  130. <ajc-test dir="harness/classpathTest"
  131. title="pass specify jars and directories on classpath"
  132. keywords="purejava">
  133. <compile classpath="classesDir,jars/required.jar"
  134. files="Main.java"/>
  135. <run class="Main"/>
  136. </ajc-test>
  137. <ajc-test dir="harness/classpathTest"
  138. title="pass specify aspectpath and classpath jars and directories">
  139. <compile classpath="classesDir,jars/required.jar"
  140. aspectpath="jars/requiredAspects.jar"
  141. files="AspectMain.java"/>
  142. <run class="AspectMain"/>
  143. </ajc-test>
  144. <ajc-test dir="harness" keywords="incremental-test"
  145. title="pass minimal purejava sourceroots test">
  146. <compile sourceroots="sourceroot"/>
  147. <run class="packageOne.Main"/>
  148. </ajc-test>
  149. <ajc-test dir="harness" keywords="incremental-test"
  150. title="pass test of dual sourceroots with aspects">
  151. <compile sourceroots="sourceroot,sourceroot2"/>
  152. <run class="packageOne.Main"/>
  153. </ajc-test>
  154. <ajc-test dir="harness" keywords="incremental-test"
  155. title="pass minimal incremental purejava sourceroots test"
  156. comment="inc-22 generates new event, expected after">
  157. <compile options="-incremental"
  158. sourceroots="sourceroot-inc"/>
  159. <run class="packageOne.Main"/>
  160. <inc-compile tag="22"/>
  161. <run class="packageOne.Main"
  162. options="new-event"/>
  163. </ajc-test>
  164. <ajc-test dir="harness" keywords="incremental-test"
  165. title="pass rebuild minimal incremental purejava sourceroots test"
  166. comment="inc-22 generates new event, expected after">
  167. <compile options="-incremental"
  168. sourceroots="sourceroot-inc"/>
  169. <run class="packageOne.Main"/>
  170. <inc-compile tag="22"/>
  171. <run class="packageOne.Main"
  172. options="new-event"/>
  173. <compile options="-incremental"
  174. reuseCompiler="true"
  175. sourceroots="sourceroot-inc"/>
  176. <run class="packageOne.Main"/>
  177. <inc-compile tag="22"/>
  178. <run class="packageOne.Main"
  179. options="new-event"/>
  180. </ajc-test>
  181. <ajc-test dir="harness" keywords="incremental-test"
  182. title="pass rebuild fresh-same minimal incremental purejava sourceroots test"
  183. comment="inc-22 generates new event, expected after">
  184. <compile options="-incremental"
  185. sourceroots="sourceroot-inc"/>
  186. <run class="packageOne.Main"/>
  187. <inc-compile tag="22"/>
  188. <run class="packageOne.Main"
  189. options="new-event"/>
  190. <inc-compile tag="same" fresh="true" />
  191. <run class="packageOne.Main"
  192. options="new-event"/> <!-- now expect new-event -->
  193. </ajc-test>
  194. <ajc-test dir="harness" keywords="incremental-test"
  195. title="pass rebuild fresh-updated minimal incremental purejava sourceroots test"
  196. comment="inc-22 generates new event, expected after">
  197. <compile options="-incremental"
  198. sourceroots="sourceroot-inc"/>
  199. <run class="packageOne.Main"/>
  200. <inc-compile tag="22" fresh="true" />
  201. <run class="packageOne.Main"
  202. options="new-event"/>
  203. </ajc-test>
  204. <ajc-test dir="incremental/stringliteral"
  205. keywords="incremental-test,fixme"
  206. title="pass incrementally change only string literal size">
  207. <compile staging="true" options="-incremental"
  208. sourceroots="src"/>
  209. <run class="packageOne.Main"
  210. options="in packageOne.Main.main(..),
  211. before main packageOne.Main"/>
  212. <inc-compile tag="20">
  213. <dir-changes updated="packageOne.Main"/>
  214. </inc-compile>
  215. <run class="packageOne.Main"
  216. options="in longer packageOne.Main.main(..),
  217. before main packageOne.Main"/>
  218. </ajc-test>
  219. <ajc-test dir="incremental/defaultPackage/src"
  220. title="pass test using prior classes">
  221. <compile files="lib/Lib.java"/>
  222. <run class="lib.Lib"/>
  223. <compile files="Main.java" includeClassesDir="true"/>
  224. <run class="Main"/>
  225. </ajc-test>
  226. <ajc-test dir="incremental/interPackage/src"
  227. title="pass test using prior classes (inter-package)">
  228. <compile files="lib/Lib.java"/>
  229. <run class="lib.Lib"/>
  230. <compile files="app/Main.java" includeClassesDir="true"/>
  231. <run class="app.Main"/>
  232. </ajc-test>
  233. <ajc-test dir="harness/systemExit"
  234. title="pass System exit 0">
  235. <compile files="SystemExit.java"/>
  236. <run class="SystemExit"/>
  237. </ajc-test>
  238. <ajc-test dir="harness/systemExit"
  239. keywords="expect-fail"
  240. title="fail System exit 1">
  241. <compile files="SystemExit.java"/>
  242. <run class="SystemExit" options="1"/>
  243. </ajc-test>
  244. <ajc-test dir="harness/systemExit"
  245. keywords="expect-fail"
  246. title="fail System exit -1">
  247. <compile files="SystemExit.java"/>
  248. <run class="SystemExit" options="-1"/>
  249. </ajc-test>
  250. <ajc-test dir="harness/inpath"
  251. title="pass test inpath option - valid">
  252. <compile files="input-path-classes" sourceroots="aspectsrc"/>
  253. <run class="Main"/>
  254. </ajc-test>
  255. <ajc-test dir="harness"
  256. comment="Expect two warnings when compiling -1.3"
  257. title="pass 2 compound warning -1.3">
  258. <compile files="CompoundMessage.java" options="-1.3">
  259. <message kind="warning" line="6">
  260. <source line="14" file="CompoundMessage.java"/>
  261. </message>
  262. <message kind="warning" line="6">
  263. <source line="12" file="CompoundMessage.java"/>
  264. </message>
  265. </compile>
  266. </ajc-test>
  267. <ajc-test dir="harness"
  268. comment="Expect no warnings when compiling -1.4"
  269. title="pass 2 compound warning -1.4">
  270. <compile files="CompoundMessage.java" options="-1.4"/>
  271. </ajc-test>
  272. <ajc-test dir="harness/xlintfile"
  273. title="pass default xlintfile">
  274. <compile files="TypeNotExposed.java">
  275. <message kind="warning" line="4" text="xpose"/>
  276. </compile>
  277. </ajc-test>
  278. <ajc-test dir="harness/xlintfile"
  279. title="pass xlintfile promotes to error">
  280. <compile files="TypeNotExposed.java"
  281. xlintfile="tneError.properties">
  282. <message kind="error" line="4" text="xpose"/>
  283. </compile>
  284. </ajc-test>
  285. <ajc-test dir="harness/xlintfile"
  286. title="pass xlintfile demotes to ignore">
  287. <compile files="TypeNotExposed.java"
  288. xlintfile="tneIgnore.properties"/>
  289. </ajc-test>
  290. <ajc-test dir="harness"
  291. keywords="expect-fail"
  292. title="fail 2 error, but expecting more details">
  293. <compile files="ErrorTest.java">
  294. <message kind="error" line="5" details="expecting more"/>
  295. <message kind="error" line="6" details="details"/>
  296. </compile>
  297. </ajc-test>
  298. <ajc-test dir="harness"
  299. title="pass dir-changes: nested and static class">
  300. <compile files="DirChangesTest.java">
  301. <dir-changes added="DirChangesTest,DirChangesTest$Inner,DirChangesTest$Nested"/>
  302. </compile>
  303. </ajc-test>
  304. <ajc-test dir="harness"
  305. keywords="expect-fail"
  306. title="fail dir-changes: at end, expected file not added .. $Missing..">
  307. <compile files="DirChangesTest.java">
  308. <dir-changes added="DirChangesTest$Missing"/>
  309. </compile>
  310. </ajc-test>
  311. <ajc-test dir="harness/dirchanges-inc"
  312. title="pass dir-changes incremental">
  313. <compile
  314. options="-incremental"
  315. staging="true"
  316. sourceroots="src">
  317. <dir-changes added="Unchanged,Changed"/>
  318. </compile>
  319. <run class="Changed" options="first"/>
  320. <inc-compile tag="20">
  321. <dir-changes removed="Removed" updated="Changed"/>
  322. </inc-compile>
  323. <run class="Changed" options="second"/>
  324. </ajc-test>
  325. <ajc-test dir="harness/dirchanges-inc"
  326. keywords="expect-fail"
  327. title="fail dir-changes incremental: at start, did not expect added file to exist: {added==}Changed.class">
  328. <compile
  329. options="-incremental"
  330. staging="true"
  331. sourceroots="src"/>
  332. <inc-compile tag="20">
  333. <dir-changes added="Changed"/>
  334. </inc-compile>
  335. </ajc-test>
  336. <ajc-test dir="harness/dirchanges-inc"
  337. keywords="expect-fail"
  338. title="fail dir-changes incremental: at start, expected removed file to exist: {removed==}Missing.class">
  339. <compile
  340. options="-incremental"
  341. staging="true"
  342. sourceroots="src">
  343. <dir-changes removed="Missing"/>
  344. </compile>
  345. </ajc-test>
  346. <ajc-test dir="harness/dirchanges-inc"
  347. keywords="expect-fail"
  348. title="fail dir-changes incremental: at start, expected updated file to exist: {updated==}Missing.class">
  349. <compile
  350. options="-incremental"
  351. staging="true"
  352. sourceroots="src">
  353. <dir-changes updated="Missing"/>
  354. </compile>
  355. </ajc-test>
  356. <ajc-test dir="harness/dirchanges-inc"
  357. keywords="expect-fail"
  358. title="fail dir-changes incremental: at end, expected added file to exist: {added==}Missing.class">
  359. <compile
  360. options="-incremental"
  361. staging="true"
  362. sourceroots="src">
  363. <dir-changes added="Missing"/>
  364. </compile>
  365. </ajc-test>
  366. <ajc-test dir="harness/dirchanges-inc"
  367. keywords="expect-fail"
  368. title="fail dir-changes incremental: at end, did not expect removed file to exist: {removed==}Changed.class">
  369. <compile
  370. options="-incremental"
  371. staging="true"
  372. sourceroots="src"/>
  373. <inc-compile tag="20">
  374. <dir-changes removed="Changed"/>
  375. </inc-compile>
  376. </ajc-test>
  377. <ajc-test dir="harness/dirchanges-inc"
  378. keywords="expect-fail"
  379. title="fail dir-changes incremental: at end, expected updated file to exist: {updated==}Removed.class">
  380. <compile
  381. options="-incremental"
  382. staging="true"
  383. sourceroots="src"/>
  384. <inc-compile tag="20">
  385. <dir-changes updated="Removed"/>
  386. </inc-compile>
  387. </ajc-test>
  388. </suite>