Boost Test with multiple processes (MPI)
Does anyone have a solution for writing unit tests with Boost Test that
run in multiple processes? I am using MPI, but I think the same problem
would appear in other multi-process situations. I need some way to
collect whether, e.g., BOOST_CHECK, has passed.
Here's a schematic view of the problem. I want my "example" test to fail
because should_be_true is false on process 1. What happens is that I get
success on process 0 and failure in process 1.
#define BOOST_TEST_MAIN
#include
[Please do not mail me a copy of your followup] boost-users@lists.boost.org spake the secret code <4C2CC1C6.6000603@fnal.gov> thusly:
Does anyone have a solution for writing unit tests with Boost Test that run in multiple processes?
Sounds a little too high-level for a unit test; I would probably use FitNesse for something that high-level. // do something that sets should_be_unity to 1.0 // in process 0, and 1.1 in process 1. I would write two unit tests for these cases: one that checks each scenario where should_be_unity is set to different values. I would assume that MPI (or any other high-level multiprocess/multithreaded framework) works as advertised and that I don't need to test MPI. I would write tests around my stuff and not MPI. This may require that you create a way to fake out MPI in your unit test, which is no big deal. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/ Legalize Adulthood! http://legalizeadulthood.wordpress.com
participants (2)
-
James Amundson
-
legalize+jeeves@mail.xmission.com