From: wisberg Date: Thu, 19 May 2005 04:58:05 +0000 (+0000) Subject: run-all-junit-tests, new module build.xml, eclipse variables X-Git-Tag: PRE_ANDY~301 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c4d261c9d15939d85fbb2507483bc6999e1a8142;p=aspectj.git run-all-junit-tests, new module build.xml, eclipse variables --- diff --git a/build/readme-build-and-test-aspectj.html b/build/readme-build-and-test-aspectj.html index e65bfa125..048347c52 100644 --- a/build/readme-build-and-test-aspectj.html +++ b/build/readme-build-and-test-aspectj.html @@ -60,9 +60,9 @@ This is a minimal introduction to building and testing AspectJ. export CVS_ROOT=":pserver:anonymous@dev.eclipse.org:/home/technology" cvs co org.aspectj/modules If using Eclipse, check out the subdirectories of -org.aspectj/modules as Java projects. +org.aspectj/modules as Eclipse projects. Skip modules aspectj-attic and (unless running -compiler tests) tests and most testing* +JUnit or compiler tests) tests and most testing* modules. Do not skip testing-utils, which is used by other modules. @@ -116,14 +116,27 @@ under 1.4 or earlier VM's.

Standard builds

Building using Ant

-To do a build, use Ant to run build.xml -from this build directory. -To run Ant, use the project's ../lib/ant -scripts and libraries, not your own. -The default target builds the AspectJ distribution; +This build directory has a master +build.xml script, and the modules have +satellite build.xml which support building only that +module. +(To run Ant, use the project's ../lib/ant +scripts and libraries, not your own. Currently the build uses +a standard Ant release, but we might modify our version of the +Ant distribution.) +The default target for the master build.xml +creates an AspectJ distribution in + + ../aj-build/dist/aspectj-DEVELOPMENT.jar + ; see the build.xml for other targets. +The build.xml's in the other modules support the +targets compile and test for just +that module; if you do clean, all binaries for all +modules are cleaned. -Consider defining the following flag properties: +When using the master build.xml, +consider defining the following flag properties:

@@ -149,46 +162,66 @@ Consider defining the following flag properties:

-You can also use the build script in each module and the targets -"test" (default) or "compile". ("clean" removes all build products, -not just those for that module.) -

For example, to build everything into a release bundle, -with verbose logging +with verbose logging: +

   cd modules/build
   ../lib/ant/bin/ant 
 
+

To build only the asm module (and any modules it requires) using modules/build: +

   cd modules/build
   ../lib/ant/bin/ant -f build.xml any-module -Dmodule.name=asm
 
- -To run JUnit tests (output to ../aj-build/junit) -for the util module using util/build.xml: +

+To build and test the asm module from that module: +

-  cd modules/util
+  cd modules/asm
   ../lib/ant/bin/ant test
 
+

To build the test harness into ../aj-build/jars/testing-drivers-all.jar: +

   cd modules/build
   ../lib/ant/bin/ant -f build.xml build-testing-drivers
 

Building with Eclipse

-As mentioned above, the modules are Eclipse Java projects, so +

+As mentioned above, the modules are Eclipse projects, so once checked out, they should build as-is. That will enable you to run the compiler or test harness from within Eclipse (see below), but it will not build the AspectJ release as Ant does. +If you are making changes in Eclipse, you should set your default JRE +to the minimum supported by the AspectJ tools (currently JDK 1.3) +to avoid using later API's. +You'll need to set some variables in your Eclipse environment; +currently these are: +

+

Running the Ant build scripts from Eclipse

-When running Ant from Eclipse, be sure to replace the Eclipse Ant +When running Ant from older versions of Eclipse, +be sure to replace the Eclipse Ant libraries with ours. In the Ant configuration, remove all jars specified by Eclipse and add all the libraries in ../lib/ant/lib @@ -258,19 +291,30 @@ build products.

Testing AspectJ

+

Each module has a tree of JUnit tests in the testsrc directory. These parallel the src directories and contain roll-up suites for each package ({module}/testsrc/{packagePath}/{package}Tests.java) and for the module as a whole ({module}/testsrc/{module}ModuleTests.java). - -

The AspectJ project also has additional custom tests in the - tests module, +

+

+The AspectJ project also has additional custom tests in the +tests module, mainly the compiler tests run by the harness in ajcTests.xml. It is important to run these additional compiler tests (not covered by the JUnit suite) before and after any change to the compiler. +

+

+The module run-all-junit-tests +refers to all the other modules and the compiler tests adapted through +the ../tests/src. So the easiest way to +run the JUnit and compiler tests is to run the top-level suite + + RunTheseBeforeYouCommitTests. +

Running JUnit tests in Eclipse

JUnit tests may be run under eclipse by selecting any JUnit source file @@ -280,19 +324,27 @@ To run all the JUnit tests, use Ant to "build" This file uses the eclipse module bin directories as its classpath, so it will not work for someone not compiling with Eclipse. -

Running JUnit tests from the command-line without Eclipse

-The AspectJ project committers do not do this, but it should work fine. -The trick is to build the modules with their associated test code -(which happens by default) -and put the resulting jars on the classpath with the JUnit harness. - +

Running JUnit tests from the command-line without Eclipse or Ant

+

+As you might expect, you can run JUnit directly if you put the built +modules on the JUnit classpath. You can build in Eclipse or using +Ant. The master build script enables you to build an assembled jar +for a module which includes all the normal and testing classes and +any antecedants (except for those "skipped" - see +readme-build-module.html). +

Running JUnit tests from Ant without Eclipse

-This entails editing - ../tests/junitModules.xml -to use a classpath containing the built module jars as described above. -[todo: update junitModules.xml with non-eclipse variant] +

+As shown above, you can use the module build script: +

+
+cd modules/util
+../lib/ant/bin/ant test	
+

Using the test harness to run compiler tests

+

+ The build-testing-drivers target builds a single jar with the AspectJ binaries and a test harness as the main class. It reads test suite files like @@ -301,7 +353,7 @@ use the -help flag to see available options. For more information, see ../tests/readme-tests-module.html. -

+


Releases

Release builds

PropertyMeaning