mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Refactored conversion to boost layout
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@645 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
4faf23b2b1
commit
d28db33c08
2 changed files with 68 additions and 17 deletions
|
|
@ -31,16 +31,16 @@ namespace
|
||||||
|
|
||||||
namespace mock // it could also be in the namespace of 'my_class'
|
namespace mock // it could also be in the namespace of 'my_class'
|
||||||
{
|
{
|
||||||
bool operator==( const my_class& actual, const std::string& expected ) // the trick is to compare to a string
|
bool operator==( const my_class& actual, const std::string& expected ) // the first part of trick is to compare to a string
|
||||||
{
|
{
|
||||||
return boost::lexical_cast< std::string >( actual ) == expected;
|
return boost::lexical_cast< std::string >( actual ) == expected;
|
||||||
}
|
}
|
||||||
}
|
} // mock
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE( method_is_called )
|
BOOST_AUTO_TEST_CASE( method_is_called )
|
||||||
{
|
{
|
||||||
my_mock mock;
|
my_mock mock;
|
||||||
MOCK_EXPECT( mock.method ).once().with( "my_class( 42 )" ); // the constraint is given as a string
|
MOCK_EXPECT( mock.method ).once().with( "my_class( 42 )" ); // the second part of the trick is to express the constraint as a string
|
||||||
mock.method( my_class( 42 ) );
|
mock.method( my_class( 42 ) );
|
||||||
}
|
}
|
||||||
//]
|
//]
|
||||||
|
|
|
||||||
|
|
@ -120,8 +120,15 @@
|
||||||
|
|
||||||
<property name="boost.dir" value="${out.dir}/../boost"/>
|
<property name="boost.dir" value="${out.dir}/../boost"/>
|
||||||
|
|
||||||
<target name="boost" description="convert to boost">
|
<presetdef name="bjam">
|
||||||
<delete dir="${boost.dir}"/>
|
<exec taskname="bjam" failonerror="true" executable="bjam">
|
||||||
|
<arg value="-q"/>
|
||||||
|
</exec>
|
||||||
|
</presetdef>
|
||||||
|
|
||||||
|
<target name="boost.generate" description="generate boost.mock into ${boost.dir}">
|
||||||
|
<delete dir="${boost.dir}/boost/mock"/>
|
||||||
|
<delete dir="${boost.dir}/libs/mock"/>
|
||||||
<copy todir="${boost.dir}/boost/mock">
|
<copy todir="${boost.dir}/boost/mock">
|
||||||
<fileset dir="${libraries.dir}/turtle" includes="**"/>
|
<fileset dir="${libraries.dir}/turtle" includes="**"/>
|
||||||
</copy>
|
</copy>
|
||||||
|
|
@ -139,37 +146,81 @@
|
||||||
<copy todir="${boost.dir}">
|
<copy todir="${boost.dir}">
|
||||||
<fileset dir="boost" includes="LICENSE_1_0.txt,Jamroot.jam,Jamfile.v2"/>
|
<fileset dir="boost" includes="LICENSE_1_0.txt,Jamroot.jam,Jamfile.v2"/>
|
||||||
</copy>
|
</copy>
|
||||||
<!--
|
</target>
|
||||||
|
|
||||||
|
<target name="boost.convert" description="convert boost.mock in ${boost.dir}">
|
||||||
<replaceregexp match="MOCK" replace="BOOST_MOCK" flags="g">
|
<replaceregexp match="MOCK" replace="BOOST_MOCK" flags="g">
|
||||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
|
||||||
|
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
<replaceregexp match="BOOST_MOCK_BOOST_MOCK" replace="BOOST_MOCK" flags="g">
|
<replaceregexp match="BOOST_MOCK_BOOST_MOCK" replace="BOOST_MOCK" flags="g">
|
||||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
|
||||||
|
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
<replaceregexp match='"([^"]+\.hpp)"' replace="<boost/mock/\1>" flags="g">
|
<replaceregexp match='"([^"]+\.hpp)"' replace="<boost/mock/\1>" flags="g">
|
||||||
<fileset dir="${boost.dir}" includes="**/*.hpp"/>
|
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp" excludes="**/detail/*.hpp"/>
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
<replaceregexp match='"\.\./([^"]+\.hpp)"' replace="<boost/mock/\1>" flags="g">
|
<replaceregexp match='"\.\./([^"]+\.hpp)"' replace="<boost/mock/\1>" flags="g">
|
||||||
<fileset dir="${boost.dir}" includes="**/*.hpp"/>
|
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
|
||||||
|
</replaceregexp>
|
||||||
|
<replaceregexp match='"([^"]+\.hpp)"' replace="<boost/mock/detail/\1>" flags="g">
|
||||||
|
<fileset dir="${boost.dir}/boost/mock" includes="**/detail/*.hpp"/>
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
<replaceregexp match="<turtle/([^>]+)" replace="<boost/mock/\1" flags="g">
|
<replaceregexp match="<turtle/([^>]+)" replace="<boost/mock/\1" flags="g">
|
||||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
|
||||||
|
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
<replaceregexp match="(namespace mock)" replace="namespace boost${line.separator}{${line.separator}\1" flags="g">
|
<replaceregexp match="(namespace mock)" replace="namespace boost${line.separator}{${line.separator}\1" flags="g">
|
||||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
|
||||||
|
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
<replaceregexp match="} // mock" replace="}${line.separator}}" flags="g">
|
<replaceregexp match="} // mock" replace="}${line.separator}}" flags="g">
|
||||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
|
||||||
|
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp"/>
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
<replaceregexp match="( mock::)" replace=" boost::mock::" flags="g">
|
<replaceregexp match=" mock::" replace=" boost::mock::" flags="g">
|
||||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
|
||||||
|
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
|
||||||
|
</replaceregexp>
|
||||||
|
<replaceregexp match="^mock::" replace="boost::mock::" flags="m">
|
||||||
|
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
|
||||||
|
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
<replaceregexp match="http://turtle.sourceforge.net" replace="Boost.Mock" flags="g">
|
<replaceregexp match="http://turtle.sourceforge.net" replace="Boost.Mock" flags="g">
|
||||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
|
||||||
|
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp"/>
|
||||||
|
</replaceregexp>
|
||||||
|
<replaceregexp match="reference.helpers." replace="reference.helpers.boost_" flags="g">
|
||||||
|
<fileset dir="${boost.dir}/libs/mock" includes="**/*.qbk"/>
|
||||||
|
</replaceregexp>
|
||||||
|
<replaceregexp match="turtle." replace="boost_mock." flags="g">
|
||||||
|
<fileset dir="${boost.dir}/libs/mock" includes="**/*.qbk"/>
|
||||||
|
</replaceregexp>
|
||||||
|
<replaceregexp match="Turtle" replace="Boost.Mock" flags="g">
|
||||||
|
<fileset dir="${boost.dir}/libs/mock" includes="**/*.qbk"/>
|
||||||
</replaceregexp>
|
</replaceregexp>
|
||||||
-->
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="boost.test" description="run boost.mock tests in ${boost.dir}">
|
||||||
|
<bjam dir="${boost.dir}/libs/mock/test"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="boost.doc" description="generate boost.mock documentation in ${boost.dir}">
|
||||||
|
<bjam dir="${boost.dir}/libs/mock/doc"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="boost.package" description="package boost.mock">
|
||||||
|
<zip destfile="${out.dir}/boost-mock.zip">
|
||||||
|
<fileset dir="${boost.dir}" includes="boost/mock/**"/>
|
||||||
|
<fileset dir="${boost.dir}" includes="libs/mock/**" excludes="**/bin/**"/>
|
||||||
|
<fileset dir="${boost.dir}" includes="LICENSE_1_0.txt,Jamroot.jam,Jamfile.v2"/>
|
||||||
|
</zip>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="documentation" depends="boost.generate,boost.doc"/>
|
||||||
|
|
||||||
|
<target name="boost" depends="boost.generate,boost.convert,boost.doc,boost.test"/>
|
||||||
|
|
||||||
<target name="all" depends="configure,test,bench,reports,export,package" description="configure, build and run tests and benchmark, export and package distribution"/>
|
<target name="all" depends="configure,test,bench,reports,export,package" description="configure, build and run tests and benchmark, export and package distribution"/>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue