Click here to Skip to main content
15,884,859 members
Articles / Desktop Programming / MFC

Unit Test's Reporter

Rate me:
Please Sign up or sign in to vote.
4.86/5 (28 votes)
19 Feb 2006CPOL11 min read 64.6K   2.8K   58  
The article describes an application built to visualise testing processes for the unit test framework of CppUnitLite.
///////////////////////////////////////////////////////////////////////////////
// TESTRESULT.H
// A TestResult is a collection of the history of some test runs.  Right now
// it just collects failures.
///////////////////////////////////////////////////////////////////////////////

#ifndef TESTRESULT_H
#define TESTRESULT_H

class Failure;
class Success;

class TestResult
{
public:
					TestResult		(void);
					TestResult		(const bool, const bool, const bool);
	virtual void	TestsStarted	(void);
	virtual void	AddFailure		(const Failure& failure);
	virtual void	AddSuccess		(const Success& failure);
	virtual void	AddCheckPoint	(void)	{ allCheckCount_++; };
	virtual void	TestsEnded		(int);
	virtual	bool	Statistics		(void)	{ return statistics_; }
	virtual	bool	Trace			(void)	{ return trace_; }
	virtual int		Failures		(void)	{ return failureCount_; }
	virtual int		Summary			(void)	{ return allCheckCount_; }

private:
	int		failureCount_;
	int		successCount_;
	int		allCheckCount_;
	bool	debug_;
	bool	trace_;
	bool	statistics_;
};

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Israel Israel
MSc in System Engineering from Tallinn Technical University, Estonia. Currently, I work in a hitech enterprise in Israel.

Comments and Discussions