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-tests-module.html 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <html>
  2. <title>AspectJ tests</title>
  3. <body>
  4. <h1>AspectJ tests</h1>
  5. <h3>Testing and Tests</h3>
  6. Testing on the AspectJ project is fairly straightforward.
  7. For compiler issues/bugs, we write harness tests.
  8. For API issues/bugs, we write JUnit tests.
  9. We also have other testware for system testing.
  10. <p>
  11. This module contains test data and scripts, while the testing-drivers
  12. and testing modules contain the harness.
  13. Tests differ in the kind of harness they use and their target.
  14. (Many tests are unused and date back to earlier times in the project.)
  15. <p>
  16. <table border="1" cellpadding="1">
  17. <tr><th align="left"><u>Test</u> Description</th>
  18. <th align="left">Driver</th>
  19. <th align="left">Sources</th>
  20. </tr>
  21. <tr><td><a href="#harness">Harness</a> tests
  22. compile and run test sources.
  23. </td>
  24. <td>Harness in testing-drivers module</td>
  25. <td><a href="ajcTests.xml">ajcTests.xml</a>,
  26. and <a href="ajcTests.xml">ajcTests10.xml</a>,
  27. referring to tests in
  28. <a href="new">new/</a>,
  29. <a href="base">base/</a>,
  30. <a href="errors">errors/</a>,
  31. <a href="design">design/</a>,
  32. <a href="pureJava">pureJava/</a>,
  33. etc.
  34. </td>
  35. </tr>
  36. <tr><td><a href="#product">Product</a> tests use a variety of
  37. Ant and Bash scripts to drive the product distributions.
  38. <td>bash,
  39. <a href="https://jakarta.apache.org/Ant">Ant</a>
  40. </td>
  41. <td><a href="product">product/..</a></td>
  42. </tr>
  43. <tr><td><a href="#ajctest">AjcTest</a> is a large taskdef which
  44. compiles and runs large Java systems.
  45. </td>
  46. <td>AjcTest
  47. <a href="https://jakarta.apache.org/Ant">Ant</a>
  48. Task in testing module </td>
  49. <td><a href="other-systems/">other-systems/..</a>,
  50. <a href="XXX">aspectj-external-lib.jar?/other-systems/</a></td>
  51. </tr>
  52. <tr><td><a href="#jacks">Jacks</a> is the Jikes compiler test suite,
  53. run for us using a bash script.
  54. <td>bash</td>
  55. <td>See the
  56. <a href="https://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html">
  57. Jacks project page</a>
  58. </td>
  59. </tr>
  60. <tr><td><a href="#junit">JUnit</a> tests normally are run directly
  61. before checking in,
  62. but there is an Ant script to run and report on them all.
  63. </td>
  64. <td><a href="junit.org">JUnit</a></td>
  65. <td>Every module has a testsrc/ directory with JUnit tests.</td>
  66. </tr>
  67. </table>
  68. <h3><a name="harness"></a>Harness</h3>
  69. <h4><a name="harness-tests"></a>Harness tests</h4>
  70. These are compiler test cases, the preferred form for
  71. any compiler tests. The XML files are test definitions,
  72. and the subdirectories contain the test sources (many of which
  73. are unused at present). The test definitions are
  74. segregated for convenience as follows:
  75. <ul>
  76. <li><a href="ajcTests.xml">ajcTests.xml</a>: main test suite.
  77. After a release, these tests should always run and pass.
  78. </li>
  79. <li><a href="ajcTests10.xml">ajcTests10.xml</a>:
  80. Tests for the 1.0 compiler. In some cases, error tests
  81. differ between the 1.0 and 1.1 compiler only in the
  82. errors expected to be generated.
  83. </li>
  84. <li><a href="ajcTestsBroken.xml">ajcTestsBroken.xml</a>:
  85. These tests fail, and the tests are broken.
  86. The tests should be fixed and rolled into ajcTests.xml
  87. </li>
  88. <li><a href="ajcTestsFailing.xml">ajcTestsFailing.xml</a>:
  89. These tests fail, and the compiler is broken.
  90. When fixed, these tests should be rolled into
  91. <a href="ajcTests.xml">ajcTests.xml</a>.
  92. </li>
  93. <li><a href="ajcTestsAttic.xml">ajcTestsAttic.xml</a>:
  94. These are broken or failing tests not slated to be fixed.
  95. </li>
  96. <li><a href="ajcHarnessTests.xml">ajcHarnessTests.xml</a>:
  97. These are tests to exercise the test harness itself.
  98. </li>
  99. </ul>
  100. The tests specify most anything one could want to do with
  101. compile/run variants. The best summary of the test specification
  102. format is the <a href="ajcTestSuite.dtd">ajcTestSuite.dtd</a>.
  103. <p>
  104. To write a new test, evolve an existing example. See the dtd and/or
  105. the javadoc for the testing harness implementation in the
  106. <code>testing</code> module for more details.
  107. <p>To write a test case for a bug, see
  108. <a href="readme-writing-compiler-tests.html">
  109. readme-writing-compiler-tests.html</a>.
  110. Many bugs that first present in an IDE or the Ant taskdef
  111. are compiler bugs that can be written in this form.
  112. We <em>much</em> prefer this automated form over
  113. manual steps specified in a bug report.
  114. <h4><a name="harness-runs"></a>Running the harness</h4>
  115. <p>
  116. To run the harness, use <code>org.aspectj.testing.drivers.Harness</code>,
  117. in the <code>testing-drivers</code> module. Since that is the main class
  118. for the <code>testing-drivers</code> module, you can build and
  119. run the harness as follows:
  120. <pre>
  121. cd build/
  122. ../lib/ant/bin/ant build-testing-drivers
  123. cd ../tests
  124. java -jar ../aj-build/jars/testing-drivers-all.jar ajcTests.xml
  125. </pre>
  126. The harness enable you to
  127. <ul>
  128. <li>control output, hiding streams and logging messages</li>
  129. <li>select tests using keywords, bug ID's, or titles</li>
  130. <li>pass compiler arguments on the harness command line</li>
  131. <li>use different compiler wrappers - the command-line compiler,
  132. the AJDE IDE support (mostly sans GUI), or
  133. the Ant taskdef support.</li>
  134. <li>fork java run steps</li>
  135. </ul>
  136. For a listing of harness options, use <code>-help</code>.
  137. For a fuller description of harness options and components, see
  138. <a href="../testing-drivers/src/org/aspectj/testing/drivers/package.html">
  139. the package documentation for the harness</a>.
  140. <h3><a name="product"></a>Product</h3>
  141. Product tests target a built distribution or do compiler (argument)
  142. testing not supported by the harness.
  143. Many have been superceded by ant tests.
  144. To build aspectj with itself, see
  145. <a href="product/build-aspectj/build.xml">
  146. product/build-aspectj/build.xml</a>.
  147. <h3><a name="ajctest"></a>AjcTest</h3>
  148. <a href="ajctest.xml">ajctest.xml</a>
  149. is an Ant script that compiles and runs large systems.
  150. The scripts tell the AjcTest task from the testing module to drive
  151. the sources in other-systems through compile/doc/run cycles.
  152. To set up the tests, the script combines the aspects checked in to
  153. other-systems/ with the Java source files from various open-source
  154. projects, contained in aspectj-external-lib.zip.
  155. <!-- XXX install and correct -->
  156. <h3><a name="jacks"></a>Jacks</h3>
  157. Jacks is the Jikes compiler test suite available at the
  158. <a href="https://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html">
  159. Jacks project page</a>.
  160. We have a bash script to run it using ajc and javac and compare
  161. the results.
  162. <h3><a name="junit"></a>JUnit</h3>
  163. The JUnit tests should be self-documenting.
  164. For more information on running them, see
  165. <a href="../build/readme-build-and-test-aspectj.html">
  166. ../build/readme-build-and-test-aspectj.html</a>.
  167. </body>
  168. </html>