mirror of https://github.com/google/benchmark.git
README.md: mention that fixture has SetUp() / TearDown()
This commit is contained in:
parent
97393e5ef8
commit
b8ca0c4217
|
@ -615,7 +615,14 @@ creating/registering the tests using the following macros:
|
||||||
For Example:
|
For Example:
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
class MyFixture : public benchmark::Fixture {};
|
class MyFixture : public benchmark::Fixture {
|
||||||
|
public:
|
||||||
|
void SetUp(const ::benchmark::State& state) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void TearDown(const ::benchmark::State& state) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
BENCHMARK_F(MyFixture, FooTest)(benchmark::State& st) {
|
BENCHMARK_F(MyFixture, FooTest)(benchmark::State& st) {
|
||||||
for (auto _ : st) {
|
for (auto _ : st) {
|
||||||
|
|
Loading…
Reference in New Issue