Smid - 2011-07-18

I'm using g++ 4.5.3 on Linux (and also on an older Solaris box, which is kind of the problem).

I've written fairly extensive unit tests using cppunit 1.12.1 inside a project which is ambivalent about them. However, I've hit a problem:

They are slow to compile, even on a fast machine. The fast linux machine compiles the following files in 30 seconds, and the solaris in over 20 minutes. Its seems to get lost in template resolution hell. Is there any way you can think to speed this up? Otherwise the project will do the "sensible" thing and stop compiling the unit tests every build..

unit_test.h is:

#ifndef UNIT_TESTS_H
#define UNIT_TESTS_H
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
using namespace std;
class Unit_tests : public CPPUNIT_NS :: TestFixture
{
    CPPUNIT_TEST_SUITE (Unit_tests);
    CPPUNIT_TEST (UnitTest);
    CPPUNIT_TEST_SUITE_END ();
    
protected:
    void UnitTest(void);
};

#endif

Unit test.cpp is:

#include "unit_test.h"
CPPUNIT_TEST_SUITE_REGISTRATION (Unit_tests);
void Unit_tests::UnitTest (void)
{
    CPPUNIT_ASSERT_EQUAL(std::string(""), std::string(""));
   // Repeat above line 799 times...
}