Pigweed
 
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
18namespace pw::perf_test {
19
22 uint32_t number = 0;
23 float result = 0;
24};
25
28 float mean = 0;
29 float max = 0;
30 float min = 0;
31};
32
37 int total_tests = 0;
38 int default_iterations = 0;
39};
40
42struct TestCase {
43 const char* name = nullptr;
44};
45
51 public:
52 virtual ~EventHandler() = default;
53
55 virtual void RunAllTestsStart(const TestRunInfo& test_run_info) = 0;
56
58 virtual void RunAllTestsEnd() = 0;
59
61 virtual void TestCaseStart(const TestCase& test_case) = 0;
62
64 virtual void TestCaseIteration(const TestIteration& test_iteration) = 0;
65
67 virtual void TestCaseMeasure(const TestMeasurement& test_measurement) = 0;
68
70 virtual void TestCaseEnd(const TestCase& test_case) = 0;
71};
72
73} // namespace pw::perf_test
Definition: event_handler.h:50
virtual void TestCaseEnd(const TestCase &test_case)=0
A performance test case has ended.
virtual void RunAllTestsEnd()=0
A performance test has ended.
virtual void TestCaseMeasure(const TestMeasurement &test_measurement)=0
A performance test case has produced a Measurement.
virtual void TestCaseStart(const TestCase &test_case)=0
A performance test case is starting.
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.
Describes the performance test being run.
Definition: event_handler.h:42
Data reported on completion of an iteration.
Definition: event_handler.h:21
Data reported for each Measurement upon completion of a performance test.
Definition: event_handler.h:27
Definition: event_handler.h:36