1e5c31af7Sopenharmony_ci/*------------------------------------------------------------------------- 2e5c31af7Sopenharmony_ci * drawElements Internal Test Module 3e5c31af7Sopenharmony_ci * --------------------------------- 4e5c31af7Sopenharmony_ci * 5e5c31af7Sopenharmony_ci * Copyright 2014 The Android Open Source Project 6e5c31af7Sopenharmony_ci * 7e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 8e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License. 9e5c31af7Sopenharmony_ci * You may obtain a copy of the License at 10e5c31af7Sopenharmony_ci * 11e5c31af7Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 12e5c31af7Sopenharmony_ci * 13e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 14e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 15e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and 17e5c31af7Sopenharmony_ci * limitations under the License. 18e5c31af7Sopenharmony_ci * 19e5c31af7Sopenharmony_ci *//*! 20e5c31af7Sopenharmony_ci * \file 21e5c31af7Sopenharmony_ci * \brief Test log output tests. 22e5c31af7Sopenharmony_ci *//*--------------------------------------------------------------------*/ 23e5c31af7Sopenharmony_ci 24e5c31af7Sopenharmony_ci#include "ditTestLogTests.hpp" 25e5c31af7Sopenharmony_ci#include "tcuTestLog.hpp" 26e5c31af7Sopenharmony_ci 27e5c31af7Sopenharmony_ci#include <limits> 28e5c31af7Sopenharmony_ci 29e5c31af7Sopenharmony_cinamespace dit 30e5c31af7Sopenharmony_ci{ 31e5c31af7Sopenharmony_ci 32e5c31af7Sopenharmony_ciusing tcu::TestLog; 33e5c31af7Sopenharmony_ci 34e5c31af7Sopenharmony_ci// \todo [2014-02-25 pyry] Extend with: 35e5c31af7Sopenharmony_ci// - output of all element types 36e5c31af7Sopenharmony_ci// - nested element cases (sections, image sets) 37e5c31af7Sopenharmony_ci// - parse results and verify 38e5c31af7Sopenharmony_ci 39e5c31af7Sopenharmony_ciclass BasicSampleListCase : public tcu::TestCase 40e5c31af7Sopenharmony_ci{ 41e5c31af7Sopenharmony_cipublic: 42e5c31af7Sopenharmony_ci BasicSampleListCase (tcu::TestContext& testCtx) 43e5c31af7Sopenharmony_ci : TestCase(testCtx, "sample_list", "Basic sample list usage") 44e5c31af7Sopenharmony_ci { 45e5c31af7Sopenharmony_ci } 46e5c31af7Sopenharmony_ci 47e5c31af7Sopenharmony_ci IterateResult iterate (void) 48e5c31af7Sopenharmony_ci { 49e5c31af7Sopenharmony_ci TestLog& log = m_testCtx.getLog(); 50e5c31af7Sopenharmony_ci 51e5c31af7Sopenharmony_ci log << TestLog::SampleList("TestSamples", "Test Sample List") 52e5c31af7Sopenharmony_ci << TestLog::SampleInfo 53e5c31af7Sopenharmony_ci << TestLog::ValueInfo("NumDrawCalls", "Number of draw calls", "", QP_SAMPLE_VALUE_TAG_PREDICTOR) 54e5c31af7Sopenharmony_ci << TestLog::ValueInfo("NumOps", "Number of ops in shader", "op", QP_SAMPLE_VALUE_TAG_PREDICTOR) 55e5c31af7Sopenharmony_ci << TestLog::ValueInfo("RenderTime", "Rendering time", "ms", QP_SAMPLE_VALUE_TAG_RESPONSE) 56e5c31af7Sopenharmony_ci << TestLog::EndSampleInfo; 57e5c31af7Sopenharmony_ci 58e5c31af7Sopenharmony_ci log << TestLog::Sample << 1 << 2 << 2.3 << TestLog::EndSample 59e5c31af7Sopenharmony_ci << TestLog::Sample << 0 << 0 << 0 << TestLog::EndSample 60e5c31af7Sopenharmony_ci << TestLog::Sample << 421 << -23 << 0.00001 << TestLog::EndSample 61e5c31af7Sopenharmony_ci << TestLog::Sample << 2 << 9 << -1e9 << TestLog::EndSample 62e5c31af7Sopenharmony_ci << TestLog::Sample << std::numeric_limits<deInt64>::max() << std::numeric_limits<deInt64>::min() << -0.0f << TestLog::EndSample 63e5c31af7Sopenharmony_ci << TestLog::Sample << 0x3355 << 0xf24 << std::numeric_limits<double>::max() << TestLog::EndSample; 64e5c31af7Sopenharmony_ci 65e5c31af7Sopenharmony_ci log << TestLog::EndSampleList; 66e5c31af7Sopenharmony_ci 67e5c31af7Sopenharmony_ci m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass"); 68e5c31af7Sopenharmony_ci return STOP; 69e5c31af7Sopenharmony_ci } 70e5c31af7Sopenharmony_ci}; 71e5c31af7Sopenharmony_ci 72e5c31af7Sopenharmony_ciTestLogTests::TestLogTests (tcu::TestContext& testCtx) 73e5c31af7Sopenharmony_ci : TestCaseGroup(testCtx, "testlog", "Test Log Tests") 74e5c31af7Sopenharmony_ci{ 75e5c31af7Sopenharmony_ci} 76e5c31af7Sopenharmony_ci 77e5c31af7Sopenharmony_ciTestLogTests::~TestLogTests (void) 78e5c31af7Sopenharmony_ci{ 79e5c31af7Sopenharmony_ci} 80e5c31af7Sopenharmony_ci 81e5c31af7Sopenharmony_civoid TestLogTests::init (void) 82e5c31af7Sopenharmony_ci{ 83e5c31af7Sopenharmony_ci addChild(new BasicSampleListCase(m_testCtx)); 84e5c31af7Sopenharmony_ci} 85e5c31af7Sopenharmony_ci 86e5c31af7Sopenharmony_ci} // dit 87