1 #ifndef _XETESTCASERESULT_HPP
2 #define _XETESTCASERESULT_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 case result models.
24 *//*--------------------------------------------------------------------*/
27 #include "xeTestCase.hpp"
38 TESTSTATUSCODE_PASS, //!< Test case passed.
39 TESTSTATUSCODE_FAIL, //!< Test case failed (not passed).
40 TESTSTATUSCODE_QUALITY_WARNING, //!< Result within specification, but suspicious quality wise
41 TESTSTATUSCODE_COMPATIBILITY_WARNING, //!< Result within specification, but likely to cause fragmentation
42 TESTSTATUSCODE_PENDING, //!< Not yet started.
43 TESTSTATUSCODE_RUNNING, //!< Currently running (not stored in database).
44 TESTSTATUSCODE_NOT_SUPPORTED, //!< Some feature was not supported in the implementation.
45 TESTSTATUSCODE_RESOURCE_ERROR, //!< A resource error has occurred.
46 TESTSTATUSCODE_INTERNAL_ERROR, //!< An internal error has occurred.
47 TESTSTATUSCODE_CANCELED, //!< User canceled the execution
48 TESTSTATUSCODE_TIMEOUT, //!< Test was killed because of watch dog timeout.
49 TESTSTATUSCODE_CRASH, //!< Test executable crashed before finishing the test.
50 TESTSTATUSCODE_DISABLED, //!< Test case disabled (for current target)
51 TESTSTATUSCODE_TERMINATED, //!< Terminated for other reason.
56 const char* getTestStatusCodeName (TestStatusCode statusCode);
83 // \todo [2014-02-28 pyry] Make List<T> for items that have only specific subitems.
91 int getNumItems (void) const { return (int)m_items.size(); }
92 const Item& getItem (int ndx) const { return *m_items[ndx]; }
93 Item& getItem (int ndx) { return *m_items[ndx]; }
99 std::vector<Item*> m_items;
102 template <typename T>
103 T* List::allocItem (void)
105 m_items.reserve(m_items.size()+1);
107 m_items.push_back(static_cast<ri::Item*>(item));
113 class TestCaseResultHeader
116 TestCaseResultHeader (void) : caseType(TESTCASETYPE_LAST), statusCode(TESTSTATUSCODE_LAST) {}
118 std::string casePath; //!< Full test case path.
119 TestCaseType caseType; //!< Test case type.
120 TestStatusCode statusCode; //!< Test status code.
121 std::string statusDetails; //!< Status description.
124 class TestCaseResult : public TestCaseResultHeader
127 ri::List resultItems; //!< Test log items.
172 NumericValue (void) : m_type(TYPE_EMPTY) {}
173 NumericValue (deInt64 value) : m_type(TYPE_INT64) { m_value.int64 = value; }
174 NumericValue (double value) : m_type(TYPE_FLOAT64) { m_value.float64 = value; }
176 Type getType (void) const { return m_type; }
177 deInt64 getInt64 (void) const { DE_ASSERT(getType() == TYPE_INT64); return m_value.int64; }
178 double getFloat64 (void) const { DE_ASSERT(getType() == TYPE_FLOAT64); return m_value.float64; }
189 std::ostream& operator<< (std::ostream& str, const NumericValue& value);
195 virtual ~Item (void) {}
197 Type getType (void) const { return m_type; }
200 Item (Type type) : m_type(type) {}
203 Item (const Item& other);
204 Item& operator= (const Item& other);
209 class Result : public Item
212 Result (void) : Item(TYPE_RESULT), statusCode(TESTSTATUSCODE_LAST) {}
215 TestStatusCode statusCode;
219 class Text : public Item
222 Text (void) : Item(TYPE_TEXT) {}
228 class Number : public Item
231 Number (void) : Item(TYPE_NUMBER) {}
235 std::string description;
241 class Image : public Item
254 COMPRESSION_NONE = 0,
260 Image (void) : Item(TYPE_IMAGE), width(0), height(0), format(FORMAT_LAST), compression(COMPRESSION_LAST) {}
264 std::string description;
268 Compression compression;
269 std::vector<deUint8> data;
272 class ImageSet : public Item
275 ImageSet (void) : Item(TYPE_IMAGESET) {}
279 std::string description;
283 class ShaderSource : public Item
286 ShaderSource (void) : Item(TYPE_SHADERSOURCE) {}
287 ~ShaderSource (void) {}
292 class InfoLog : public Item
295 InfoLog (void) : Item(TYPE_INFOLOG) {}
301 class Shader : public Item
306 SHADERTYPE_VERTEX = 0,
309 SHADERTYPE_TESS_CONTROL,
310 SHADERTYPE_TESS_EVALUATION,
316 Shader (void) : Item(TYPE_SHADER), shaderType(SHADERTYPE_LAST), compileStatus(false) {}
319 ShaderType shaderType;
325 class ShaderProgram : public Item
328 ShaderProgram (void) : Item(TYPE_SHADERPROGRAM), linkStatus(false) {}
329 ~ShaderProgram (void) {}
336 class EglConfig : public Item
349 bool bindToTextureRGB;
350 bool bindToTextureRGBA;
351 std::string colorBufferType;
352 std::string configCaveat;
354 std::string conformant;
358 int maxPBufferHeight;
359 int maxPBufferPixels;
362 bool nativeRenderable;
363 std::string renderableType;
367 std::string surfaceTypes;
368 std::string transparentType;
369 int transparentRedValue;
370 int transparentGreenValue;
371 int transparentBlueValue;
374 inline EglConfig::EglConfig (void)
375 : Item (TYPE_EGLCONFIG)
383 , bindToTextureRGB (false)
384 , bindToTextureRGBA (false)
388 , maxPBufferWidth (0)
389 , maxPBufferHeight (0)
390 , maxPBufferPixels (0)
391 , maxSwapInterval (0)
392 , minSwapInterval (0)
393 , nativeRenderable (false)
397 , transparentRedValue (0)
398 , transparentGreenValue (0)
399 , transparentBlueValue (0)
403 class EglConfigSet : public Item
406 EglConfigSet (void) : Item(TYPE_EGLCONFIGSET) {}
407 ~EglConfigSet (void) {}
410 std::string description;
414 class Section : public Item
417 Section (void) : Item(TYPE_SECTION) {}
421 std::string description;
425 class KernelSource : public Item
428 KernelSource (void) : Item(TYPE_KERNELSOURCE) {}
429 ~KernelSource (void) {}
434 class CompileInfo : public Item
437 CompileInfo (void) : Item(TYPE_COMPILEINFO), compileStatus(false) {}
438 ~CompileInfo (void) {}
441 std::string description;
446 class ValueInfo : public Item
457 ValueInfo (void) : Item(TYPE_VALUEINFO), tag(VALUETAG_LAST) {}
461 std::string description;
466 class SampleInfo : public Item
469 SampleInfo (void) : Item(TYPE_SAMPLEINFO) {}
470 ~SampleInfo (void) {}
475 class SampleValue : public Item
478 SampleValue (void) : Item(TYPE_SAMPLEVALUE) {}
479 ~SampleValue (void) {}
484 class Sample : public Item
487 Sample (void) : Item(TYPE_SAMPLE) {}
493 class SampleList : public Item
496 SampleList (void) : Item(TYPE_SAMPLELIST) {}
497 ~SampleList (void) {}
500 std::string description;
501 SampleInfo sampleInfo;
508 #endif // _XETESTCASERESULT_HPP