Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Boost unit testing be multithreaded?

My unit testing requires running a lot of BOOST_CHECK_CLOSE calls, which are taking a very long time (on one thread as far as I can tell). I would like to be able to do something along these lines:

#pragma omp parallel for num_threads(8)
for (int i=0; i<ARRAY_SIZE; i++) {
    BOOST_CHECK_CLOSE(array1[i], array2[i], tolerance);
}

However, when I try this some very nasty memory corruption out of my control seems to happen. Segfaults most commonly, but sometimes this instead:

*** stack smashing detected ***

Has anyone got some experience of a good way to achieve my intended result which they could share? I'm sure everyone would appreciate having their tests running fast!

like image 588
daft_wader Avatar asked Oct 31 '22 15:10

daft_wader


1 Answers

It cannot as mentionned here (item 3)

http://www.boost.org/doc/libs/1_57_0/libs/test/doc/html/open-issues.html

See the full discussion here:

Is there a way to run C++ Unit Tests tests in parallel?

like image 97
Gabriel Avatar answered Nov 15 '22 04:11

Gabriel