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;
45 std::string qpaCommandLineParameters;
48 std::string candyTargetName;
49 std::string configName;
50 std::string resultName;
51 std::string timestamp;
59 size_t getSize (void) const { return m_data.size(); }
60 const deUint8* getBytes (void) const { return !m_data.empty() ? &m_data[0] : DE_NULL; }
62 void append (const deUint8* bytes, size_t numBytes);
65 InfoLog (const InfoLog& other);
66 InfoLog& operator= (const InfoLog& other);
68 std::vector<deUint8> m_data;
71 class TestCaseResultData
74 TestCaseResultData (const char* casePath);
75 ~TestCaseResultData (void);
77 const char* getTestCasePath (void) const { return m_casePath.c_str(); }
79 void setTestResult (TestStatusCode code, const char* details);
81 TestStatusCode getStatusCode (void) const { return m_statusCode; }
82 const char* getStatusDetails (void) const { return m_statusDetails.c_str(); }
84 int getDataSize (void) const { return (int)m_data.size(); }
85 void setDataSize (int size) { m_data.resize(size); }
87 const deUint8* getData (void) const { return !m_data.empty() ? &m_data[0] : DE_NULL; }
88 deUint8* getData (void) { return !m_data.empty() ? &m_data[0] : DE_NULL; }
93 // \note statusCode and statusDetails are either set by BatchExecutor or later parsed from data.
94 std::string m_casePath;
95 TestStatusCode m_statusCode;
96 std::string m_statusDetails;
97 std::vector<deUint8> m_data;
100 typedef de::SharedPtr<TestCaseResultData> TestCaseResultPtr;
101 typedef de::SharedPtr<const TestCaseResultData> ConstTestCaseResultPtr;
109 const SessionInfo& getSessionInfo (void) const { return m_sessionInfo; }
110 SessionInfo& getSessionInfo (void) { return m_sessionInfo; }
112 int getNumTestCaseResults (void) const { return (int)m_testCaseResults.size(); }
113 ConstTestCaseResultPtr getTestCaseResult (int ndx) const { return ConstTestCaseResultPtr(m_testCaseResults[ndx]); }
114 TestCaseResultPtr getTestCaseResult (int ndx) { return m_testCaseResults[ndx]; }
116 bool hasTestCaseResult (const char* casePath) const;
117 ConstTestCaseResultPtr getTestCaseResult (const char* casePath) const;
118 TestCaseResultPtr getTestCaseResult (const char* casePath);
120 TestCaseResultPtr createTestCaseResult (const char* casePath);
123 BatchResult (const BatchResult& other);
124 BatchResult& operator= (const BatchResult& other);
126 SessionInfo m_sessionInfo;
127 std::vector<TestCaseResultPtr> m_testCaseResults;
128 std::map<std::string, int> m_resultMap;
133 #endif // _XEBATCHRESULT_HPP