C/C++ API Reference
Loading...
Searching...
No Matches
event_handler.h
1// Copyright 2022 The Pigweed Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4// use this file except in compliance with the License. You may obtain a copy of
5// the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12// License for the specific language governing permissions and limitations under
13// the License.
14#pragma once
15
16#include <cstdint>
17
19namespace pw::perf_test {
20
23 uint32_t number = 0;
24 float result = 0;
25};
26
29 int64_t mean = 0;
30 int64_t max = 0;
31 int64_t min = 0;
32};
33
38 int total_tests = 0;
39 int default_iterations = 0;
40};
41
43struct TestCase {
44 const char* name = nullptr;
45};
46
52 public:
53 virtual ~EventHandler() = default;
54
56 virtual void RunAllTestsStart(const TestRunInfo& test_run_info) = 0;
57
59 virtual void RunAllTestsEnd() = 0;
60
62 virtual void TestCaseStart(const TestCase& test_case) = 0;
63
65 virtual void TestCaseIteration(const TestIteration& test_iteration) = 0;
66
68 virtual void TestCaseEnd(const TestCase& test_case,
69 const TestMeasurement& test_measurement) = 0;
70};
71
72} // namespace pw::perf_test
Definition: event_handler.h:51
virtual void RunAllTestsEnd()=0
A performance test has ended.
virtual void TestCaseStart(const TestCase &test_case)=0
A performance test case is starting.
virtual void TestCaseEnd(const TestCase &test_case, const TestMeasurement &test_measurement)=0
A performance test case has ended.
virtual void TestCaseIteration(const TestIteration &test_iteration)=0
A performance test case has completed an iteration.
virtual void RunAllTestsStart(const TestRunInfo &test_run_info)=0
A performance test is starting.
Micro-benchmarks library.
Definition: event_handler.h:19
Describes the performance test being run.
Definition: event_handler.h:43
Data reported on completion of an iteration.
Definition: event_handler.h:22
Data reported for each Measurement upon completion of a performance test.
Definition: event_handler.h:28
Definition: event_handler.h:37