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.
173 NumericValue (void) : m_type(TYPE_EMPTY) {}
174 NumericValue (deInt64 value) : m_type(TYPE_INT64) { m_value.int64 = value; }
175 NumericValue (double value) : m_type(TYPE_FLOAT64) { m_value.float64 = value; }
177 Type getType (void) const { return m_type; }
178 deInt64 getInt64 (void) const { DE_ASSERT(getType() == TYPE_INT64); return m_value.int64; }
179 double getFloat64 (void) const { DE_ASSERT(getType() == TYPE_FLOAT64); return m_value.float64; }
190 std::ostream& operator<< (std::ostream& str, const NumericValue& value);
196 virtual ~Item (void) {}
198 Type getType (void) const { return m_type; }
201 Item (Type type) : m_type(type) {}
204 Item (const Item& other);
205 Item& operator= (const Item& other);
210 class Result : public Item
213 Result (void) : Item(TYPE_RESULT), statusCode(TESTSTATUSCODE_LAST) {}
216 TestStatusCode statusCode;
220 class Text : public Item
223 Text (void) : Item(TYPE_TEXT) {}
229 class Number : public Item
232 Number (void) : Item(TYPE_NUMBER) {}
236 std::string description;
242 class Image : public Item
255 COMPRESSION_NONE = 0,
261 Image (void) : Item(TYPE_IMAGE), width(0), height(0), format(FORMAT_LAST), compression(COMPRESSION_LAST) {}
265 std::string description;
269 Compression compression;
270 std::vector<deUint8> data;
273 class ImageSet : public Item
276 ImageSet (void) : Item(TYPE_IMAGESET) {}
280 std::string description;
284 class ShaderSource : public Item
287 ShaderSource (void) : Item(TYPE_SHADERSOURCE) {}
288 ~ShaderSource (void) {}
293 class SpirVSource : public Item
296 SpirVSource (void) : Item(TYPE_SPIRVSOURCE) {}
297 ~SpirVSource (void) {}
302 class InfoLog : public Item
305 InfoLog (void) : Item(TYPE_INFOLOG) {}
311 class Shader : public Item
316 SHADERTYPE_VERTEX = 0,
319 SHADERTYPE_TESS_CONTROL,
320 SHADERTYPE_TESS_EVALUATION,
326 Shader (void) : Item(TYPE_SHADER), shaderType(SHADERTYPE_LAST), compileStatus(false) {}
329 ShaderType shaderType;
335 class ShaderProgram : public Item
338 ShaderProgram (void) : Item(TYPE_SHADERPROGRAM), linkStatus(false) {}
339 ~ShaderProgram (void) {}
346 class EglConfig : public Item
359 bool bindToTextureRGB;
360 bool bindToTextureRGBA;
361 std::string colorBufferType;
362 std::string configCaveat;
364 std::string conformant;
368 int maxPBufferHeight;
369 int maxPBufferPixels;
372 bool nativeRenderable;
373 std::string renderableType;
377 std::string surfaceTypes;
378 std::string transparentType;
379 int transparentRedValue;
380 int transparentGreenValue;
381 int transparentBlueValue;
384 inline EglConfig::EglConfig (void)
385 : Item (TYPE_EGLCONFIG)
393 , bindToTextureRGB (false)
394 , bindToTextureRGBA (false)
398 , maxPBufferWidth (0)
399 , maxPBufferHeight (0)
400 , maxPBufferPixels (0)
401 , maxSwapInterval (0)
402 , minSwapInterval (0)
403 , nativeRenderable (false)
407 , transparentRedValue (0)
408 , transparentGreenValue (0)
409 , transparentBlueValue (0)
413 class EglConfigSet : public Item
416 EglConfigSet (void) : Item(TYPE_EGLCONFIGSET) {}
417 ~EglConfigSet (void) {}
420 std::string description;
424 class Section : public Item
427 Section (void) : Item(TYPE_SECTION) {}
431 std::string description;
435 class KernelSource : public Item
438 KernelSource (void) : Item(TYPE_KERNELSOURCE) {}
439 ~KernelSource (void) {}
444 class CompileInfo : public Item
447 CompileInfo (void) : Item(TYPE_COMPILEINFO), compileStatus(false) {}
448 ~CompileInfo (void) {}
451 std::string description;
456 class ValueInfo : public Item
467 ValueInfo (void) : Item(TYPE_VALUEINFO), tag(VALUETAG_LAST) {}
471 std::string description;
476 class SampleInfo : public Item
479 SampleInfo (void) : Item(TYPE_SAMPLEINFO) {}
480 ~SampleInfo (void) {}
485 class SampleValue : public Item
488 SampleValue (void) : Item(TYPE_SAMPLEVALUE) {}
489 ~SampleValue (void) {}
494 class Sample : public Item
497 Sample (void) : Item(TYPE_SAMPLE) {}
503 class SampleList : public Item
506 SampleList (void) : Item(TYPE_SAMPLELIST) {}
507 ~SampleList (void) {}
510 std::string description;
511 SampleInfo sampleInfo;
518 #endif // _XETESTCASERESULT_HPP