blob: 18e54343dc4f84cd7f3fca050d6d32518b4a4bd3 [file] [log] [blame]
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +01001/*
Freddie Liardet59fd7a72021-06-17 13:30:11 +01002 * Copyright (c) 2017-2018,2021 Arm Limited.
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +01003 *
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
Moritz Pflanzera4f711b2017-07-05 11:02:23 +010027#include "Profiler.h"
28
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010029namespace arm_compute
30{
31namespace test
32{
33namespace framework
34{
35/** Class to store results of a test.
36 *
37 * Currently the execution status and profiling information are stored.
38 */
39struct TestResult
40{
41 /** Execution status of a test. */
42 enum class Status
43 {
44 NOT_RUN,
45 SUCCESS,
46 EXPECTED_FAILURE,
47 FAILED,
Moritz Pflanzerbf234e02017-07-24 15:04:14 +010048 CRASHED,
49 DISABLED
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010050 };
51
52 /** Default constructor. */
53 TestResult() = default;
54
55 /** Initialise the result with a status.
56 *
57 * @param[in] status Execution status.
58 */
59 TestResult(Status status)
60 : status{ status }
61 {
62 }
63
Moritz Pflanzera4f711b2017-07-05 11:02:23 +010064 /** Initialise the result with a status and profiling information.
65 *
66 * @param[in] status Execution status.
67 * @param[in] measurements Profiling information.
68 */
69 TestResult(Status status, const Profiler::MeasurementsMap &measurements)
70 : status{ status }, measurements{ measurements }
71 {
72 }
73
Alex Gildayc357c472018-03-21 13:54:09 +000074 Status status{ Status::NOT_RUN }; /**< Execution status */
75 Profiler::MeasurementsMap measurements{}; /**< Profiling information */
Freddie Liardet59fd7a72021-06-17 13:30:11 +010076 std::string header_data{}; /**< Test header data */
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010077};
78} // namespace framework
79} // namespace test
80} // namespace arm_compute
81#endif /* ARM_COMPUTE_TEST_TESTRESULT */