cppalex
cppalex

Reputation: 537

Slow compilation of boost-based unit test suite

I use boost.test library to write unit tests for my application.

The problem is, when one particular *.cpp file containing test suite grows up to certain size, compilation of that file becomes extremely slow.

I use BOOST_AUTO_TEST_CASE macro to define test cases.

Boost version is 1.34.1

Build env is autotools + gcc 4.3 under Fedora 9.

I will highly appreciate if somebody will point out possible reasons of such behaviour.

Upvotes: 2

Views: 1344

Answers (3)

Gennadiy Rozental
Gennadiy Rozental

Reputation: 1945

You can split the same test suite to span multiple test files. This should alleviate your issues.

Upvotes: 1

Laurynas Biveinis
Laurynas Biveinis

Reputation: 10848

One way to try to find out what is going on is to use gcc option -Q and see where is the difference between normal and extremely slow case.

Upvotes: 1

grivei
grivei

Reputation: 61

You might run out physical memory and the system starts using the swap (file/partition) a lot more intensively than normaly (thrashing).

Upvotes: 1

Related Questions