Hi!

I've been contributing to JOSM a couple of years ago and now found some more time to work on the project.

I was thinking of looking into unit tests a little bit and extend the coverage. Are there any guidelines around unit testing, what's the general approach? Do people feel adding more test coverage will be valuable for the project?

I also added HTML reports for Junit to the build (as an optional task as it may require some dependencies for ant) but since my old SVN password doesn't seem to work, I'm attaching it as a patch here.

Finally, I've played with code coverage a little bit and have managed to generate a sample coverage report:
http://mfloryan.statnet.pl/josm-test-coverage/

I already have another ant task for generating it automatically but it requires cubertura as a dependency so I'm not including it yet. (It would be fairly easy though to use maven to fetch these dependencies automatically during build without a need to including them in SVN).

Regards,
Marcin
Index: build.xml
===================================================================
--- build.xml	(revision 3790)
+++ build.xml	(working copy)
@@ -186,6 +186,16 @@
 		</junit>
 	</target>
 
+    <target name="test-html" depends="test" description="Generate HTML test reports">
+        <!-- May require additional ant dependencies like ant-trax package -->
+        <junitreport todir="${test.dir}/report">
+            <fileset dir="${test.dir}/report">
+                <include name="TEST-*.xml"/>
+            </fileset>
+            <report todir="${test.dir}/report/html"/>
+        </junitreport>
+    </target>
+
 	<target name="dist-optimized" depends="dist">
 		<taskdef resource="proguard/ant/task.properties" classpath="tools/proguard.jar" />
 		<proguard>
_______________________________________________
josm-dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to