Automate unit tests
This commit is contained in:
parent
f90027684c
commit
24f769849b
3 changed files with 42 additions and 19 deletions
|
@ -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=".">
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
1
DataExtractionOSM/test-results/.gitignore
vendored
Normal file
1
DataExtractionOSM/test-results/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
*.xml
|
Loading…
Reference in a new issue