Making tests work again. Next up will be fixing test failures. (Actually next
up will be making the tests actually test something, and then fixing that when they break.) git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@1050 ed5b42cb-e716-0410-a449-f6a68f950b19
@@ -103,29 +103,19 @@
|
||||
</target>
|
||||
|
||||
<!-- cleans out the intermediate build files -->
|
||||
<target name="clean" depends="common-clean">
|
||||
<target name="clean">
|
||||
<delete dir="${classes.dir}"/>
|
||||
<delete dir="${tclasses.dir}"/>
|
||||
<delete dir="${deploy.dir}/docs"/>
|
||||
<delete failonerror="false"><fileset dir="${deploy.dir}" includes="*.jar"/></delete>
|
||||
<delete failonerror="false"><fileset dir="${deploy.dir}" includes="*.swc"/></delete>
|
||||
</target>
|
||||
|
||||
<!-- wipes the entire build directory clean -->
|
||||
<target name="distclean" depends="common-clean">
|
||||
<target name="distclean">
|
||||
<delete dir="${deploy.dir}"/>
|
||||
</target>
|
||||
|
||||
<!-- common clean tasks -->
|
||||
<target name="common-clean">
|
||||
<!--
|
||||
<delete file="rsrc/bundles/tiles/tilesets.map"/>
|
||||
<delete file="rsrc/bundles/components/components.map"/>
|
||||
<delete file="rsrc/bundles/components/metadata.jar"/>
|
||||
<delete><fileset dir="rsrc/bundles/tiles" includes="**/bundle.jar"/></delete>
|
||||
<delete><fileset dir="rsrc/bundles/components" includes="**/components.jar"/></delete>
|
||||
-->
|
||||
</target>
|
||||
|
||||
<!-- build the java class files -->
|
||||
<target name="compile" depends="-check-available">
|
||||
<mkdir dir="${classes.dir}"/>
|
||||
@@ -239,8 +229,74 @@
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="tests" depends="compile" description="Builds and runs the tests.">
|
||||
<!-- TODO -->
|
||||
<target name="-prep-test-rsrcs">
|
||||
<copy todir="${tclasses.dir}">
|
||||
<fileset dir="src/test/resources" includes="**"/>
|
||||
</copy>
|
||||
<property name="testrsrc.dir" value="${tclasses.dir}/rsrc"/>
|
||||
</target>
|
||||
|
||||
<target name="test-tsbundles" depends="-prep-test-rsrcs"
|
||||
description="Build test tileset bundles.">
|
||||
<taskdef name="tilebundle" classpathref="test.classpath"
|
||||
classname="com.threerings.media.tile.bundle.tools.TileSetBundlerTask"/>
|
||||
<taskdef name="conffringe" classpathref="test.classpath"
|
||||
classname="com.threerings.miso.tile.tools.CompileFringeConfigurationTask"/>
|
||||
<property name="tbundle.dir" value="${testrsrc.dir}/bundles/tiles"/>
|
||||
|
||||
<!-- blow away the tilesetid map file so that we get a consistent mapping every time -->
|
||||
<delete file="${tbundle.dir}/tilesets.map"/>
|
||||
|
||||
<tilebundle config="${tbundle.dir}/bundler-config.xml" mapfile="${tbundle.dir}/tilesets.map">
|
||||
<fileset dir="${tbundle.dir}/ground" includes="**/*.xml"/>
|
||||
</tilebundle>
|
||||
<tilebundle config="${tbundle.dir}/bundler-config.xml" mapfile="${tbundle.dir}/tilesets.map">
|
||||
<fileset dir="${tbundle.dir}/objects" includes="**/*.xml"/>
|
||||
</tilebundle>
|
||||
|
||||
<conffringe tilesetmap="${tbundle.dir}/tilesets.map"
|
||||
fringedef="${testrsrc.dir}/config/miso/tile/fringeconf.xml"
|
||||
target="${testrsrc.dir}/config/miso/tile/fringeconf.dat"/>
|
||||
</target>
|
||||
|
||||
<target name="test-cbundles" depends="-prep-test-rsrcs"
|
||||
description="Builds test component bundles.">
|
||||
<taskdef name="metabundle" classpathref="test.classpath"
|
||||
classname="com.threerings.cast.bundle.tools.MetadataBundlerTask"/>
|
||||
<taskdef name="cbundle" classpathref="test.classpath"
|
||||
classname="com.threerings.cast.bundle.tools.ComponentBundlerTask"/>
|
||||
<property name="cbundle.dir" value="${testrsrc.dir}/bundles/components"/>
|
||||
|
||||
<metabundle actiondef="${cbundle.dir}/actions.xml" classdef="${cbundle.dir}/classes.xml"
|
||||
target="${cbundle.dir}/metadata.jar"/>
|
||||
|
||||
<!-- blow away the components map file so that we get a consistent mapping every time -->
|
||||
<delete file="${cbundle.dir}/components.map"/>
|
||||
<cbundle actiondef="${cbundle.dir}/actions.xml" target="${cbundle.dir}/pirate/components.jar"
|
||||
mapfile="${cbundle.dir}/components.map" root="${cbundle.dir}/pirate">
|
||||
<fileset dir="${cbundle.dir}/pirate" includes="**/*.png" excludes="components/**"/>
|
||||
</cbundle>
|
||||
<cbundle actiondef="${cbundle.dir}/actions.xml" target="${cbundle.dir}/vessel/components.jar"
|
||||
mapfile="${cbundle.dir}/components.map" root="${cbundle.dir}/vessel">
|
||||
<fileset dir="${cbundle.dir}/vessel" includes="**/*.png" excludes="components/**"/>
|
||||
</cbundle>
|
||||
</target>
|
||||
|
||||
<property name="test" value=""/>
|
||||
<target name="tests" depends="compile,test-tsbundles,test-cbundles"
|
||||
description="Runs unit tests. Use -Dtest=Foo to run only FooTest.">
|
||||
<taskdef name="unit" classpathref="test.classpath"
|
||||
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
|
||||
<unit printsummary="off" haltonfailure="yes">
|
||||
<classpath refid="test.classpath"/>
|
||||
<sysproperty key="test_dir" value="${tclasses.dir}"/>
|
||||
<sysproperty key="resource_dir" value="${testrsrc.dir}"/>
|
||||
<sysproperty key="no_unpack_resources" value="true"/>
|
||||
<formatter type="brief" usefile="false"/>
|
||||
<batchtest>
|
||||
<fileset dir="${tsrc.dir}" includes="**/*${test}*Test.java"/>
|
||||
</batchtest>
|
||||
</unit>
|
||||
</target>
|
||||
|
||||
<!-- a target for rebuilding everything -->
|
||||
|
||||
@@ -26,20 +26,15 @@ import java.util.Iterator;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import com.threerings.media.tile.TileSet;
|
||||
|
||||
public class XMLTileSetParserTest extends TestCase
|
||||
public class XMLTileSetParserTest
|
||||
{
|
||||
public XMLTileSetParserTest ()
|
||||
{
|
||||
super(XMLTileSetParserTest.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runTest ()
|
||||
@Test
|
||||
public void testRuleSets ()
|
||||
{
|
||||
HashMap<String, TileSet> sets = new HashMap<String, TileSet>();
|
||||
|
||||
@@ -56,8 +51,8 @@ public class XMLTileSetParserTest extends TestCase
|
||||
// print them out
|
||||
Iterator<TileSet> iter = sets.values().iterator();
|
||||
while (iter.hasNext()) {
|
||||
iter.next();
|
||||
// System.out.println(iter.next());
|
||||
// iter.next();
|
||||
System.out.println(iter.next());
|
||||
}
|
||||
|
||||
} catch (IOException ioe) {
|
||||
@@ -66,17 +61,5 @@ public class XMLTileSetParserTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public static Test suite ()
|
||||
{
|
||||
return new XMLTileSetParserTest();
|
||||
}
|
||||
|
||||
public static void main (String[] args)
|
||||
{
|
||||
XMLTileSetParserTest test = new XMLTileSetParserTest();
|
||||
test.runTest();
|
||||
}
|
||||
|
||||
protected static final String TILESET_PATH =
|
||||
"rsrc/media/tile/tools/xml/tilesets.xml";
|
||||
protected static final String TILESET_PATH = "rsrc/media/tile/tools/xml/tilesets.xml";
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |