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