/tests/Fest/example_plugin_test_build.xml
XML | 133 lines | 87 code | 20 blank | 26 comment | 0 complexity | 7a42ff6ad69f91192eca098763d167a0 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- <project name="svn_plugin_tests" default="test" basedir=".">
-
- <description>
- This is an example build file to run unit tests. This the build file for
- the unit tests for the SVN plugin. It has comments to describe all the
- necessary settings for getting unit tests to run.
-
- The SVNPlugin source directory looks like this:
- SVNPlugin
- |
- +- lib
- +- src
- +- test
- |
- -- build.xml (this file)
- +- test (holds the source code for the unit tests)
- +- test_reports (holds the output from JUnit)
-
- It is assumed that the plugin is already build and deployed to the standard
- ${install.dir} as is typical for plugins. If the plugin is actually built
- to some other directory, you'll need to change the directory for the
- 'plugin.jars' file list below.
-
- There is no assumption made about the location of the test framework itself.
- I have it installed in a directory at the same level as jEdit:
-
- /home/danson/src
- |
- +- jEdit
- +- jEditTestFramework
- +- plugins
- |
- -- build.properties
- +- build-support
- +- ...
- +- SVNPlugin
-
- The location of the test framework directory should be set in a property
- file. A good place to set this property is in the same build.properties
- used in general for plugin builds.
-
- -----
- Runs junit tests on the SVNPlugin. Assumes a normal build of the plugin
- has already happened and been deployed to the standard ${install.dir}. The
- test framework assumes the jEdit source is installed. It will do a clean
- build of jEdit and use the resulting build directory as the jEdit settings
- directory and the jEdit installation. Jars required by the plugin are
- specified in the plugin.jars filelist and will be copied into the jEdit
- build directory in a jars subdirectory.
- </description>
- <!-- general properties for plugins from the plugins directory, in
- partcular, need the install.dir set to know where to find the plugin
- jar files. -->
- <property file="../../build.properties"/>
-
- <!-- location of the test framework, this should be set in the build.properties
- file loaded above. -->
- <property name="test.framework.home" location="/home/danson/src/jEditTestFramework"/>
-
-
- <!-- html tests report -->
- <property name="junit-report.enabled" value="true"/>
- <!-- test source and classes -->
- <property name="project.test.src.dir" location="${basedir}"/>
- <property name="project.test.classes.dir" location="${basedir}/classes"/>
- <mkdir dir="${project.test.classes.dir}"/>
- <!-- marker property to indicate to the test framework that plugin jars
- need to be copied -->
- <property name="copyPluginJars" value=""/>
-
- <!-- full list of all jar files necessary to let jEdit load and run
- the plugin. All of these files will be copied to the jedit_settings/jar
- directory. -->
- <filelist id="plugin.jars" dir="${install.dir}">
- <file name="jna.jar"/>
- <file name="svnkit-cli.jar"/>
- <file name="svnkit.jar"/>
- <file name="trilead.jar"/>
- <file name="SVNPlugin.jar"/>
- <file name="JDiffPlugin.jar"/>
- <file name="ProjectViewer.jar"/>
- <file name="CommonControls.jar"/>
- <file name="kappalayout.jar"/>
- </filelist>
- <!-- include everything needed to let jEdit load the plugin and run the
- unit tests. This should include all the jars listed in the plugin.jars
- file list defined above. -->
- <path id="project.class.path">
- <pathelement path="project.test.classes.dir"/>
- <path>
- <filelist refid="plugin.jars"/>
- </path>
- </path>
- <!-- these are the actual test files to compile. This is included so it
- is easy to fine tune which tests are compiled and ran. -->
- <selector id="projectFiles">
- <filename name="**/*.java" />
- </selector>
-
- <!-- this selector holds all test cases. This is optional. -->
- <selector id="testcases.all">
- <or>
- <filename name="test/**/*Test.java"/>
- </or>
- </selector>
- <!-- this selector holds just one test. This is optional. -->
- <selector id="testcases.current">
- <filename name="test/OptionPaneTest.java"/>
- </selector>
- <!-- this selector controls which tests to run, set the refid to either
- testcases.current to run just one test or testcases.all to run all tests,
- or some other selector. This is NOT optional, if this selector is not
- defined, no tests will run. -->
- <selector id="junit.testcases">
- <or>
- <selector refid="testcases.current"/>
- </or>
- </selector>
-
- <!-- actually call the test framework to run the tests. inheritRefs must
- be true so that all of the things defined above are known to the test
- framework. -->
- <target name="test">
- <ant antfile="${test.framework.home}/build.xml" target="test" inheritRefs="true"/>
- </target>
- </project>