Compute Library
 23.08
TestResult.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2018,2021 Arm Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef ARM_COMPUTE_TEST_TESTRESULT
25 #define ARM_COMPUTE_TEST_TESTRESULT
26 
27 #include "Profiler.h"
28 
29 namespace arm_compute
30 {
31 namespace test
32 {
33 namespace framework
34 {
35 /** Class to store results of a test.
36  *
37  * Currently the execution status and profiling information are stored.
38  */
39 struct TestResult
40 {
41  /** Execution status of a test. */
42  enum class Status
43  {
44  NOT_RUN,
45  SUCCESS,
47  FAILED,
48  CRASHED,
49  DISABLED
50  };
51 
52  /** Default constructor. */
53  TestResult() = default;
54 
55  /** Initialise the result with a status.
56  *
57  * @param[in] status Execution status.
58  */
60  : status{ status }
61  {
62  }
63 
64  /** Initialise the result with a status and profiling information.
65  *
66  * @param[in] status Execution status.
67  * @param[in] measurements Profiling information.
68  */
71  {
72  }
73 
74  Status status{ Status::NOT_RUN }; /**< Execution status */
75  Profiler::MeasurementsMap measurements{}; /**< Profiling information */
76  std::string header_data{}; /**< Test header data */
77 };
78 } // namespace framework
79 } // namespace test
80 } // namespace arm_compute
81 #endif /* ARM_COMPUTE_TEST_TESTRESULT */
arm_compute::test::framework::TestResult::Status
Status
Execution status of a test.
Definition: TestResult.h:42
arm_compute::test::framework::TestResult::Status::SUCCESS
@ SUCCESS
arm_compute::test::framework::TestResult::status
Status status
Execution status.
Definition: TestResult.h:74
arm_compute::test::framework::TestResult::Status::CRASHED
@ CRASHED
arm_compute::test::framework::TestResult::TestResult
TestResult(Status status, const Profiler::MeasurementsMap &measurements)
Initialise the result with a status and profiling information.
Definition: TestResult.h:69
Profiler.h
arm_compute::test::framework::TestResult::Status::DISABLED
@ DISABLED
arm_compute::test::framework::Profiler::MeasurementsMap
std::map< std::string, std::vector< Measurement > > MeasurementsMap
Mapping from instrument ids to their measurements.
Definition: Profiler.h:49
arm_compute::test::framework::TestResult::Status::FAILED
@ FAILED
arm_compute::test::framework::TestResult::measurements
Profiler::MeasurementsMap measurements
Profiling information.
Definition: TestResult.h:75
arm_compute
Copyright (c) 2017-2023 Arm Limited.
Definition: introduction.dox:24
arm_compute::test::framework::TestResult
Class to store results of a test.
Definition: TestResult.h:39
arm_compute::test::framework::TestResult::TestResult
TestResult(Status status)
Initialise the result with a status.
Definition: TestResult.h:59
arm_compute::test::framework::TestResult::Status::EXPECTED_FAILURE
@ EXPECTED_FAILURE
arm_compute::test::framework::TestResult::Status::NOT_RUN
@ NOT_RUN
arm_compute::test::framework::TestResult::header_data
std::string header_data
Test header data.
Definition: TestResult.h:76
arm_compute::test::framework::TestResult::TestResult
TestResult()=default
Default constructor.