PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/bundles/plugins-trunk/XML/test/build.xml

#
XML | 139 lines | 81 code | 21 blank | 37 comment | 0 complexity | 4fb230ab0e9c59a72633dc217fb8d49b MD5 | raw file
  1<project name="xml_plugin_tests" default="test" basedir=".">
  2
  3	<property name="junit.usefile" value="on"/>
  4    
  5    <!-- general properties for plugins from the plugins directory, in 
  6    partcular, need the install.dir set to know where to find the plugin
  7    jar files. -->
  8    <property file="build.properties"/>
  9    <property file="../../build.properties"/>
 10
 11    <property name="build.properties" location="${test.framework.dir}/build.properties"/>
 12    
 13    <!-- location of the test framework, this should be set in the build.properties
 14    file loaded above. -->
 15    <property name="test.framework.home" location="/home/danson/src/jEditTestFramework"/>
 16    
 17    <!-- test source and classes -->
 18    <property name="project.test.src.dir" location="${basedir}"/>
 19    <property name="project.test.classes.dir" location="${basedir}/classes"/>
 20    <mkdir dir="${project.test.classes.dir}"/>
 21
 22    <property name="project.src.dir" location="${basedir}/.."/>
 23
 24    <!-- marker property to indicate to the test framework that plugin jars
 25    need to be copied -->
 26    <property name="copyPluginJars" value=""/>
 27    
 28    <property name="project.toinstrument.jar" value="XML.jar"/>
 29    
 30	<path id="project.src.dir" path=".."/>
 31    
 32    <!-- full list of all jar files necessary to let jEdit load and run
 33    the plugin.  All of these files will be copied to the jedit_settings/jar
 34    directory. -->
 35    <filelist id="plugin.jars" dir="${install.dir}">
 36    	<!-- XML libraries -->
 37		<file name="XML.jar"/>
 38		<file name="jing.jar"/>
 39		<file name="relaxngDatatype.jar"/>
 40		<file name="trang.jar"/>
 41		<!-- XercesPlugin -->
 42		<file name="XercesPlugin.jar"/>
 43		<file name="xml-apis.jar"/>
 44		<file name="xercesImpl.jar"/>
 45		<file name="resolver.jar"/>
 46		<!-- Beauty -->
 47		<file name="Beauty.jar"/>
 48		<!-- ErrorList -->
 49		<file name="ErrorList.jar"/>
 50		<!-- Sidekick -->
 51		<file name="SideKick.jar"/>
 52		<!-- Common Controls -->
 53		<file name="CommonControls.jar"/>
 54		<file name="kappalayout.jar"/>
 55		<!-- EclipseIcons -->
 56		<file name="EclipseIcons.jar"/>
 57		<!-- Hyperlinks -->
 58		<file name="Hyperlinks.jar"/>
 59    </filelist>
 60
 61    <fileset id="project.resources" dir="../test_data" defaultexcludes="yes">
 62  	<include name="BAH"/>
 63    </fileset>
 64    
 65    <!-- include everything needed to let jEdit load the plugin and run the 
 66    unit tests.  This should include all the jars listed in the plugin.jars 
 67    file list defined above. -->
 68    <path id="project.class.path">
 69        <pathelement path="${project.test.classes.dir}"/>
 70        <path>
 71            <filelist refid="plugin.jars"/>
 72        </path>
 73    </path>
 74
 75    <!-- include the classes for which you would like to see the coverage report -->
 76    <property name="emma.filter" value="*"/>
 77
 78    <!-- these are the actual test files to compile.  This is included so it
 79    is easy to fine tune which tests are compiled and ran. --> 
 80    <selector id="projectFiles">
 81        <filename name="**/*.java" />
 82    </selector>
 83    
 84    <!-- this selector holds all test cases.  This is optional. -->
 85    <selector id="testcases.all">
 86        <or>
 87            <filename name="**/*Test.java"/>
 88        </or>
 89    </selector>
 90
 91    <!-- this selector holds just one test.  This is optional. -->
 92    <selector id="testcases.current">
 93        <filename name="sidekick/html/HtmlParserTest.java"/>
 94    </selector>
 95
 96    <!-- this selector controls which tests to run, set the refid to either
 97    testcases.current to run just one test or testcases.all to run all tests,
 98    or some other selector.  This is NOT optional, if this selector is not
 99    defined, no tests will run. -->
100    <selector id="junit.testcases">
101        <or>
102            <selector refid="testcases.current"/>
103        </or>
104    </selector>
105
106    <!-- set any system properties, this is a way to let tests know things
107    without hardcoding values directly in the tests. -->    
108    <property name="test_data" location="../test_data"/>
109    <propertyset id="project.test.sysproperties">
110        <propertyref name="test_data"/>
111    </propertyset>
112    
113    <!-- actually call the test framework to run the tests.  inheritRefs must
114    be true so that all of the things defined above are known to the test 
115    framework. -->
116    <target name="test">
117        <ant antfile="${test.framework.home}/build.xml" target="-test" inheritRefs="true">
118            <reference refid="project.test.sysproperties"/>
119        </ant>
120    </target>
121    
122    <target name="test-all" description="run all tests">
123		<selector id="junit.testcases">
124			<or>
125				<selector refid="testcases.all"/>
126			</or>
127		</selector>
128        <ant antfile="${test.framework.home}/build.xml" target="-test" inheritRefs="true">
129            <reference refid="project.test.sysproperties"/>
130        </ant>
131    </target>
132
133    <!-- shortcut to only compile the tests (don't waste time instrumenting) -->
134    <target name="compile">
135        <ant antfile="${test.framework.home}/build.xml" target="-compileTests" inheritRefs="true">
136            <reference refid="project.test.sysproperties"/>
137        </ant>
138    </target>
139</project>