Boost logo

Boost Users :

Subject: [Boost-users] Boost Test with multiple processes (MPI)
From: James Amundson (amundson_at_[hidden])
Date: 2010-07-01 12:26:46

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.

#include <boost/test/unit_test.hpp>

     double should_be_unity;
     const double tolerance = 1.0e-10;

     // do something that sets should_be_unity to 1.0
     // in process 0, and 1.1 in process 1.


I then run the test with
     mpirun -np 2 ./mytest

Obviously, I can write all my tests

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at