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.

readme-incTest.html 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <html>
  2. <title>Incremental test of AjcTask Ant task</title>
  3. <body>
  4. <h2>Incremental test of AjcTask Ant task</h2>
  5. This directory contains files for manually testing
  6. two AjcTask Ant task facilities:
  7. <ul>
  8. <li>incremental builds, using tag file or input stream
  9. (supported directly by the compiler)
  10. </li>
  11. <li>resource copying using input jars or source roots
  12. and output jar or directory
  13. (only supported in the Ant task).
  14. </li>
  15. </ul>
  16. <a href="incTest.xml">incTest.xml</a>
  17. is an Ant script which builds two input jars
  18. and runs an incremental test using a tag file.
  19. <p>
  20. The results must be verified by hand manually at present;
  21. This test should be updated to run using JUnit like
  22. <a href="../../testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java">
  23. AjcTaskTest.java</a>.
  24. <h3>Sample procedure</h3>
  25. This shows how to set up the test and check whether
  26. the incremental tag file and resource-copying features work.
  27. Throughout, <code>{ant}</code> is assumed to be
  28. <code>../../../lib/ant/bin/ant</code> and the directory
  29. is assumed to be this directory, with the Ant build script
  30. <a href="incTest.xml">incTest.xml</a>.
  31. The script uses the eclipse classpath rather than aspectjtools.jar,
  32. so that updates to the sources can be tested without
  33. rebuilding the distribution.
  34. <ol>
  35. <li>Set up the output jars
  36. <pre> {ant} -f incTest.xml setup</pre>
  37. This should produce <code>one.jar</code> and <code>two.jar</code>
  38. in the directory <a href="injars">injars/</a>.
  39. <p>
  40. </li>
  41. <li>Start the run with the default settings
  42. (use <code>output/tagfile.txt</code> as the tag file
  43. and to include the non-.class contents of the input jars
  44. in the output jar):
  45. <pre> {ant} -f incTest.xml test</pre>
  46. The task will do an initial compilation and silently wait.
  47. <p>
  48. </li>
  49. <li>In another shell, test the classes in the generated output jar:
  50. <pre> export CLASSPATH="../../../lib/test/aspectjrt.jar;output/outjar.jar"
  51. java packageOne.Main</pre>
  52. Inspect the files in the <a href="src">src/</a> and
  53. <a href="injarSrc">injarSrc/</a> directories to find other
  54. main classes and to determine the expected result of the aspect.
  55. As of this writing,
  56. the aspect <a href="src/TraceMains.java">src/TraceMains.java</a>
  57. should emit messages before and after
  58. the execution of any static main(String[]) method.
  59. <p>
  60. </li>
  61. <li>Check that the output jar got the injar and src files:
  62. <pre> jar tf output/outjar.jar</pre>
  63. <p>
  64. The output should list the
  65. non-.class files in <a href="injarSrc">injarSrc/</a>
  66. and the non CVS/.java files in the <a href="src">src/</a> dir.
  67. <p>
  68. </li>
  69. <li>To test incremental compiles,
  70. edit the aspect <a href="src/TraceMains.java">src/TraceMains.java</a>
  71. to modify the behavior. You can also modify the input jars or
  72. source files.
  73. Then touch or edit <a href="output/tagfile.txt">output/tagfile.txt</a>
  74. to provoke recompilation.
  75. <p>
  76. </li>
  77. <li>Test the generated output jar again
  78. to see if the changes are reflected in the runtime behavior
  79. and if files are being copied correctly.
  80. <p>
  81. </li>
  82. <li>Repeat this process until satisfied. Delete the tagfile to quit:
  83. <pre> rm output/tagfile.txt</pre>
  84. <p>
  85. </li>
  86. <li>Also run the targets <code>test-all</code>
  87. and <code>test-both</code>.
  88. <p>
  89. </li>
  90. </ol>
  91. Many combination of the option variants are possible.
  92. Test the relevant ones by editing the
  93. <a href="incTest.xml">incTest.xml</a> script
  94. and redoing the test.
  95. <p>
  96. <table cellpadding="1" border="1">
  97. <tr><th>Option</th><th>Variants</th></tr>
  98. <tr><td>incremental</td><td>none, -incremental, -tagFile</td></tr>
  99. <tr><td>output</td><td>none (default "."), destDir, output jar</td></tr>
  100. <tr><td>injars</td><td>none, one, two</td></tr>
  101. <tr><td>injar copying</td><td>off (default), on</td></tr>
  102. <tr><td>source resource copying</td><td>off (default), various patterns</td></tr>
  103. </table>
  104. <p>
  105. <h3>Clean-up</h3>
  106. Take care to preserve CVS state after running this test.
  107. It calls on you to edit checked-in files and generates files
  108. to local repository directories. The best thing is to delete
  109. the <code>output</code> and <code>injars</code> directories
  110. (using the <code>clean</code> task)
  111. and revert to repository forms for sources (unless fixing them).
  112. <h3>Upgrade</h3>
  113. This needs to be upgraded to run automatically.
  114. There is a file/tree-comparison utility to revive from the
  115. aspectj-attic which can be used to compare expected and actual
  116. results of the jar files. Setting up the tasks to run incrementally
  117. might be done using the parallel task, but...
  118. <p>
  119. In any case, the nested options tested here should move
  120. to non-incremental JUnit tests.
  121. <p>
  122. <hr>
  123. </body>
  124. </html>