Direct output to multiple targets
Brought to you by:
blep
To be able to use the same configuration both for automated regressions tests and for testing during component development, I have found the following utility class very useful:
<code>
class CPPUNIT_API OutputterList : public CPPUNIT_NS::Outputter
{
public:
/// Destructor.
virtual ~OutputterList()
{
delete out1;
delete out2;
}
OutputterList(Outputter *o1, Outputter *o2) : out1(o1), out2(o2){};
virtual void write()
{
if (out1 != NULL)
out1->write();
if (out2 != NULL)
out2->write();
};
protected:
Outputter *out1;
Outputter *out2;
};
</code>
Typically, I use it to direct output both to a file and to standard output.
Would this be of interest to add to the framework?