buildframework/helium/tools/common/testing.ant.xml
changeset 217 0f5e3a7fb6af
parent 179 d8ac696cc51f
child 587 85df38eb4012
--- a/buildframework/helium/tools/common/testing.ant.xml	Fri Feb 05 11:59:41 2010 +0000
+++ b/buildframework/helium/tools/common/testing.ant.xml	Thu Mar 04 15:10:37 2010 +0200
@@ -20,23 +20,18 @@
 
 ============================================================================
 -->
+<!--* @package framework -->
 <project name="internal.testing" xmlns:au="org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium"> 
     <description>
         Targets to test Helium itself.
     </description>
     
-    <fileset id="python.files" dir="${helium.dir}">
-        <include name="tools/**/*.py"/>
-        <include name="extensions/nokia/tools/**/*.py"/>
-        <exclude name="tools/startup/bootstrap/site.py"/>
-    </fileset>
-
     <!-- Runs all the unit testing targets. -->
-    <target name="unittest" depends="ju-unittest,check,ant-unittest,py-unittest"/>
+    <target name="unittest" depends="ju-unittest,ant-unittest,py-unittest"/>
     
     <!-- Unit testing -->
 
-    <!-- Setup environment for Python unit tests -->
+    <!-- Setup environment for Python unit tests. -->
     <target name="setup-py-unittest">
         <!-- Autogenerate test data for ArchivePreBuilderTest based on ANT properties -->
         <if>
@@ -54,20 +49,22 @@
 
     <!-- Do Python tests. -->
     <target name="do-py-unittest" depends="setup-py-unittest">
-        <property name="nose.args" value="cpythontest nokiacpythontest nokiatest test"/>
+        <property name="nose.args" value="nokiacpythontest scripttests"/>
         <exec executable="python" failonerror="true">
+            <env key="TEST_DATA" value="${helium.dir}/tests"/>
             <arg line="${python.tools}/coverage.py -x ${python.tools}/nosetests-script.py -v ${nose.args}"/>
         </exec>
         <script language="jython" setbeans="false">
 import sys
 import os
+os.putenv('TEST_DATA', os.path.join(os.environ['HELIUM_HOME'], 'tests'))
 sys.path.append(os.path.join(os.environ['HELIUM_HOME'], 'external/python/lib/common/nose-0.11.1-py2.6.egg'))
 sys.path.append(os.path.join(os.environ['HELIUM_HOME'], 'external/python/lib/common/mocker-0.10.1-py2.5.egg'))
 import nose
 args = project.getProperty('nose.args')
-if args == 'cpythontest nokiacpythontest nokiatest test':
-    nose.run(argv=['-v', os.path.join(os.environ['HELIUM_HOME'], 'tools/common/python/lib/test'), 'nokiatest'])
-elif args.startswith('nokiatest.') or args.startswith('test.'):
+if ' ' in args:
+    nose.run(argv=['-v', 'scripttests'])
+elif 'cpython' not in args:
     nose.run(argv=['-v', args])
 print >> sys.stderr
         </script>
@@ -81,7 +78,11 @@
     <target name="py-unittest-coverage">
         <mkdir dir="${helium.build.dir}/coverage"/>
         <pathconvert pathsep=" " property="python.modules.coverage">
-            <fileset refid="python.files"/>
+            <fileset dir="${helium.dir}">
+                <include name="tools/**/*.py"/>
+                <include name="extensions/nokia/tools/**/*.py"/>
+                <exclude name="tools/startup/bootstrap/site.py"/>
+            </fileset>
         </pathconvert>
         <exec executable="python" failonerror="true">
             <arg line="${python.tools}/coverage.py -a -d ${helium.build.dir}/coverage ${python.modules.coverage}"/>
@@ -136,8 +137,16 @@
     <!-- Run JUnit unit tests. -->
     <target name="ju-unittest" depends="build-java-src">
         <!-- Source location for test class -->
+        <!-- Source location for junit test class.
+        @type string
+        @scope private
+        -->
         <property name="src" location="tools/common/java/test" /> 
         <!-- Source classes location -->
+        <!-- Java source files location for helium library.
+        @type string
+        @scope private
+        -->
         <property name="src.classes" location="tools/common/java/src" />
         
         <delete dir="${build.temp.dir}/junit_classes"/>
@@ -192,52 +201,6 @@
         </emma>
         <loadfile property="message" srcFile="${build.temp.dir}/coverage.txt"/>
         <echo message="${message}"/>
-    </target>
-    
-    
-    <!-- iMaker Helium feature unittesting. -->
-    <target name="imaker-unittest" depends="rombuild-export-features">
-        <property name="imaker.unittest.args" value="" />
-        <for param="unittest.filename">
-            <path>
-                <fileset dir="${build.drive}/epoc32/rom/config/unittest" casesensitive="yes">        
-                    <include name="**/test_*.mk"/>
-                </fileset>
-            </path>
-            <sequential>
-                <echo>Running @{unittest.filename}</echo>
-                <exec executable="${imaker.command}" dir="${build.drive}/">
-                    <arg line="${imaker.unittest.args}"/>
-                    <arg line="-f @{unittest.filename}"/>
-                    <arg value="unittest"/>
-                </exec>
-            </sequential>
-        </for>
-    </target>
-    
-    <!-- Validates XML files against suitable schema or DTDs. -->
-    <target name="validate-xml">
-        <!--<schemavalidate fullchecking="false" noNamespaceFile="tools/common/schema/ant.xsd">
-            <Schema namespace="ant.apache.org"
-                    file="tools/common/schema/ant.xsd" />
-            <schema namespace="http://www.nokia.com/helium"
-                    file="tools/common/schema/helium_ant.xsd" />
-            <fileset dir="tools">
-                <include name="**/build.xml"/>
-                <include name="**/*.ant.xml"/>
-                <exclude name="**/test_*.ant.xml"/>
-            </fileset>
-        </schemavalidate>-->
-        <schemavalidate noNamespaceFile="tools/common/schema/helium_data_model.xsd"
-                        file="${data.model.file}"/>
-        <!--<schemavalidate noNamespaceFile="tools/common/schema/helium_config.xsd">
-            <fileset dir="testconfig">
-                <include name="**/delivery.xml"/>
-                <include name="**/*.cfg.xml"/>
-                <exclude name="**/test_*.ant.xml"/>
-            </fileset>
-        </schemavalidate>-->
-    </target>
-    
+    </target>    
     
 </project>