From 98697cdf733d4118704333e92b1cc36e6fcf1750 Mon Sep 17 00:00:00 2001 From: Piotr Byszewski Date: Wed, 21 Jun 2017 09:52:12 +0200 Subject: [PATCH] Move context flags tests to custom context package Previously context flags tests were only executed for ES32. In this change they were moved to common folder and are executed from package that has no default context. Components: OpenGL VK-GL-CTS issue: 351 Affects: KHR-NoContext.*.context_flags.* Change-Id: Ib68cc85e8c3188ca4bfcb15046da85c9d00b55e7 --- .../4.5.5.x/noctx-khr-master.txt | 4 ++ .../3.2.3.x/src/gles32-khr-master.txt | 4 -- .../3.2.3.x/src/gles32-khr-test-issues.txt | 1 - .../3.2.4.x/src/gles32-khr-test-issues.txt | 1 - .../khronos_mustpass/master/gles32-khr-master.txt | 4 -- .../3.2.4.x/noctx-khr-master.txt | 4 ++ .../master/noctx-khr-master.txt | 4 ++ external/openglcts/modules/common/CMakeLists.txt | 2 + .../glcContextFlagsTests.cpp} | 75 +++++++++++----------- .../glcContextFlagsTests.hpp} | 17 +++-- .../modules/common/glcNoDefaultContextPackage.cpp | 3 + external/openglcts/modules/gles32/CMakeLists.txt | 2 - .../openglcts/modules/gles32/es32cTestPackage.cpp | 4 -- 13 files changed, 63 insertions(+), 62 deletions(-) rename external/openglcts/modules/{gles32/es32cContextFlagsTests.cpp => common/glcContextFlagsTests.cpp} (58%) rename external/openglcts/modules/{gles32/es32cContextFlagsTests.hpp => common/glcContextFlagsTests.hpp} (77%) diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.5.5.x/noctx-khr-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.5.5.x/noctx-khr-master.txt index 8cde4a6..f86fed4 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.5.5.x/noctx-khr-master.txt +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.5.5.x/noctx-khr-master.txt @@ -3,3 +3,7 @@ KHR-NoContext.gl45.robustness.no_reset_notification KHR-NoContext.gl45.robustness.lose_context_on_reset KHR-NoContext.gl45.robustness.getnuniform KHR-NoContext.gl45.robustness.readnpixels +KHR-NoContext.gl45.context_flags.no_flags_set_case +KHR-NoContext.gl45.context_flags.debug_flag_set_case +KHR-NoContext.gl45.context_flags.robust_flag_set_case +KHR-NoContext.gl45.context_flags.all_flags_set_case diff --git a/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.3.x/src/gles32-khr-master.txt b/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.3.x/src/gles32-khr-master.txt index 77c9209..b5c8cee 100644 --- a/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.3.x/src/gles32-khr-master.txt +++ b/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.3.x/src/gles32-khr-master.txt @@ -303,10 +303,6 @@ KHR-GLES32.core.draw_buffers_indexed.set_get KHR-GLES32.core.draw_buffers_indexed.color_masks KHR-GLES32.core.draw_buffers_indexed.blending KHR-GLES32.core.draw_buffers_indexed.negative -KHR-GLES32.context_flags.context_flags.noFlagsSetCase -KHR-GLES32.context_flags.context_flags.debugFlagSetCase -KHR-GLES32.context_flags.context_flags.robustFlagSetCase -KHR-GLES32.context_flags.context_flags.allFlagsSetCase KHR-GLES32.robust.robust_buffer_access_behavior.vertex_buffer_objects KHR-GLES32.robust.robust_buffer_access_behavior.texel_fetch KHR-GLES32.robust.robust_buffer_access_behavior.image_load_store diff --git a/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.3.x/src/gles32-khr-test-issues.txt b/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.3.x/src/gles32-khr-test-issues.txt index be2c940..d782714 100644 --- a/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.3.x/src/gles32-khr-test-issues.txt +++ b/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.3.x/src/gles32-khr-test-issues.txt @@ -1,3 +1,2 @@ #VK-GL-CTS 354 -KHR-GLES32.context_flags.* KHR-GLES32.robust.* diff --git a/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.4.x/src/gles32-khr-test-issues.txt b/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.4.x/src/gles32-khr-test-issues.txt index 9f7b69a..94f2215 100644 --- a/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.4.x/src/gles32-khr-test-issues.txt +++ b/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.4.x/src/gles32-khr-test-issues.txt @@ -1,3 +1,2 @@ #VK-GL-CTS 354i -KHR-GLES32.context_flags.* KHR-GLES32.robust.* diff --git a/external/openglcts/data/mustpass/gles/khronos_mustpass/master/gles32-khr-master.txt b/external/openglcts/data/mustpass/gles/khronos_mustpass/master/gles32-khr-master.txt index f1041b5..01dd2e5 100644 --- a/external/openglcts/data/mustpass/gles/khronos_mustpass/master/gles32-khr-master.txt +++ b/external/openglcts/data/mustpass/gles/khronos_mustpass/master/gles32-khr-master.txt @@ -304,10 +304,6 @@ KHR-GLES32.core.draw_buffers_indexed.set_get KHR-GLES32.core.draw_buffers_indexed.color_masks KHR-GLES32.core.draw_buffers_indexed.blending KHR-GLES32.core.draw_buffers_indexed.negative -KHR-GLES32.context_flags.context_flags.noFlagsSetCase -KHR-GLES32.context_flags.context_flags.debugFlagSetCase -KHR-GLES32.context_flags.context_flags.robustFlagSetCase -KHR-GLES32.context_flags.context_flags.allFlagsSetCase KHR-GLES32.robust.robust_buffer_access_behavior.vertex_buffer_objects KHR-GLES32.robust.robust_buffer_access_behavior.texel_fetch KHR-GLES32.robust.robust_buffer_access_behavior.image_load_store diff --git a/external/openglcts/data/mustpass/gles/khronos_mustpass_noctx/3.2.4.x/noctx-khr-master.txt b/external/openglcts/data/mustpass/gles/khronos_mustpass_noctx/3.2.4.x/noctx-khr-master.txt index 4872b1f..317a0a0 100644 --- a/external/openglcts/data/mustpass/gles/khronos_mustpass_noctx/3.2.4.x/noctx-khr-master.txt +++ b/external/openglcts/data/mustpass/gles/khronos_mustpass_noctx/3.2.4.x/noctx-khr-master.txt @@ -3,3 +3,7 @@ KHR-NoContext.es32.robustness.no_reset_notification KHR-NoContext.es32.robustness.lose_context_on_reset KHR-NoContext.es32.robustness.getnuniform KHR-NoContext.es32.robustness.readnpixels +KHR-NoContext.es32.context_flags.no_flags_set_case +KHR-NoContext.es32.context_flags.debug_flag_set_case +KHR-NoContext.es32.context_flags.robust_flag_set_case +KHR-NoContext.es32.context_flags.all_flags_set_case diff --git a/external/openglcts/data/mustpass/gles/khronos_mustpass_noctx/master/noctx-khr-master.txt b/external/openglcts/data/mustpass/gles/khronos_mustpass_noctx/master/noctx-khr-master.txt index 4872b1f..317a0a0 100644 --- a/external/openglcts/data/mustpass/gles/khronos_mustpass_noctx/master/noctx-khr-master.txt +++ b/external/openglcts/data/mustpass/gles/khronos_mustpass_noctx/master/noctx-khr-master.txt @@ -3,3 +3,7 @@ KHR-NoContext.es32.robustness.no_reset_notification KHR-NoContext.es32.robustness.lose_context_on_reset KHR-NoContext.es32.robustness.getnuniform KHR-NoContext.es32.robustness.readnpixels +KHR-NoContext.es32.context_flags.no_flags_set_case +KHR-NoContext.es32.context_flags.debug_flag_set_case +KHR-NoContext.es32.context_flags.robust_flag_set_case +KHR-NoContext.es32.context_flags.all_flags_set_case diff --git a/external/openglcts/modules/common/CMakeLists.txt b/external/openglcts/modules/common/CMakeLists.txt index a5d55cf..f269a1f 100644 --- a/external/openglcts/modules/common/CMakeLists.txt +++ b/external/openglcts/modules/common/CMakeLists.txt @@ -20,6 +20,8 @@ set(GLCTS_COMMON_SRCS glcConfigPackage.hpp glcContext.cpp glcContext.hpp + glcContextFlagsTests.cpp + glcContextFlagsTests.hpp glcExposedExtensionsTests.cpp glcExposedExtensionsTests.hpp glcFragDepthTests.cpp diff --git a/external/openglcts/modules/gles32/es32cContextFlagsTests.cpp b/external/openglcts/modules/common/glcContextFlagsTests.cpp similarity index 58% rename from external/openglcts/modules/gles32/es32cContextFlagsTests.cpp rename to external/openglcts/modules/common/glcContextFlagsTests.cpp index 43e02f2..9810090 100644 --- a/external/openglcts/modules/gles32/es32cContextFlagsTests.cpp +++ b/external/openglcts/modules/common/glcContextFlagsTests.cpp @@ -2,7 +2,7 @@ * OpenGL Conformance Test Suite * ----------------------------- * - * Copyright (c) 2016 The Khronos Group Inc. + * Copyright (c) 2017 The Khronos Group Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,62 +17,58 @@ * limitations under the License. * */ /*! - * \file - * \brief + * \file glcContextFlagsTests.cpp + * \brief Tests veryfing glGetIntegerv(GL_CONTEXT_FLAGS). */ /*-------------------------------------------------------------------*/ -#include "es32cContextFlagsTests.hpp" +#include "glcContextFlagsTests.hpp" #include "gluRenderContext.hpp" #include "glwEnums.hpp" #include "glwFunctions.hpp" #include "tcuCommandLine.hpp" #include "tcuTestLog.hpp" -namespace es32cts +namespace glcts { -class ContextFlagsCase : public deqp::TestCase +class ContextFlagsCase : public tcu::TestCase { private: glu::RenderContext* m_caseContext; glu::ContextFlags m_passedFlags; glw::GLint m_expectedResult; + glu::ApiType m_ApiType; + + void createContext(); public: - ContextFlagsCase(deqp::Context& context, glu::ContextFlags passedFlags, glw::GLint expectedResult, const char* name, - const char* description) - : deqp::TestCase(context, name, description) + ContextFlagsCase(tcu::TestContext& testCtx, glu::ContextFlags passedFlags, glw::GLint expectedResult, + const char* name, const char* description, glu::ApiType apiType) + : tcu::TestCase(testCtx, name, description) , m_caseContext(NULL) , m_passedFlags(passedFlags) , m_expectedResult(expectedResult) + , m_ApiType(apiType) { } - void createContextWithFlags(glu::ContextFlags ctxFlags); void releaseContext(void); virtual void deinit(void); virtual IterateResult iterate(void); }; -void ContextFlagsCase::createContextWithFlags(glu::ContextFlags ctxFlags) +void ContextFlagsCase::createContext() { - glu::RenderConfig renderCfg(glu::ContextType(m_context.getRenderContext().getType().getAPI(), ctxFlags)); + glu::RenderConfig renderCfg(glu::ContextType(m_ApiType, m_passedFlags)); - const tcu::CommandLine& commandLine = m_context.getTestContext().getCommandLine(); + const tcu::CommandLine& commandLine = m_testCtx.getCommandLine(); glu::parseRenderConfig(&renderCfg, commandLine); - if (commandLine.getSurfaceType() == tcu::SURFACETYPE_WINDOW) - { - renderCfg.surfaceType = glu::RenderConfig::SURFACETYPE_OFFSCREEN_GENERIC; - } - else - { + if (commandLine.getSurfaceType() != tcu::SURFACETYPE_WINDOW) throw tcu::NotSupportedError("Test not supported in non-windowed context"); - } m_caseContext = glu::createRenderContext(m_testCtx.getPlatform(), commandLine, renderCfg); - m_caseContext->makeCurrent(); } void ContextFlagsCase::releaseContext(void) @@ -81,7 +77,6 @@ void ContextFlagsCase::releaseContext(void) { delete m_caseContext; m_caseContext = NULL; - m_context.getRenderContext().makeCurrent(); } } @@ -92,10 +87,9 @@ void ContextFlagsCase::deinit(void) tcu::TestNode::IterateResult ContextFlagsCase::iterate(void) { - glw::GLint flags = 0; - - createContextWithFlags(m_passedFlags); + createContext(); + glw::GLint flags = 0; const glw::Functions& gl = m_caseContext->getFunctions(); gl.getIntegerv(GL_CONTEXT_FLAGS, &flags); GLU_EXPECT_NO_ERROR(gl.getError(), "glGetIntegerv"); @@ -114,33 +108,36 @@ tcu::TestNode::IterateResult ContextFlagsCase::iterate(void) return STOP; } -ContextFlagsTests::ContextFlagsTests(deqp::Context& context) - : TestCaseGroup(context, "context_flags", "Verifies if context flags query results are as expected.") +ContextFlagsTests::ContextFlagsTests(tcu::TestContext& testCtx, glu::ApiType apiType) + : tcu::TestCaseGroup(testCtx, "context_flags", "Verifies if context flags query results are as expected.") + , m_ApiType(apiType) { } void ContextFlagsTests::init() { - deqp::TestCaseGroup::init(); + tcu::TestCaseGroup::init(); try { - addChild(new ContextFlagsCase(m_context, glu::ContextFlags(0), 0, "noFlagsSetCase", "Verifies no flags case.")); - addChild(new ContextFlagsCase(m_context, glu::CONTEXT_DEBUG, GL_CONTEXT_FLAG_DEBUG_BIT, "debugFlagSetCase", - "Verifies debug flag case..")); - addChild(new ContextFlagsCase(m_context, glu::CONTEXT_ROBUST, GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT, - "robustFlagSetCase", "Verifies robust access flag case.")); - - addChild(new ContextFlagsCase(m_context, glu::CONTEXT_DEBUG | glu::CONTEXT_ROBUST, - GL_CONTEXT_FLAG_DEBUG_BIT | GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT, "allFlagsSetCase", - "Verifies both debug and robust access flags case.")); + addChild(new ContextFlagsCase(m_testCtx, glu::ContextFlags(0), 0, "no_flags_set_case", + "Verifies no flags case.", m_ApiType)); + addChild(new ContextFlagsCase(m_testCtx, glu::CONTEXT_DEBUG, GL_CONTEXT_FLAG_DEBUG_BIT, "debug_flag_set_case", + "Verifies debug flag case..", m_ApiType)); + addChild(new ContextFlagsCase(m_testCtx, glu::CONTEXT_ROBUST, GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT, + "robust_flag_set_case", "Verifies robust access flag case.", m_ApiType)); + + addChild(new ContextFlagsCase(m_testCtx, glu::CONTEXT_DEBUG | glu::CONTEXT_ROBUST, + GL_CONTEXT_FLAG_DEBUG_BIT | GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT, + "all_flags_set_case", "Verifies both debug and robust access flags case.", + m_ApiType)); } catch (...) { // Destroy context. - deqp::TestCaseGroup::deinit(); + tcu::TestCaseGroup::deinit(); throw; } } -} // es32cts namespace +} // glcts namespace diff --git a/external/openglcts/modules/gles32/es32cContextFlagsTests.hpp b/external/openglcts/modules/common/glcContextFlagsTests.hpp similarity index 77% rename from external/openglcts/modules/gles32/es32cContextFlagsTests.hpp rename to external/openglcts/modules/common/glcContextFlagsTests.hpp index 97eb513..43efc57 100644 --- a/external/openglcts/modules/gles32/es32cContextFlagsTests.hpp +++ b/external/openglcts/modules/common/glcContextFlagsTests.hpp @@ -1,10 +1,10 @@ -#ifndef _ES32CCONTEXTFLAGSTESTS_HPP -#define _ES32CCONTEXTFLAGSTESTS_HPP +#ifndef _GLCCONTEXTFLAGSTESTS_HPP +#define _GLCCONTEXTFLAGSTESTS_HPP /*------------------------------------------------------------------------- * OpenGL Conformance Test Suite * ----------------------------- * - * Copyright (c) 2016 The Khronos Group Inc. + * Copyright (c) 2017 The Khronos Group Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,20 +32,23 @@ #include "glcTestCase.hpp" #include "glcTestPackage.hpp" -namespace es32cts +namespace glcts { -class ContextFlagsTests : public deqp::TestCaseGroup +class ContextFlagsTests : public tcu::TestCaseGroup { public: - ContextFlagsTests(deqp::Context& context); + ContextFlagsTests(tcu::TestContext& testCtx, glu::ApiType apiType); virtual void init(void); private: ContextFlagsTests(const ContextFlagsTests& other); ContextFlagsTests& operator=(const ContextFlagsTests& other); + + /* Private members */ + glu::ApiType m_ApiType; }; } -#endif // _ES32CCONTEXTFLAGSTESTS_HPP +#endif // _GLCCONTEXTFLAGSTESTS_HPP diff --git a/external/openglcts/modules/common/glcNoDefaultContextPackage.cpp b/external/openglcts/modules/common/glcNoDefaultContextPackage.cpp index a16de07..0fc4d53 100644 --- a/external/openglcts/modules/common/glcNoDefaultContextPackage.cpp +++ b/external/openglcts/modules/common/glcNoDefaultContextPackage.cpp @@ -22,6 +22,7 @@ */ /*-------------------------------------------------------------------*/ #include "glcNoDefaultContextPackage.hpp" +#include "glcContextFlagsTests.hpp" #include "glcNoErrorTests.hpp" #include "glcRobustnessTests.hpp" #include "gluRenderContext.hpp" @@ -89,6 +90,7 @@ void NoDefaultContextPackage::init(void) tcu::TestCaseGroup* gl45Group = new tcu::TestCaseGroup(getTestContext(), "gl45", ""); gl45Group->addChild(new glcts::RobustnessTests(getTestContext(), glu::ApiType::core(4, 5))); + gl45Group->addChild(new glcts::ContextFlagsTests(getTestContext(), glu::ApiType::core(4, 5))); addChild(gl45Group); tcu::TestCaseGroup* es2Group = new tcu::TestCaseGroup(getTestContext(), "es2", ""); @@ -97,6 +99,7 @@ void NoDefaultContextPackage::init(void) tcu::TestCaseGroup* es32Group = new tcu::TestCaseGroup(getTestContext(), "es32", ""); es32Group->addChild(new glcts::RobustnessTests(getTestContext(), glu::ApiType::es(3, 2))); + es32Group->addChild(new glcts::ContextFlagsTests(getTestContext(), glu::ApiType::es(3, 2))); addChild(es32Group); } diff --git a/external/openglcts/modules/gles32/CMakeLists.txt b/external/openglcts/modules/gles32/CMakeLists.txt index a221931..c850f78 100644 --- a/external/openglcts/modules/gles32/CMakeLists.txt +++ b/external/openglcts/modules/gles32/CMakeLists.txt @@ -8,8 +8,6 @@ include_directories( set(GLCTS_ES32_SRCS es32cTestPackage.cpp es32cTestPackage.hpp - es32cContextFlagsTests.cpp - es32cContextFlagsTests.hpp es32cRobustBufferAccessBehaviorTests.cpp es32cRobustBufferAccessBehaviorTests.hpp ) diff --git a/external/openglcts/modules/gles32/es32cTestPackage.cpp b/external/openglcts/modules/gles32/es32cTestPackage.cpp index c8643d2..5621973 100644 --- a/external/openglcts/modules/gles32/es32cTestPackage.cpp +++ b/external/openglcts/modules/gles32/es32cTestPackage.cpp @@ -23,7 +23,6 @@ */ /*-------------------------------------------------------------------*/ #include "es32cTestPackage.hpp" -#include "es32cContextFlagsTests.hpp" #include "es32cRobustBufferAccessBehaviorTests.hpp" #include "esextcTestPackage.hpp" #include "glcFragDepthTests.hpp" @@ -156,9 +155,6 @@ void ES32TestPackage::init(void) coreGroup->addChild(new glcts::TextureBufferTests(getContext(), extParams)); coreGroup->addChild(new glcts::DrawBuffersIndexedTests(getContext(), extParams)); addChild(coreGroup); - tcu::TestCaseGroup* contextFlagsGroup = new tcu::TestCaseGroup(getTestContext(), "context_flags", ""); - contextFlagsGroup->addChild(new es32cts::ContextFlagsTests(getContext())); - addChild(contextFlagsGroup); tcu::TestCaseGroup* robustGroup = new tcu::TestCaseGroup(getTestContext(), "robust", ""); robustGroup->addChild(new es32cts::RobustBufferAccessBehaviorTests(getContext())); addChild(robustGroup); -- 2.7.4