mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added template instantiation benchmark
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@211 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
f230e6b85d
commit
b5845cfdec
4 changed files with 53 additions and 0 deletions
5
src/applications/turtle_bench_2/Jamfile.v2
Normal file
5
src/applications/turtle_bench_2/Jamfile.v2
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
import template-profile ;
|
||||||
|
template-profile turtle_bench : turtle_bench.cpp
|
||||||
|
: <include>../../libraries
|
||||||
|
: <include>c:\\users\\mat\\desktop\\dev\\include
|
||||||
|
;
|
||||||
0
src/applications/turtle_bench_2/Jamroot
Normal file
0
src/applications/turtle_bench_2/Jamroot
Normal file
31
src/applications/turtle_bench_2/turtle_bench.cpp
Normal file
31
src/applications/turtle_bench_2/turtle_bench.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
//
|
||||||
|
// Copyright Mathieu Champlon 2010
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0. (See
|
||||||
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <turtle/mock.hpp>
|
||||||
|
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||||
|
|
||||||
|
#define F(z, n, d) virtual void f##n() = 0;
|
||||||
|
|
||||||
|
#define NUMBER_OF_METHODS 20
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
class base_class
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~base_class() {}
|
||||||
|
BOOST_PP_REPEAT_FROM_TO(0, NUMBER_OF_METHODS, F, )
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#define BOOST_PP_FILENAME_1 "turtle_bench.hpp"
|
||||||
|
#define BOOST_PP_ITERATION_LIMITS (1, 10)
|
||||||
|
#include BOOST_PP_ITERATE()
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{}
|
||||||
17
src/applications/turtle_bench_2/turtle_bench.hpp
Normal file
17
src/applications/turtle_bench_2/turtle_bench.hpp
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
//
|
||||||
|
// Copyright Mathieu Champlon 2010
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0. (See
|
||||||
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma message( BOOST_PP_STRINGIZE( BOOST_PP_CAT( mock_class, BOOST_PP_ITERATION() ) ) )
|
||||||
|
|
||||||
|
#define MOCK_F(z, n, d) MOCK_METHOD( f##n, 0 )
|
||||||
|
//#define MOCK_F(z, n, d) MOCK_METHOD_ALT( f##n )
|
||||||
|
|
||||||
|
MOCK_BASE_CLASS( BOOST_PP_CAT( mock_class, BOOST_PP_ITERATION() ), base_class )
|
||||||
|
{
|
||||||
|
BOOST_PP_REPEAT_FROM_TO(0, NUMBER_OF_METHODS, MOCK_F, )
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue