<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!--
// // See license.txt for license information. // // unit_test.xml // // 29-Aug-2005 phamilton Created //
-->

<filedef name="unit_test">
    <filepath>$(filepath)</filepath>
    <extension>.cpp</extension>
    <root>$(root)</root>
    <ignoreobjects>$(ignoreobjects)</ignoreobjects>
    <blocks>
        <date name="date">
            <format>%e-%b-%Y</format>
        </date>
        <text name="description">
            <content>$(description)</content>
        </text>
        <text name="boostv">
            <content>$(boostv)</content>
        </text>
<!--
block which outputs all test declarations.
-->

        <foreachobject name="alltests">
            <location>$(root)</location>
            <blocks>
                <namespace name="namespace"/>
                <stringmember name="classname">
                    <membername>classname</membername>
                </stringmember>
                <foreach name="tests">
                    <vector>tests</vector>
                    <blocks>
                        <stringmember name="method">
                            <membername>method</membername>
                        </stringmember>
                        <stringmember name="match">
                            <membername>match</membername>
                        </stringmember>
                        <stringmember name="name">
                            <membername>name</membername>
                        </stringmember>
                        <counter name="counter">
                            <start>1</start>
                        </counter>
<!--
the symbols have changed between boost versions. Choose the correct symbol when generating the code
-->

                        <text name="make_test_boost_old">
                            <conditions>
                                <blockgreater>
                                    <block>boostv</block>
                                    <value>0103100</value>
                                    <fail/>
                                </blockgreater>
                            </conditions>
                            <content>boost::unit_test_framework::create_test_case</content>
                        </text>
                        <text name="make_test">
                            <conditions>
                                <blockgreater>
                                    <block>boostv</block>
                                    <value>0103100</value>
                                </blockgreater>
                            </conditions>
                            <content>boost::unit_test::make_test_case</content>
                        </text>
                        <forlist name="args">
                            <listmember>args</listmember>
                            <blocks>
                                <text name="comma">
                                    <conditions>
                                        <islast>
                                            <fail/>
                                        </islast>
                                    </conditions>
                                    <content>, </content>
                                </text>
                            </blocks>
                            <structure>argv[\counter]\comma</structure>
                        </forlist>
                        <text name="object">
                            <content>\(t)test->add(\make_test_boost_old\make_test(\n\t\t&\namespace::\classname::\method, \n\t\t"\name", \n\t\(t)boost::shared_ptr<\namespace::\classname>(\n\t\t\(t)new \namespace::\classname(\args, \n\t\t\t\match))));\n\n</content>
                        </text>
                    </blocks>
                    <structure>\object</structure>
                </foreach>
            </blocks>
            <structure>\tests</structure>
        </foreachobject>
<!--
block which outputs all includes for classes which have test cases.
-->

        <foreachobject name="allincludes">
            <location>$(root)</location>
            <blocks>
                <stringmember name="classname">
                    <membername>classname</membername>
                </stringmember>
                <text name="include">
                    <conditions>
                        <objecthasany>
                            <membername>tests</membername>
                            <membertype>test</membertype>
                        </objecthasany>
                    </conditions>
                    <content>#include "\classname.hpp"\n</content>
                </text>
            </blocks>
            <structure>\include</structure>
        </foreachobject>
    </blocks>
    <structure>\comment=on See license.txt for license information. unit_test.cpp Generated by tangle. Edit at your own risk! \comment=off #include <iostream> #include <boost/test/included/unit_test_framework.hpp> using boost::unit_test_framework::test_suite; \allincludes test_suite *init_unit_test_suite(int argc, char* argv[]) { test_suite * test = BOOST_TEST_SUITE("\description"); /* these symbols are tied to boost version "\boostv"/. Re-tangle with a different version if this is incorrect. */ \alltests return test; } </structure>
</filedef>