Fixed Boost.Mock generation

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@465 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2012-06-15 23:01:00 +00:00
parent 946d1f6874
commit fc5b7f7163
29 changed files with 37 additions and 42 deletions

View file

@ -138,8 +138,8 @@
<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}" includes="**/*.hpp,**/*.cpp"/>
</replaceregexp> </replaceregexp>
<replaceregexp match='"([^"]+)"' replace="&lt;boost/mock/\1&gt;" flags="g"> <replaceregexp match='"([^"]+\.hpp)"' replace="&lt;boost/mock/\1&gt;" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/> <fileset dir="${boost.dir}" includes="**/*.hpp"/>
</replaceregexp> </replaceregexp>
<replaceregexp match="&lt;turtle/([^&gt;]+)" replace="&lt;boost/mock/\1" flags="g"> <replaceregexp match="&lt;turtle/([^&gt;]+)" replace="&lt;boost/mock/\1" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/> <fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
@ -147,13 +147,10 @@
<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}" includes="**/*.hpp,**/*.cpp"/>
</replaceregexp> </replaceregexp>
<replaceregexp match="(}${line.separator}${line.separator}#endif //)" replace="}${line.separator}\1" flags="g"> <replaceregexp match="} // mock" replace="}${line.separator}}" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/> <fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
</replaceregexp> </replaceregexp>
<replaceregexp match="(}${line.separator}${line.separator}#define)" replace="}${line.separator}\1" flags="g"> <replaceregexp match="( mock::)" replace=" boost::mock::" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
</replaceregexp>
<replaceregexp match="(mock::)" replace="boost::\1" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/> <fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
</replaceregexp> </replaceregexp>
</target> </target>

View file

@ -24,9 +24,7 @@ namespace
int untriggered_expectation_count = 0; int untriggered_expectation_count = 0;
std::string last_context; std::string last_context;
}
namespace mock
{
template< typename Result > template< typename Result >
struct mock_error struct mock_error
{ {

View file

@ -134,7 +134,7 @@ namespace mock
{ {
return s << "mock_streamable"; return s << "mock_streamable";
} }
} } // mock
BOOST_AUTO_TEST_CASE( mock_streamable_type_yields_its_value_when_serialized ) BOOST_AUTO_TEST_CASE( mock_streamable_type_yields_its_value_when_serialized )
{ {
@ -300,7 +300,7 @@ namespace mock
{ {
return s << "ambiguous_convertible_mock_streamable"; return s << "ambiguous_convertible_mock_streamable";
} }
} } // mock
BOOST_AUTO_TEST_CASE( type_ambiguous_convertible_mock_streamable_yields_its_value_when_serialized ) BOOST_AUTO_TEST_CASE( type_ambiguous_convertible_mock_streamable_yields_its_value_when_serialized )
{ {
@ -366,7 +366,7 @@ namespace mock
{ {
return s << "template_mock_streamable"; return s << "template_mock_streamable";
} }
} } // mock
BOOST_AUTO_TEST_CASE( template_mock_streamable_yields_its_value_when_serialized ) BOOST_AUTO_TEST_CASE( template_mock_streamable_yields_its_value_when_serialized )
{ {
@ -538,7 +538,7 @@ namespace detail
return s << "mock::detail::template_serializable"; return s << "mock::detail::template_serializable";
} }
} }
} } // mock
BOOST_AUTO_TEST_CASE( mock_detail_template_type_serializable_yields_its_value_when_serialized ) BOOST_AUTO_TEST_CASE( mock_detail_template_type_serializable_yields_its_value_when_serialized )
{ {
@ -564,7 +564,7 @@ namespace detail
return s << "mock::detail::template_streamable"; return s << "mock::detail::template_streamable";
} }
} }
} } // mock
BOOST_AUTO_TEST_CASE( mock_detail_template_template_streamable_yields_its_value_when_serialized ) BOOST_AUTO_TEST_CASE( mock_detail_template_template_streamable_yields_its_value_when_serialized )
{ {

View file

@ -215,6 +215,6 @@ namespace detail
functor_type f_; functor_type f_;
}; };
} }
} } // mock
#endif // MOCK_ACTION_HPP_INCLUDED #endif // MOCK_ACTION_HPP_INCLUDED

View file

@ -48,7 +48,7 @@ namespace detail
BOOST_MPL_ASSERT_RELATION( n, <=, N ); BOOST_MPL_ASSERT_RELATION( n, <=, N );
}; };
} }
} } // mock
#define MOCK_ARG(N, n, S, tpn) \ #define MOCK_ARG(N, n, S, tpn) \
BOOST_PP_COMMA_IF(n) tpn \ BOOST_PP_COMMA_IF(n) tpn \

View file

@ -94,6 +94,6 @@ namespace mock
fail( "untriggered expectation", context, file, line ); fail( "untriggered expectation", context, file, line );
} }
}; };
} } // mock
#endif // MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED #endif // MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED

View file

@ -103,6 +103,6 @@ namespace detail
Functor f_; Functor f_;
}; };
} }
} } // mock
#endif // MOCK_CHECK_HPP_INCLUDED #endif // MOCK_CHECK_HPP_INCLUDED

View file

@ -47,6 +47,6 @@ namespace detail
boost::unit_test::const_string name_; boost::unit_test::const_string name_;
}; };
} }
} } // mock
#endif // MOCK_CHILD_HPP_INCLUDED #endif // MOCK_CHILD_HPP_INCLUDED

View file

@ -33,7 +33,7 @@ namespace detail
}; };
BOOST_GLOBAL_FIXTURE( cleanup ); BOOST_GLOBAL_FIXTURE( cleanup );
} }
} } // mock
#endif #endif

View file

@ -20,6 +20,6 @@ namespace mock
{} {}
Constraint f_; Constraint f_;
}; };
} } // mock
#endif // MOCK_CONSTRAINT_HPP_INCLUDED #endif // MOCK_CONSTRAINT_HPP_INCLUDED

View file

@ -225,6 +225,6 @@ namespace detail
{ {
return t; return t;
} }
} } // mock
#endif // MOCK_CONSTRAINTS_HPP_INCLUDED #endif // MOCK_CONSTRAINTS_HPP_INCLUDED

View file

@ -39,6 +39,6 @@ namespace detail
const verifiable& v ) const = 0; const verifiable& v ) const = 0;
}; };
} }
} } // mock
#endif // MOCK_CONTEXT_HPP_INCLUDED #endif // MOCK_CONTEXT_HPP_INCLUDED

View file

@ -72,6 +72,6 @@ namespace mock
fail( "untriggered expectation", context, file, line ); fail( "untriggered expectation", context, file, line );
} }
}; };
} } // mock
#endif // MOCK_DEFAULT_ERROR_POLICY_HPP_INCLUDED #endif // MOCK_DEFAULT_ERROR_POLICY_HPP_INCLUDED

View file

@ -257,6 +257,6 @@ namespace detail
#undef MOCK_EXPECTATION #undef MOCK_EXPECTATION
} }
} } // mock
#endif // MOCK_EXPECTATION_HPP_INCLUDED #endif // MOCK_EXPECTATION_HPP_INCLUDED

View file

@ -325,6 +325,6 @@ namespace mock
{ {
f.reset(); f.reset();
} }
} } // mock
#endif // MOCK_FUNCTION_HPP_INCLUDED #endif // MOCK_FUNCTION_HPP_INCLUDED

View file

@ -60,6 +60,6 @@ namespace detail
verifiables_t verifiables_; verifiables_t verifiables_;
}; };
} }
} } // mock
#endif // MOCK_GROUP_HPP_INCLUDED #endif // MOCK_GROUP_HPP_INCLUDED

View file

@ -172,6 +172,6 @@ namespace detail
} }
}; };
} }
} } // mock
#endif // MOCK_INVOCATION_HPP_INCLUDED #endif // MOCK_INVOCATION_HPP_INCLUDED

View file

@ -45,6 +45,6 @@ namespace detail
> >
{}; {};
} }
} } // mock
#endif // MOCK_IS_FUNCTOR_HPP_INCLUDED #endif // MOCK_IS_FUNCTOR_HPP_INCLUDED

View file

@ -74,6 +74,6 @@ namespace detail
{} {}
}; };
} }
} } // mock
#endif // MOCK_LAMBDA_HPP_INCLUDED #endif // MOCK_LAMBDA_HPP_INCLUDED

View file

@ -21,6 +21,7 @@ namespace boost
{ {
template< typename T > class shared_ptr; template< typename T > class shared_ptr;
template< typename T > class weak_ptr; template< typename T > class weak_ptr;
template< typename T > class reference_wrapper;
namespace phoenix namespace phoenix
{ {
@ -34,7 +35,6 @@ namespace assign_detail
{ {
template< typename T > class generic_list; template< typename T > class generic_list;
} }
template< typename T > class reference_wrapper;
} }
namespace mock namespace mock
@ -307,6 +307,6 @@ namespace detail
*s.s_ << t; *s.s_ << t;
return s; return s;
} }
} } // mock
#endif // MOCK_LOG_HPP_INCLUDED #endif // MOCK_LOG_HPP_INCLUDED

View file

@ -75,7 +75,7 @@ namespace detail
// the method is ambiguous : use MOCK_METHOD_EXT instead // the method is ambiguous : use MOCK_METHOD_EXT instead
template< typename T > template< typename T >
T& ambiguous_method_name_use_MOCK_METHOD_EXT_instead( const T& ); T& ambiguous_method_name_use_MOCK_METHOD_EXT_instead( const T& );
} } // mock
#define MOCK_BASE_CLASS(T, I) \ #define MOCK_BASE_CLASS(T, I) \
struct T : I, mock::object, mock::detail::base< I > struct T : I, mock::object, mock::detail::base< I >

View file

@ -130,6 +130,6 @@ namespace detail
{ {
o.impl_->reset(); o.impl_->reset();
} }
} } // mock
#endif // MOCK_OBJECT_HPP_INCLUDED #endif // MOCK_OBJECT_HPP_INCLUDED

View file

@ -106,6 +106,6 @@ namespace detail
{ {
return detail::not_< Constraint >( c.f_ ); return detail::not_< Constraint >( c.f_ );
} }
} } // mock
#endif // MOCK_OPERATORS_HPP_INCLUDED #endif // MOCK_OPERATORS_HPP_INCLUDED

View file

@ -41,6 +41,6 @@ namespace detail
boost::optional< type_name > type_; boost::optional< type_name > type_;
}; };
} }
} } // mock
#endif // MOCK_PARENT_HPP_INCLUDED #endif // MOCK_PARENT_HPP_INCLUDED

View file

@ -137,6 +137,6 @@ namespace detail
{ {
mock::detail::root.reset(); mock::detail::root.reset();
} }
} } // mock
#endif // MOCK_ROOT_HPP_INCLUDED #endif // MOCK_ROOT_HPP_INCLUDED

View file

@ -63,6 +63,6 @@ namespace detail
boost::shared_ptr< detail::sequence_impl > impl_; boost::shared_ptr< detail::sequence_impl > impl_;
}; };
} } // mock
#endif // MOCK_SEQUENCE_HPP_INCLUDED #endif // MOCK_SEQUENCE_HPP_INCLUDED

View file

@ -81,6 +81,6 @@ namespace detail
const std::type_info* info_; const std::type_info* info_;
}; };
} }
} } // mock
#endif // MOCK_TYPE_NAME_HPP_INCLUDED #endif // MOCK_TYPE_NAME_HPP_INCLUDED

View file

@ -27,6 +27,6 @@ namespace detail
virtual void reset() = 0; virtual void reset() = 0;
}; };
} }
} } // mock
#endif // MOCK_VERIFIABLE_HPP_INCLUDED #endif // MOCK_VERIFIABLE_HPP_INCLUDED

View file

@ -27,6 +27,6 @@ namespace detail
no_type operator,( yes_type, yes_type ); no_type operator,( yes_type, yes_type );
no_type operator,( no_type, yes_type ); no_type operator,( no_type, yes_type );
} }
} } // mock
#endif // MOCK_YES_NO_TYPE_HPP_INCLUDED #endif // MOCK_YES_NO_TYPE_HPP_INCLUDED