PageRenderTime 49ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/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
  1. <project name="svn_plugin_tests" default="test" basedir=".">
  2. <description>
  3. This is an example build file to run unit tests. This the build file for
  4. the unit tests for the SVN plugin. It has comments to describe all the
  5. necessary settings for getting unit tests to run.
  6. The SVNPlugin source directory looks like this:
  7. SVNPlugin
  8. |
  9. +- lib
  10. +- src
  11. +- test
  12. |
  13. -- build.xml (this file)
  14. +- test (holds the source code for the unit tests)
  15. +- test_reports (holds the output from JUnit)
  16. It is assumed that the plugin is already build and deployed to the standard
  17. ${install.dir} as is typical for plugins. If the plugin is actually built
  18. to some other directory, you'll need to change the directory for the
  19. 'plugin.jars' file list below.
  20. There is no assumption made about the location of the test framework itself.
  21. I have it installed in a directory at the same level as jEdit:
  22. /home/danson/src
  23. |
  24. +- jEdit
  25. +- jEditTestFramework
  26. +- plugins
  27. |
  28. -- build.properties
  29. +- build-support
  30. +- ...
  31. +- SVNPlugin
  32. The location of the test framework directory should be set in a property
  33. file. A good place to set this property is in the same build.properties
  34. used in general for plugin builds.
  35. -----
  36. Runs junit tests on the SVNPlugin. Assumes a normal build of the plugin
  37. has already happened and been deployed to the standard ${install.dir}. The
  38. test framework assumes the jEdit source is installed. It will do a clean
  39. build of jEdit and use the resulting build directory as the jEdit settings
  40. directory and the jEdit installation. Jars required by the plugin are
  41. specified in the plugin.jars filelist and will be copied into the jEdit
  42. build directory in a jars subdirectory.
  43. </description>
  44. <!-- general properties for plugins from the plugins directory, in
  45. partcular, need the install.dir set to know where to find the plugin
  46. jar files. -->
  47. <property file="../../build.properties"/>
  48. <!-- location of the test framework, this should be set in the build.properties
  49. file loaded above. -->
  50. <property name="test.framework.home" location="/home/danson/src/jEditTestFramework"/>
  51. <!-- html tests report -->
  52. <property name="junit-report.enabled" value="true"/>
  53. <!-- test source and classes -->
  54. <property name="project.test.src.dir" location="${basedir}"/>
  55. <property name="project.test.classes.dir" location="${basedir}/classes"/>
  56. <mkdir dir="${project.test.classes.dir}"/>
  57. <!-- marker property to indicate to the test framework that plugin jars
  58. need to be copied -->
  59. <property name="copyPluginJars" value=""/>
  60. <!-- full list of all jar files necessary to let jEdit load and run
  61. the plugin. All of these files will be copied to the jedit_settings/jar
  62. directory. -->
  63. <filelist id="plugin.jars" dir="${install.dir}">
  64. <file name="jna.jar"/>
  65. <file name="svnkit-cli.jar"/>
  66. <file name="svnkit.jar"/>
  67. <file name="trilead.jar"/>
  68. <file name="SVNPlugin.jar"/>
  69. <file name="JDiffPlugin.jar"/>
  70. <file name="ProjectViewer.jar"/>
  71. <file name="CommonControls.jar"/>
  72. <file name="kappalayout.jar"/>
  73. </filelist>
  74. <!-- include everything needed to let jEdit load the plugin and run the
  75. unit tests. This should include all the jars listed in the plugin.jars
  76. file list defined above. -->
  77. <path id="project.class.path">
  78. <pathelement path="project.test.classes.dir"/>
  79. <path>
  80. <filelist refid="plugin.jars"/>
  81. </path>
  82. </path>
  83. <!-- these are the actual test files to compile. This is included so it
  84. is easy to fine tune which tests are compiled and ran. -->
  85. <selector id="projectFiles">
  86. <filename name="**/*.java" />
  87. </selector>
  88. <!-- this selector holds all test cases. This is optional. -->
  89. <selector id="testcases.all">
  90. <or>
  91. <filename name="test/**/*Test.java"/>
  92. </or>
  93. </selector>
  94. <!-- this selector holds just one test. This is optional. -->
  95. <selector id="testcases.current">
  96. <filename name="test/OptionPaneTest.java"/>
  97. </selector>
  98. <!-- this selector controls which tests to run, set the refid to either
  99. testcases.current to run just one test or testcases.all to run all tests,
  100. or some other selector. This is NOT optional, if this selector is not
  101. defined, no tests will run. -->
  102. <selector id="junit.testcases">
  103. <or>
  104. <selector refid="testcases.current"/>
  105. </or>
  106. </selector>
  107. <!-- actually call the test framework to run the tests. inheritRefs must
  108. be true so that all of the things defined above are known to the test
  109. framework. -->
  110. <target name="test">
  111. <ant antfile="${test.framework.home}/build.xml" target="test" inheritRefs="true"/>
  112. </target>
  113. </project>