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, 46 EXPECTED_FAILURE, 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 */ TestResultTestResult59 TestResult(Status status) 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 */ TestResultTestResult69 TestResult(Status status, const Profiler::MeasurementsMap &measurements) 70 : status{ status }, measurements{ measurements } 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 */ 82