diff --git a/build.xml b/build.xml
index a82f1ca..5f94761 100644
--- a/build.xml
+++ b/build.xml
@@ -55,7 +55,7 @@
   <property name="optimize" value="true"/>
   <property name="javac.target" value="1.2"/>
   <property name="javac.source" value="1.2"/>
-  <property name="junit.fork" value="false"/>
+  <property name="junit.fork" value="true"/>
   <property name="junit.filtertrace" value="off"/>
   <property name="junit.summary" value="no"/>
   <property name="test.haltonfailure" value="false"/>
@@ -101,6 +101,14 @@
          Set the paths used in the build
        ===================================================================
   -->
+  <!-- directory that contains emma.jar and emma_ant.jar: -->
+  <property name="emma.dir" value="${env.EMMA_HOME}" />
+
+  <path id="emma.lib" >
+    <pathelement location="${emma.dir}/emma.jar" />
+    <pathelement location="${emma.dir}/emma_ant.jar" />
+  </path>
+
   <path id="classpath">
   </path>
 
@@ -114,6 +122,7 @@
     <pathelement location="${tests.dir}"/>
     <pathelement location="${tests.etc.dir}"/>
     <path refid="classpath"/>
+    <path refid="emma.lib"/>
   </path>
 
   <!-- turn this path into a string which is passed to the tests -->
@@ -1521,6 +1530,19 @@
          Compile testcases
        ===================================================================
   -->
+  <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
+
+  <target name="emma" depends="dump-info,compile-tests">
+    <emma>
+      <instr mode="overwrite">
+        <instrpath>
+          <pathelement location="${build.classes}"/>
+          <pathelement location="${build.tests}"/>
+        </instrpath>
+      </instr>
+    </emma>
+  </target>
+
   <target name="compile-tests" depends="build" if="junit.present">
     <mkdir dir="${build.tests}"/>
 
