blob: 747c2defb4a92e6423557bfc94a730c2c5ad8041 [file] [log] [blame]
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +01001/*
2 * Copyright (c) 2017 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
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,
48 CRASHED
49 };
50
51 /** Default constructor. */
52 TestResult() = default;
53
54 /** Initialise the result with a status.
55 *
56 * @param[in] status Execution status.
57 */
58 TestResult(Status status)
59 : status{ status }
60 {
61 }
62
Moritz Pflanzera4f711b2017-07-05 11:02:23 +010063 /** Initialise the result with a status and profiling information.
64 *
65 * @param[in] status Execution status.
66 * @param[in] measurements Profiling information.
67 */
68 TestResult(Status status, const Profiler::MeasurementsMap &measurements)
69 : status{ status }, measurements{ measurements }
70 {
71 }
72
73 Status status{ Status::NOT_RUN }; //< Execution status
74 Profiler::MeasurementsMap measurements{}; //< Profiling information
Moritz Pflanzerfc95ed22017-07-05 11:07:07 +010075};
76} // namespace framework
77} // namespace test
78} // namespace arm_compute
79#endif /* ARM_COMPUTE_TEST_TESTRESULT */