cpp-stat-bench 0.24.0
Benchmark library with statistics for C++.
Loading...
Searching...
No Matches
case_impl.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 MusicScience37 (Kenta Kabashima)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
20#pragma once
21
22#include "stat_bench/bench_impl/benchmark_case_helper.h" // IWYU pragma: keep
23#include "stat_bench/bench_impl/benchmark_case_register.h" // IWYU pragma: keep
24#include "stat_bench/bench_impl/null_fixture.h" // IWYU pragma: keep
25#include "stat_bench/benchmark_case_name.h" // IWYU pragma: keep
26#include "stat_bench/benchmark_group_name.h" // IWYU pragma: keep
27
37#define STAT_BENCH_IMPL_CASE_WITH_FIXTURE_IMPL( \
38 CLASS_NAME, REGISTER_NAME, FIXTURE_NAME, GROUP_NAME, CASE_NAME) \
39 \
40 namespace { \
41 \
42 class CLASS_NAME final \
43 : public ::stat_bench::bench_impl::BenchCaseHelper<FIXTURE_NAME> { \
44 public: \
45 CLASS_NAME() \
46 : BenchCaseHelper(::stat_bench::BenchmarkGroupName(GROUP_NAME), \
47 ::stat_bench::BenchmarkCaseName(CASE_NAME)) {} \
48 \
49 void run() override; \
50 }; \
51 \
52 static const ::stat_bench::bench_impl::BenchmarkCaseRegister<CLASS_NAME> \
53 REGISTER_NAME; \
54 \
55 } /* namespace */ \
56 \
57 void CLASS_NAME::run()
58
67#define STAT_BENCH_IMPL_CASE_IMPL( \
68 CLASS_NAME, REGISTER_NAME, GROUP_NAME, CASE_NAME) \
69 STAT_BENCH_IMPL_CASE_WITH_FIXTURE_IMPL(CLASS_NAME, REGISTER_NAME, \
70 ::stat_bench::bench_impl::NullFixture, GROUP_NAME, CASE_NAME)
Definition of BenchCaseHelper class.
Definition of BenchmarkCaseName class.
Definition of BenchmarkCaseRegister class.
Definition of BenchmarkGroupName class.
Definition of NullFixture class.