Boost logo

Boost :

Subject: [boost] Information about BMock
From: Sterkin, Asher (ASterkin_at_[hidden])
Date: 2009-12-24 15:34:02


Recently I've came across discussion about extending the Boost.Test framework with a mocking capabilities:
 I've even found a new header file mock_object.hpp within the 1_41 distribution, but not any documentation yet.

There was a question about BMock library I developed and presented about at BoostCon09. The main differentiator of BMock from the rest of C++ frameworks I'm familiar with (except maybe MockItNow) is that it does not require neither classes, nor virtual methods. It does use heavily BOOST.Preprocessor and, at certain degree, boost meta-programming capabilities. Even though it has some historical quirks BMock has two major advantages, in my view, unsurpassable yet:

a) Ability to dynamically mock ANY function or method. The function definition header needs to be wrapped with a special BMOCK_FUNCTION macro. Opposite to MockItNow this proves a fully portable solution, which does not depend on profiler API or any other low-level compiler capabilities.

a) Deep integration with Boost.Test library, most importantly with its diagnostics.

So far it proved itself as an extremely useful tool for embedded software development in C/C++. Attached you will find BMock documentation (sorry, not Boost standard :(). Not everything is relevant and not everything should remain, but hopefully you will get an adequate impression about how does it work from the user perspective.

As I explained it to Dave during the BoostCon 09 I do not think that BMock in its current state is suitable to be a separate contribution to the Boost library, nor do I think it should be. From the beginning the BMock was conceived as a lightweight (well, as much as possible) extension to Boost.Test. If you find it interesting I will be happy to send you all sources (not too much) and to discuss how to proceed further.

Asher Sterkin

Asher [cid:image001.png_at_01CA84E9.267C30C0] <> [cid:image002.png_at_01CA84E9.267C30C0] <> [cid:image003.png_at_01CA84E9.267C30C0] <> [cid:image004.gif_at_01CA84E9.267C30C0] <>

This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster_at_[hidden] and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes.
To protect the environment please do not print this e-mail unless necessary.

An NDS Group Limited company.


Boost list run by bdawes at, gregod at, cpdaniel at, john at