Benchmarking execution controller singleton. More...
#include <hayai_benchmarker.hpp>
Classes | |
| struct | CalibrationModel |
| Calibration model. More... | |
Static Public Member Functions | |
| static void | AddOutputter (Outputter &outputter) |
| Add an outputter. | |
| static void | ApplyPatternFilter (const char *pattern) |
| Apply a pattern filter to the tests. | |
| static Benchmarker & | Instance () |
| Get the singleton instance of Benchmarker. | |
| static std::vector< const TestDescriptor * > | ListTests () |
| List tests. | |
| static TestDescriptor * | RegisterTest (const char *fixtureName, const char *testName, std::size_t runs, std::size_t iterations, TestFactory *testFactory, TestParametersDescriptor parameters) |
| Register a test with the benchmarker instance. | |
| static void | RunAllTests () |
| Run all benchmarking tests. | |
| static void | ShuffleTests () |
| Shuffle tests. | |
Private Member Functions | |
| Benchmarker () | |
| Private constructor. | |
| std::vector< TestDescriptor * > | GetTests () const |
| Get the tests to be executed. | |
| ~Benchmarker () | |
| Private destructor. | |
Static Private Member Functions | |
| static bool | FilterMatchesString (const char *filter, const std::string &str) |
| Test if a filter matches a string. | |
| static CalibrationModel | GetCalibrationModel () |
| Get calibration model. | |
| static bool | PatternMatchesString (const char *pattern, const char *str) |
| Test if pattern matches a string. | |
Private Attributes | |
| std::vector< std::string > | _include |
| Test filters. | |
| std::vector< Outputter * > | _outputters |
| Registered outputters. | |
| std::vector< TestDescriptor * > | _tests |
| Registered tests. | |
Benchmarking execution controller singleton.
Definition at line 19 of file hayai_benchmarker.hpp.
| hayai::Benchmarker::Benchmarker | ( | ) | [inline, private] |
Private constructor.
Definition at line 368 of file hayai_benchmarker.hpp.
| hayai::Benchmarker::~Benchmarker | ( | ) | [inline, private] |
Private destructor.
Definition at line 375 of file hayai_benchmarker.hpp.
| static void hayai::Benchmarker::AddOutputter | ( | Outputter & | outputter | ) | [inline, static] |
Add an outputter.
| outputter | Outputter. The caller must ensure that the outputter remains in existence for the entire benchmark run. |
Definition at line 80 of file hayai_benchmarker.hpp.
| static void hayai::Benchmarker::ApplyPatternFilter | ( | const char * | pattern | ) | [inline, static] |
Apply a pattern filter to the tests.
--gtest_filter-compatible pattern:
https://code.google.com/p/googletest/wiki/AdvancedGuide
| pattern | Filter pattern compatible with gtest. |
Definition at line 93 of file hayai_benchmarker.hpp.
| static bool hayai::Benchmarker::FilterMatchesString | ( | const char * | filter, |
| const std::string & | str | ||
| ) | [inline, static, private] |
Test if a filter matches a string.
Adapted from gtest. All rights reserved by original authors.
Definition at line 406 of file hayai_benchmarker.hpp.
| static CalibrationModel hayai::Benchmarker::GetCalibrationModel | ( | ) | [inline, static, private] |
Get calibration model.
Returns an average linear calibration model.
Definition at line 463 of file hayai_benchmarker.hpp.
| std::vector<TestDescriptor*> hayai::Benchmarker::GetTests | ( | ) | const [inline, private] |
Get the tests to be executed.
Definition at line 388 of file hayai_benchmarker.hpp.
| static Benchmarker& hayai::Benchmarker::Instance | ( | ) | [inline, static] |
Get the singleton instance of Benchmarker.
Definition at line 26 of file hayai_benchmarker.hpp.
| static std::vector<const TestDescriptor*> hayai::Benchmarker::ListTests | ( | ) | [inline, static] |
List tests.
Definition at line 302 of file hayai_benchmarker.hpp.
| static bool hayai::Benchmarker::PatternMatchesString | ( | const char * | pattern, |
| const char * | str | ||
| ) | [inline, static, private] |
Test if pattern matches a string.
Adapted from gtest. All rights reserved by original authors.
Definition at line 436 of file hayai_benchmarker.hpp.
| static TestDescriptor* hayai::Benchmarker::RegisterTest | ( | const char * | fixtureName, |
| const char * | testName, | ||
| std::size_t | runs, | ||
| std::size_t | iterations, | ||
| TestFactory * | testFactory, | ||
| TestParametersDescriptor | parameters | ||
| ) | [inline, static] |
Register a test with the benchmarker instance.
| fixtureName | Name of the fixture. |
| testName | Name of the test. |
| runs | Number of runs for the test. |
| iterations | Number of iterations per run. |
| testFactory | Test factory implementation for the test. |
Definition at line 42 of file hayai_benchmarker.hpp.
| static void hayai::Benchmarker::RunAllTests | ( | ) | [inline, static] |
Run all benchmarking tests.
Definition at line 145 of file hayai_benchmarker.hpp.
| static void hayai::Benchmarker::ShuffleTests | ( | ) | [inline, static] |
Shuffle tests.
Randomly shuffles the order of tests.
Definition at line 321 of file hayai_benchmarker.hpp.
std::vector<std::string> hayai::Benchmarker::_include [private] |
Test filters.
Definition at line 579 of file hayai_benchmarker.hpp.
std::vector<Outputter*> hayai::Benchmarker::_outputters [private] |
Registered outputters.
Definition at line 577 of file hayai_benchmarker.hpp.
std::vector<TestDescriptor*> hayai::Benchmarker::_tests [private] |
Registered tests.
Definition at line 578 of file hayai_benchmarker.hpp.