Automate unit tests

This commit is contained in:
Victor Shcherb 2012-07-09 01:09:05 +02:00
parent f90027684c
commit 24f769849b
3 changed files with 42 additions and 19 deletions

View file

@ -61,6 +61,23 @@
/>
</target>
<path id="test.classpath">
<pathelement location="${bin.absolute.dir}" />
<fileset dir="${lib.absolute.dir}">
<include name="*.jar" />
</fileset>
</path>
<target name="routetest" depends="compile">
<junit >
<sysproperty key="basedir" value="${basedir}"/>
<sysproperty key="obfdir" value="${obfdir}"/>
<classpath refid="test.classpath"/>
<formatter type="xml" />
<test name="net.osmand.router.test.JUnitRouteTest" todir="${basedir}/test-results" />
</junit>
</target>
<target name="jar" depends="-copy-resources, -dirs">
<manifestclasspath property="lib.list" jarfile="OsmAndMapCreator.jar">
<classpath refid="build.path"/>
@ -90,7 +107,7 @@
<delete file="MANIFEST.MF" />
</target>
<target name="build" depends="jar">
<target name="build" depends="jar, routetest">
<delete dir="build"/>
<copy todir="build">
<fileset dir=".">

View file

@ -8,6 +8,7 @@ import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
import net.osmand.Algoritms;
import net.osmand.binary.BinaryMapIndexReader;
import net.osmand.router.BinaryRoutePlanner;
import net.osmand.router.RoutingConfiguration;
@ -27,9 +28,13 @@ public class JUnitRouteTest {
return;
}
BinaryRoutePlanner.PRINT_TO_CONSOLE_ROUTE_INFORMATION_TO_TEST = false;
String obfdir = System.getenv("obfdir");
if(Algoritms.isEmpty(obfdir)){
obfdir = DataExtractionSettings.getSettings().getBinaryFilesDir();
}
List<File> files = new ArrayList<File>();
for (File f : new File(DataExtractionSettings.getSettings().getBinaryFilesDir()).listFiles()) {
for (File f : new File(obfdir).listFiles()) {
if (f.getName().endsWith(".obf")) {
files.add(f);
}

View file

@ -0,0 +1 @@
*.xml