|
#ifndef _CELERO_TESTFIXTURE_H_
#define _CELERO_TESTFIXTURE_H_
#include <cstddef>
#include <stdint.h>
#include <celero/Timer.h>
#include <celero/Export.h>
#include <vector>
namespace celero
{
///
/// \class TestFixture
///
class CELERO_EXPORT TestFixture
{
public:
///
/// Default Constructor.
///
TestFixture();
///
/// Virtual destructor for inheritance.
///
virtual ~TestFixture();
///
/// Set up the test fixture before benchmark execution.
///
virtual void SetUp();
///
/// Set up the test fixture before benchmark execution.
///
virtual void SetUp(const uint32_t problemSetValue);
///
/// Called after test completion to destroy the fixture.
///
virtual void TearDown();
///
/// \param calls The number of times to loop over the UserBenchmark function.
///
/// \return Returns the number of microseconds the run took.
///
std::pair<int64_t, int32_t> Run(const uint64_t calls, const size_t problemSetValueIndex);
///
///
///
size_t getProblemSetSize() const;
///
///
///
int32_t getProblemSetValue(const size_t x) const;
protected:
///
/// Implemented by the classes that are built via macros.
///
virtual void setProblemSetSize(const size_t) {};
/// Executed for each operation the benchmarking test is run.
virtual void UserBenchmark();
std::vector<uint32_t> ProblemSetValues;
private:
};
}
#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.
John Farrier is a professional C++ software engineer that specializes in modeling, simulation, and architecture development.
Specialties:
LVC Modeling & Simulation
Software Engineering, C++11, C++98, C, C#, FORTRAN, Python
Software Performance Optimization
Software Requirements Development
Technical Project and Team Leadership