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
This commit is contained in:
Michael Bayne
2010-11-08 19:44:11 +00:00
parent 2a61ecf169
commit 906f69a392
183 changed files with 79 additions and 40 deletions
+71 -15
View File
@@ -103,29 +103,19 @@
</target> </target>
<!-- cleans out the intermediate build files --> <!-- cleans out the intermediate build files -->
<target name="clean" depends="common-clean"> <target name="clean">
<delete dir="${classes.dir}"/> <delete dir="${classes.dir}"/>
<delete dir="${tclasses.dir}"/>
<delete dir="${deploy.dir}/docs"/> <delete dir="${deploy.dir}/docs"/>
<delete failonerror="false"><fileset dir="${deploy.dir}" includes="*.jar"/></delete> <delete failonerror="false"><fileset dir="${deploy.dir}" includes="*.jar"/></delete>
<delete failonerror="false"><fileset dir="${deploy.dir}" includes="*.swc"/></delete> <delete failonerror="false"><fileset dir="${deploy.dir}" includes="*.swc"/></delete>
</target> </target>
<!-- wipes the entire build directory clean --> <!-- wipes the entire build directory clean -->
<target name="distclean" depends="common-clean"> <target name="distclean">
<delete dir="${deploy.dir}"/> <delete dir="${deploy.dir}"/>
</target> </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 --> <!-- build the java class files -->
<target name="compile" depends="-check-available"> <target name="compile" depends="-check-available">
<mkdir dir="${classes.dir}"/> <mkdir dir="${classes.dir}"/>
@@ -239,8 +229,74 @@
</java> </java>
</target> </target>
<target name="tests" depends="compile" description="Builds and runs the tests."> <target name="-prep-test-rsrcs">
<!-- TODO --> <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> </target>
<!-- a target for rebuilding everything --> <!-- a target for rebuilding everything -->
@@ -26,20 +26,15 @@ import java.util.Iterator;
import java.io.IOException; import java.io.IOException;
import junit.framework.Test; import org.junit.*;
import junit.framework.TestCase; import static org.junit.Assert.*;
import com.threerings.media.tile.TileSet; import com.threerings.media.tile.TileSet;
public class XMLTileSetParserTest extends TestCase public class XMLTileSetParserTest
{ {
public XMLTileSetParserTest () @Test
{ public void testRuleSets ()
super(XMLTileSetParserTest.class.getName());
}
@Override
public void runTest ()
{ {
HashMap<String, TileSet> sets = new HashMap<String, TileSet>(); HashMap<String, TileSet> sets = new HashMap<String, TileSet>();
@@ -56,8 +51,8 @@ public class XMLTileSetParserTest extends TestCase
// print them out // print them out
Iterator<TileSet> iter = sets.values().iterator(); Iterator<TileSet> iter = sets.values().iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
iter.next(); // iter.next();
// System.out.println(iter.next()); System.out.println(iter.next());
} }
} catch (IOException ioe) { } catch (IOException ioe) {
@@ -66,17 +61,5 @@ public class XMLTileSetParserTest extends TestCase
} }
} }
public static Test suite () protected static final String TILESET_PATH = "rsrc/media/tile/tools/xml/tilesets.xml";
{
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";
} }

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 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: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 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.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: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 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: 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: 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: 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: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Some files were not shown because too many files have changed in this diff Show More