1 #ifndef _XEBATCHRESULT_HPP
2 #define _XEBATCHRESULT_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program Test Executor
5 * ------------------------------------------
7 * Copyright 2014 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief Test batch result.
24 *//*--------------------------------------------------------------------*/
27 #include "xeTestCase.hpp"
28 #include "xeTestCaseResult.hpp"
29 #include "deSharedPtr.hpp"
41 // Produced by test binary.
42 std::string releaseName;
43 std::string releaseId;
44 std::string targetName;
47 std::string candyTargetName;
48 std::string configName;
49 std::string resultName;
50 std::string timestamp;
58 int getSize (void) const { return (int)m_data.size(); }
59 const deUint8* getBytes (void) const { return !m_data.empty() ? &m_data[0] : DE_NULL; }
61 void append (const deUint8* bytes, int numBytes);
64 InfoLog (const InfoLog& other);
65 InfoLog& operator= (const InfoLog& other);
67 std::vector<deUint8> m_data;
70 class TestCaseResultData
73 TestCaseResultData (const char* casePath);
74 ~TestCaseResultData (void);
76 const char* getTestCasePath (void) const { return m_casePath.c_str(); }
78 void setTestResult (TestStatusCode code, const char* details);
80 TestStatusCode getStatusCode (void) const { return m_statusCode; }
81 const char* getStatusDetails (void) const { return m_statusDetails.c_str(); }
83 int getDataSize (void) const { return (int)m_data.size(); }
84 void setDataSize (int size) { m_data.resize(size); }
86 const deUint8* getData (void) const { return !m_data.empty() ? &m_data[0] : DE_NULL; }
87 deUint8* getData (void) { return !m_data.empty() ? &m_data[0] : DE_NULL; }
92 // \note statusCode and statusDetails are either set by BatchExecutor or later parsed from data.
93 std::string m_casePath;
94 TestStatusCode m_statusCode;
95 std::string m_statusDetails;
96 std::vector<deUint8> m_data;
99 typedef de::SharedPtr<TestCaseResultData> TestCaseResultPtr;
100 typedef de::SharedPtr<const TestCaseResultData> ConstTestCaseResultPtr;
108 const SessionInfo& getSessionInfo (void) const { return m_sessionInfo; }
109 SessionInfo& getSessionInfo (void) { return m_sessionInfo; }
111 int getNumTestCaseResults (void) const { return (int)m_testCaseResults.size(); }
112 ConstTestCaseResultPtr getTestCaseResult (int ndx) const { return ConstTestCaseResultPtr(m_testCaseResults[ndx]); }
113 TestCaseResultPtr getTestCaseResult (int ndx) { return m_testCaseResults[ndx]; }
115 bool hasTestCaseResult (const char* casePath) const;
116 ConstTestCaseResultPtr getTestCaseResult (const char* casePath) const;
117 TestCaseResultPtr getTestCaseResult (const char* casePath);
119 TestCaseResultPtr createTestCaseResult (const char* casePath);
122 BatchResult (const BatchResult& other);
123 BatchResult& operator= (const BatchResult& other);
125 SessionInfo m_sessionInfo;
126 std::vector<TestCaseResultPtr> m_testCaseResults;
127 std::map<std::string, int> m_resultMap;
132 #endif // _XEBATCHRESULT_HPP