Move khr_debug tests to NoContext

As implemented, the KHR-GL4*.khr_debug.* tests can terminate the EGL
display used by other tests. As recommended, move these tests to the
KHR-NoContext.* group.

Since the test names are already changing, fix the spelling of
'receiving' in one test case.

Components: OpenGL

VK-GL-CTS Issue: 1062

Renamed tests:
KHR-GL4*.khr_debug.* -> KHR-NoContext.gl43.khr_debug.*

Change-Id: I766131f77206cad1cb34955426a81cf10b50e159
diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl43-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl43-master.txt
index 6cc5ba8..43d6968 100644
--- a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl43-master.txt
+++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl43-master.txt
@@ -3683,13 +3683,6 @@
 KHR-GL43.copy_image.invalid_alignment
 KHR-GL43.draw_indirect_43.advanced-twoPass-Compute-arrays
 KHR-GL43.draw_indirect_43.advanced-twoPass-Compute-elements
-KHR-GL43.khr_debug.api_errors_non_debug
-KHR-GL43.khr_debug.labels_non_debug
-KHR-GL43.khr_debug.receiveing_messages
-KHR-GL43.khr_debug.groups
-KHR-GL43.khr_debug.api_errors_debug
-KHR-GL43.khr_debug.labels_debug
-KHR-GL43.khr_debug.synchronous_calls
 KHR-GL43.program_interface_query.empty-shaders
 KHR-GL43.program_interface_query.simple-shaders
 KHR-GL43.program_interface_query.input-types
diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl44-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl44-master.txt
index 4d096da..3d6c095 100644
--- a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl44-master.txt
+++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl44-master.txt
@@ -3683,13 +3683,6 @@
 KHR-GL44.copy_image.invalid_alignment
 KHR-GL44.draw_indirect_43.advanced-twoPass-Compute-arrays
 KHR-GL44.draw_indirect_43.advanced-twoPass-Compute-elements
-KHR-GL44.khr_debug.api_errors_non_debug
-KHR-GL44.khr_debug.labels_non_debug
-KHR-GL44.khr_debug.receiveing_messages
-KHR-GL44.khr_debug.groups
-KHR-GL44.khr_debug.api_errors_debug
-KHR-GL44.khr_debug.labels_debug
-KHR-GL44.khr_debug.synchronous_calls
 KHR-GL44.program_interface_query.empty-shaders
 KHR-GL44.program_interface_query.simple-shaders
 KHR-GL44.program_interface_query.input-types
diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl45-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl45-master.txt
index d5068a6..3d9bb6b 100644
--- a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl45-master.txt
+++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl45-master.txt
@@ -3684,13 +3684,6 @@
 KHR-GL45.copy_image.invalid_alignment
 KHR-GL45.draw_indirect_43.advanced-twoPass-Compute-arrays
 KHR-GL45.draw_indirect_43.advanced-twoPass-Compute-elements
-KHR-GL45.khr_debug.api_errors_non_debug
-KHR-GL45.khr_debug.labels_non_debug
-KHR-GL45.khr_debug.receiveing_messages
-KHR-GL45.khr_debug.groups
-KHR-GL45.khr_debug.api_errors_debug
-KHR-GL45.khr_debug.labels_debug
-KHR-GL45.khr_debug.synchronous_calls
 KHR-GL45.program_interface_query.empty-shaders
 KHR-GL45.program_interface_query.simple-shaders
 KHR-GL45.program_interface_query.input-types
diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl46-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl46-master.txt
index df4aff7..1a25461 100644
--- a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl46-master.txt
+++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl46-master.txt
@@ -3684,13 +3684,6 @@
 KHR-GL46.copy_image.invalid_alignment
 KHR-GL46.draw_indirect_43.advanced-twoPass-Compute-arrays
 KHR-GL46.draw_indirect_43.advanced-twoPass-Compute-elements
-KHR-GL46.khr_debug.api_errors_non_debug
-KHR-GL46.khr_debug.labels_non_debug
-KHR-GL46.khr_debug.receiveing_messages
-KHR-GL46.khr_debug.groups
-KHR-GL46.khr_debug.api_errors_debug
-KHR-GL46.khr_debug.labels_debug
-KHR-GL46.khr_debug.synchronous_calls
 KHR-GL46.program_interface_query.empty-shaders
 KHR-GL46.program_interface_query.simple-shaders
 KHR-GL46.program_interface_query.input-types
diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/gl43-khr-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/gl43-khr-master.txt
new file mode 100644
index 0000000..16ec445
--- /dev/null
+++ b/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/gl43-khr-master.txt
@@ -0,0 +1,7 @@
+KHR-NoContext.gl43.khr_debug.api_errors_non_debug
+KHR-NoContext.gl43.khr_debug.labels_non_debug
+KHR-NoContext.gl43.khr_debug.receiving_messages
+KHR-NoContext.gl43.khr_debug.groups
+KHR-NoContext.gl43.khr_debug.api_errors_debug
+KHR-NoContext.gl43.khr_debug.labels_debug
+KHR-NoContext.gl43.khr_debug.synchronous_calls
diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/mustpass.xml b/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/mustpass.xml
index 584e263..2030340 100644
--- a/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/mustpass.xml
+++ b/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/mustpass.xml
@@ -20,6 +20,7 @@
 	<TestPackage name="Khronos Mustpass GL NoContext">
 		<Configuration caseListFile="gl30-khr-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="khr-master" os="any" useForFirstEGLConfig="True"/>
 		<Configuration caseListFile="gl40-khr-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="khr-master" os="any" useForFirstEGLConfig="True"/>
+		<Configuration caseListFile="gl43-khr-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="khr-master" os="any" useForFirstEGLConfig="True"/>
 		<Configuration caseListFile="gl45-khr-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="khr-master" os="any" useForFirstEGLConfig="True"/>
 	</TestPackage>
 </Mustpass>
diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/src/gl43-khr-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/src/gl43-khr-master.txt
new file mode 100644
index 0000000..c9c40fc
--- /dev/null
+++ b/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/src/gl43-khr-master.txt
@@ -0,0 +1 @@
+KHR-NoContext.gl43.*
diff --git a/external/openglcts/modules/common/CMakeLists.txt b/external/openglcts/modules/common/CMakeLists.txt
index 41e4b3f..787364b 100644
--- a/external/openglcts/modules/common/CMakeLists.txt
+++ b/external/openglcts/modules/common/CMakeLists.txt
@@ -32,6 +32,8 @@
 	glcFragDepthTests.hpp
 	glcInfoTests.cpp
 	glcInfoTests.hpp
+	glcKHRDebugTests.cpp
+	glcKHRDebugTests.hpp
 	glcMultipleContextsTests.cpp
 	glcMultipleContextsTests.hpp
 	glcNoErrorTests.cpp
diff --git a/external/openglcts/modules/gl/gl4cKHRDebugTests.cpp b/external/openglcts/modules/common/glcKHRDebugTests.cpp
similarity index 93%
rename from external/openglcts/modules/gl/gl4cKHRDebugTests.cpp
rename to external/openglcts/modules/common/glcKHRDebugTests.cpp
index 5f7b3ff..aff4e00 100644
--- a/external/openglcts/modules/gl/gl4cKHRDebugTests.cpp
+++ b/external/openglcts/modules/common/glcKHRDebugTests.cpp
@@ -2,7 +2,7 @@
  * OpenGL Conformance Test Suite
  * -----------------------------
  *
- * Copyright (c) 2015-2016 The Khronos Group Inc.
+ * Copyright (c) 2015-2018 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.
@@ -22,11 +22,11 @@
  */ /*-------------------------------------------------------------------*/
 
 /**
- * \file  gl4cKHRDebugTests.cpp
+ * \file  glcKHRDebugTests.cpp
  * \brief Implements conformance tests for "KHR Debug" functionality.
  */ /*-------------------------------------------------------------------*/
 
-#include "gl4cKHRDebugTests.hpp"
+#include "glcKHRDebugTests.hpp"
 
 #include "gluPlatform.hpp"
 #include "gluRenderConfig.hpp"
@@ -47,7 +47,7 @@
 
 using namespace glw;
 
-namespace gl4cts
+namespace glcts
 {
 namespace KHRDebug
 {
@@ -62,7 +62,7 @@
                                                                                                         \
 		if (expected_error != generated_error)                                                          \
 		{                                                                                               \
-			m_context.getTestContext().getLog()                                                         \
+			m_testCtx.getLog()                                                                          \
 				<< tcu::TestLog::Message << "File: " << __FILE__ << ", line: " << __LINE__              \
 				<< ". Got wrong error: " << glu::getErrorStr(generated_error)                           \
 				<< ", expected: " << glu::getErrorStr(expected_error) << ", message: " << error_message \
@@ -142,11 +142,11 @@
 /** Constructor
  * Creates and set as current new context that should be used by test.
  *
- * @param context  Test context
+ * @param testCtx  Test context
  * @param is_debug Selects if debug or non-debug context should be created
  **/
-TestBase::TestBase(deqp::Context& context, bool is_debug)
-	: m_gl(0), m_is_debug(is_debug), m_rc(0), m_test_base_context(context), m_orig_rc(0)
+TestBase::TestBase(tcu::TestContext& testContext, glu::ApiType apiType, bool is_debug)
+	: m_gl(0), m_is_debug(is_debug), m_rc(0), m_testContext(testContext), m_apiType(apiType)
 {
 	/* Nothing to be done here */
 }
@@ -175,9 +175,6 @@
 		initNonDebug();
 	}
 
-	m_orig_rc = &m_test_base_context.getRenderContext();
-	m_test_base_context.setRenderContext(m_rc);
-
 	/* Get functions */
 	m_gl = &m_rc->getFunctions();
 }
@@ -186,11 +183,10 @@
  **/
 void TestBase::initDebug()
 {
-	tcu::Platform&	platform = m_test_base_context.getTestContext().getPlatform();
-	glu::RenderConfig renderCfg(
-		glu::ContextType(m_test_base_context.getRenderContext().getType().getAPI(), glu::CONTEXT_DEBUG));
+	tcu::Platform&	platform = m_testContext.getPlatform();
+	glu::RenderConfig renderCfg(glu::ContextType(m_apiType, glu::CONTEXT_DEBUG));
 
-	const tcu::CommandLine& commandLine = m_test_base_context.getTestContext().getCommandLine();
+	const tcu::CommandLine& commandLine = m_testContext.getCommandLine();
 	parseRenderConfig(&renderCfg, commandLine);
 
 	if (commandLine.getSurfaceType() != tcu::SURFACETYPE_WINDOW)
@@ -204,11 +200,10 @@
  **/
 void TestBase::initNonDebug()
 {
-	tcu::Platform&	platform = m_test_base_context.getTestContext().getPlatform();
-	glu::RenderConfig renderCfg(
-		glu::ContextType(m_test_base_context.getRenderContext().getType().getAPI(), glu::ContextFlags(0)));
+	tcu::Platform&	platform = m_testContext.getPlatform();
+	glu::RenderConfig renderCfg(glu::ContextType(m_apiType, glu::ContextFlags(0)));
 
-	const tcu::CommandLine& commandLine = m_test_base_context.getTestContext().getCommandLine();
+	const tcu::CommandLine& commandLine = m_testContext.getCommandLine();
 	parseRenderConfig(&renderCfg, commandLine);
 
 	if (commandLine.getSurfaceType() != tcu::SURFACETYPE_WINDOW)
@@ -222,26 +217,21 @@
  **/
 void TestBase::done()
 {
-	/* Delete context used by test */
-	m_test_base_context.setRenderContext(m_orig_rc);
-
+	/* Delete context used by test and make no context current */
 	delete m_rc;
 
-	/* Switch back to original context */
-	m_test_base_context.getRenderContext().makeCurrent();
-
 	m_rc = 0;
 	m_gl = 0;
 }
 
 /** Constructor
  *
- * @param context  Test context
+ * @param testCtx  Test context
  * @param is_debug Selects if debug or non-debug context should be used
  * @param name     Name of test
  **/
-APIErrorsTest::APIErrorsTest(deqp::Context& context, bool is_debug, const GLchar* name)
-	: TestCase(context, name, "Verifies that errors are generated as expected"), TestBase(context, is_debug)
+APIErrorsTest::APIErrorsTest(tcu::TestContext& testCtx, glu::ApiType apiType, bool is_debug, const GLchar* name)
+	: TestBase(testCtx, apiType, is_debug), TestCase(testCtx, name, "Verifies that errors are generated as expected")
 {
 	/* Nothing to be done */
 }
@@ -655,7 +645,7 @@
 	}
 
 	/* Set result */
-	m_context.getTestContext().setTestResult(QP_TEST_RESULT_PASS, "Pass");
+	m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
 
 	/* Done */
 	TestBase::done();
@@ -665,12 +655,12 @@
 
 /** Constructor
  *
- * @param context  Test context
+ * @param testCtx  Test context
  * @param is_debug Selects if debug or non-debug context should be used
  * @param name     Name of test
  **/
-LabelsTest::LabelsTest(deqp::Context& context, bool is_debug, const GLchar* name)
-	: TestCase(context, name, "Verifies that labels can be assigned and queried"), TestBase(context, is_debug)
+LabelsTest::LabelsTest(tcu::TestContext& testCtx, glu::ApiType apiType, bool is_debug, const GLchar* name)
+	: TestCase(testCtx, name, "Verifies that labels can be assigned and queried"), TestBase(testCtx, apiType, is_debug)
 {
 	/* Nothing to be done */
 }
@@ -864,7 +854,7 @@
 		{
 			test_case.m_destroy(m_gl, id);
 
-			m_context.getTestContext().getLog()
+			m_testCtx.getLog()
 				<< tcu::TestLog::Message << "Error during test case: " << test_case.m_name << tcu::TestLog::EndMessage;
 
 			TCU_FAIL(exc.what());
@@ -874,7 +864,7 @@
 	}
 
 	/* Set result */
-	m_context.getTestContext().setTestResult(QP_TEST_RESULT_PASS, "Pass");
+	m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
 
 	/* Done */
 	TestBase::done();
@@ -1261,13 +1251,13 @@
 
 /** Constructor
  *
- * @param context  Test context
+ * @param testCtx  Test context
  * @param is_debug Selects if debug or non-debug context should be used
  * @param name     Name of test
  **/
-ReceiveingMessagesTest::ReceiveingMessagesTest(deqp::Context& context)
-	: TestCase(context, "receiveing_messages", "Verifies that messages can be received")
-	, TestBase(context, true /* is_debug */)
+ReceivingMessagesTest::ReceivingMessagesTest(tcu::TestContext& testCtx, glu::ApiType apiType)
+	: TestCase(testCtx, "receiving_messages", "Verifies that messages can be received")
+	, TestBase(testCtx, apiType, true /* is_debug */)
 {
 	/* Nothing to be done */
 }
@@ -1276,7 +1266,7 @@
  *
  * @return tcu::TestNode::STOP
  **/
-tcu::TestNode::IterateResult ReceiveingMessagesTest::iterate()
+tcu::TestNode::IterateResult ReceivingMessagesTest::iterate()
 {
 	static const size_t bufSize		  = 32;
 	static const GLchar label[]		  = "foo";
@@ -1335,7 +1325,7 @@
 
 		if (1 != ret)
 		{
-			m_context.getTestContext().getLog() << tcu::TestLog::Message
+			m_testCtx.getLog() << tcu::TestLog::Message
 												<< "GetDebugMessageLog returned invalid number of messages: " << ret
 												<< ", expected 1" << tcu::TestLog::EndMessage;
 
@@ -1549,7 +1539,7 @@
 
 		if (n_debug_messages != max_debug_messages)
 		{
-			m_context.getTestContext().getLog()
+			m_testCtx.getLog()
 				<< tcu::TestLog::Message << "State of DEBUG_LOGGED_MESSAGES: " << n_debug_messages << ", expected "
 				<< max_debug_messages << tcu::TestLog::EndMessage;
 
@@ -1601,7 +1591,7 @@
 
 		if (ret != (GLuint)half_count)
 		{
-			m_context.getTestContext().getLog() << tcu::TestLog::Message
+			m_testCtx.getLog() << tcu::TestLog::Message
 												<< "GetDebugMessageLog returned unexpected number of messages: " << ret
 												<< ", expected " << half_count << tcu::TestLog::EndMessage;
 
@@ -1613,7 +1603,7 @@
 
 		if (n_debug_messages != rest_count)
 		{
-			m_context.getTestContext().getLog()
+			m_testCtx.getLog()
 				<< tcu::TestLog::Message << "State of DEBUG_LOGGED_MESSAGES: " << n_debug_messages << ", expected "
 				<< rest_count << tcu::TestLog::EndMessage;
 
@@ -1667,7 +1657,7 @@
 
 		if (ret != (GLuint)(rest_count - 1))
 		{
-			m_context.getTestContext().getLog() << tcu::TestLog::Message
+			m_testCtx.getLog() << tcu::TestLog::Message
 												<< "GetDebugMessageLog returned unexpected number of messages: " << ret
 												<< ", expected " << (rest_count - 1) << tcu::TestLog::EndMessage;
 
@@ -1679,7 +1669,7 @@
 
 		if (n_debug_messages != 1)
 		{
-			m_context.getTestContext().getLog()
+			m_testCtx.getLog()
 				<< tcu::TestLog::Message << "State of DEBUG_LOGGED_MESSAGES: " << n_debug_messages << ", expected "
 				<< (rest_count - 1) << tcu::TestLog::EndMessage;
 
@@ -1732,7 +1722,7 @@
 
 		if (ret != 1)
 		{
-			m_context.getTestContext().getLog() << tcu::TestLog::Message
+			m_testCtx.getLog() << tcu::TestLog::Message
 												<< "GetDebugMessageLog returned unexpected number of messages: " << ret
 												<< ", expected 1" << tcu::TestLog::EndMessage;
 
@@ -1744,7 +1734,7 @@
 
 		if (n_debug_messages != 0)
 		{
-			m_context.getTestContext().getLog()
+			m_testCtx.getLog()
 				<< tcu::TestLog::Message << "State of DEBUG_LOGGED_MESSAGES: " << n_debug_messages << ", expected 1"
 				<< tcu::TestLog::EndMessage;
 
@@ -1786,7 +1776,7 @@
 	}
 
 	/* Set result */
-	m_context.getTestContext().setTestResult(QP_TEST_RESULT_PASS, "Pass");
+	m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
 
 	/* Done */
 	TestBase::done();
@@ -1804,7 +1794,7 @@
  * @param ignored
  * @param info    Pointer to uint counter
  **/
-void ReceiveingMessagesTest::debug_proc(glw::GLenum /* source */, glw::GLenum /* type */, glw::GLuint /* id */,
+void ReceivingMessagesTest::debug_proc(glw::GLenum /* source */, glw::GLenum /* type */, glw::GLuint /* id */,
 										glw::GLenum /* severity */, glw::GLsizei /* length */,
 										const glw::GLchar* /* message */, const void* info)
 {
@@ -1819,7 +1809,7 @@
  * @param expected_callback  Expected state of DEBUG_CALLBACK_FUNCTION
  * @param expected_user_info Expected state of DEBUG_CALLBACK_USER_PARAM
  **/
-void ReceiveingMessagesTest::inspectDebugState(GLboolean expected_state, GLDEBUGPROC expected_callback,
+void ReceivingMessagesTest::inspectDebugState(GLboolean expected_state, GLDEBUGPROC expected_callback,
 											   GLvoid* expected_user_info) const
 {
 	GLboolean debug_state = -1;
@@ -1828,7 +1818,7 @@
 
 	if (expected_state != debug_state)
 	{
-		m_context.getTestContext().getLog() << tcu::TestLog::Message << "State of DEBUG_OUTPUT: " << debug_state
+		m_testCtx.getLog() << tcu::TestLog::Message << "State of DEBUG_OUTPUT: " << debug_state
 											<< ", expected " << expected_state << tcu::TestLog::EndMessage;
 
 		TCU_FAIL("Invalid state of DEBUG_OUTPUT");
@@ -1858,14 +1848,14 @@
  * @param callback_counter            Reference to counter
  * @param expected_number_of_messages Expected value of counter
  **/
-void ReceiveingMessagesTest::inspectCallbackCounter(GLuint& callback_counter, GLuint expected_number_of_messages) const
+void ReceivingMessagesTest::inspectCallbackCounter(GLuint& callback_counter, GLuint expected_number_of_messages) const
 {
 	m_gl->finish();
 	GLU_EXPECT_NO_ERROR(m_gl->getError(), "Finish");
 
 	if (expected_number_of_messages != callback_counter)
 	{
-		m_context.getTestContext().getLog()
+		m_testCtx.getLog()
 			<< tcu::TestLog::Message << "Debug callback was executed invalid number of times: " << callback_counter
 			<< ", expected " << expected_number_of_messages << tcu::TestLog::EndMessage;
 
@@ -1877,7 +1867,7 @@
  *
  * @param expected_number_of_messages Expected number of messages
  **/
-void ReceiveingMessagesTest::inspectMessageLog(GLuint expected_number_of_messages) const
+void ReceivingMessagesTest::inspectMessageLog(GLuint expected_number_of_messages) const
 {
 	static const size_t bufSize		  = 32;
 	static const size_t read_messages = 4;
@@ -1896,7 +1886,7 @@
 
 	if (expected_number_of_messages != ret)
 	{
-		m_context.getTestContext().getLog() << tcu::TestLog::Message
+		m_testCtx.getLog() << tcu::TestLog::Message
 											<< "GetDebugMessageLog returned invalid number of messages: " << ret
 											<< ", expected " << expected_number_of_messages << tcu::TestLog::EndMessage;
 
@@ -1906,13 +1896,13 @@
 
 /** Constructor
  *
- * @param context  Test context
+ * @param testCtx  Test context
  * @param is_debug Selects if debug or non-debug context should be used
  * @param name     Name of test
  **/
-GroupsTest::GroupsTest(deqp::Context& context)
-	: TestCase(context, "groups", "Verifies that groups can be used to control generated messages")
-	, TestBase(context, true /* is_debug */)
+GroupsTest::GroupsTest(tcu::TestContext& testCtx, glu::ApiType apiType)
+	: TestCase(testCtx, "groups", "Verifies that groups can be used to control generated messages")
+	, TestBase(testCtx, apiType, true /* is_debug */)
 {
 	/* Nothing to be done */
 }
@@ -2111,7 +2101,7 @@
 	inspectGroupStack(1);
 
 	/* Set result */
-	m_context.getTestContext().setTestResult(QP_TEST_RESULT_PASS, "Pass");
+	m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
 
 	/* Done */
 	TestBase::done();
@@ -2132,7 +2122,7 @@
 
 	if (expected_depth != (GLuint)stack_depth)
 	{
-		m_context.getTestContext().getLog() << tcu::TestLog::Message
+		m_testCtx.getLog() << tcu::TestLog::Message
 											<< "State of DEBUG_GROUP_STACK_DEPTH: " << stack_depth << ", expected "
 											<< expected_depth << tcu::TestLog::EndMessage;
 
@@ -2175,7 +2165,7 @@
 
 	if (expected_source != source)
 	{
-		m_context.getTestContext().getLog() << tcu::TestLog::Message << "Got message with invalid source: " << source
+		m_testCtx.getLog() << tcu::TestLog::Message << "Got message with invalid source: " << source
 											<< ", expected " << expected_source << tcu::TestLog::EndMessage;
 
 		TCU_FAIL("Invalid source of message");
@@ -2183,7 +2173,7 @@
 
 	if (expected_type != type)
 	{
-		m_context.getTestContext().getLog() << tcu::TestLog::Message << "Got message with invalid type: " << type
+		m_testCtx.getLog() << tcu::TestLog::Message << "Got message with invalid type: " << type
 											<< ", expected " << expected_type << tcu::TestLog::EndMessage;
 
 		TCU_FAIL("Invalid type of message");
@@ -2191,7 +2181,7 @@
 
 	if (expected_id != id)
 	{
-		m_context.getTestContext().getLog() << tcu::TestLog::Message << "Got message with invalid id: " << id
+		m_testCtx.getLog() << tcu::TestLog::Message << "Got message with invalid id: " << id
 											<< ", expected " << expected_id << tcu::TestLog::EndMessage;
 
 		TCU_FAIL("Invalid id of message");
@@ -2199,7 +2189,7 @@
 
 	if (expected_severity != severity)
 	{
-		m_context.getTestContext().getLog() << tcu::TestLog::Message
+		m_testCtx.getLog() << tcu::TestLog::Message
 											<< "Got message with invalid severity: " << severity << ", expected "
 											<< expected_severity << tcu::TestLog::EndMessage;
 
@@ -2211,7 +2201,7 @@
 	// OpenGL 4.5 Core Spec, Page 530 and Page 535
 	if (expected_length + 1 != length)
 	{
-		m_context.getTestContext().getLog() << tcu::TestLog::Message << "Got message with invalid length: " << length
+		m_testCtx.getLog() << tcu::TestLog::Message << "Got message with invalid length: " << length
 											<< ", expected " << expected_length << tcu::TestLog::EndMessage;
 
 		TCU_FAIL("Invalid length of message");
@@ -2219,7 +2209,7 @@
 
 	if (0 != strcmp(expected_label, messageLog))
 	{
-		m_context.getTestContext().getLog() << tcu::TestLog::Message
+		m_testCtx.getLog() << tcu::TestLog::Message
 											<< "Got message with invalid message: " << messageLog << ", expected "
 											<< expected_label << tcu::TestLog::EndMessage;
 
@@ -2255,13 +2245,13 @@
 
 /** Constructor
  *
- * @param context  Test context
+ * @param testCtx  Test context
  * @param is_debug Selects if debug or non-debug context should be used
  * @param name     Name of test
  **/
-SynchronousCallsTest::SynchronousCallsTest(deqp::Context& context)
-	: TestCase(context, "synchronous_calls", "Verifies that messages can be received")
-	, TestBase(context, true /* is_debug */)
+SynchronousCallsTest::SynchronousCallsTest(tcu::TestContext& testCtx, glu::ApiType apiType)
+	: TestCase(testCtx, "synchronous_calls", "Verifies that messages can be received")
+	, TestBase(testCtx, apiType, true /* is_debug */)
 {
 	/* Create pthread_key_t visible to all threads
 	 * The key has value NULL associated with it in all existing
@@ -2387,7 +2377,7 @@
 	}
 
 	/* Set result */
-	m_context.getTestContext().setTestResult(QP_TEST_RESULT_PASS, "Pass");
+	m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
 
 	/* Done */
 	TestBase::done();
@@ -2424,8 +2414,10 @@
  *
  *  @param context Rendering context.
  **/
-KHRDebugTests::KHRDebugTests(deqp::Context& context)
-	: TestCaseGroup(context, "khr_debug", "Verifies \"khr debug\" functionality")
+KHRDebugTests::KHRDebugTests(tcu::TestContext& testCtx, glu::ApiType apiType)
+	: TestCaseGroup(testCtx, "khr_debug", "Verifies \"khr debug\" functionality")
+	, m_apiType(apiType)
+
 {
 	/* Left blank on purpose */
 }
@@ -2435,13 +2427,13 @@
  **/
 void KHRDebugTests::init(void)
 {
-	addChild(new KHRDebug::APIErrorsTest(m_context, false, "api_errors_non_debug"));
-	addChild(new KHRDebug::LabelsTest(m_context, false, "labels_non_debug"));
-	addChild(new KHRDebug::ReceiveingMessagesTest(m_context));
-	addChild(new KHRDebug::GroupsTest(m_context));
-	addChild(new KHRDebug::APIErrorsTest(m_context, true, "api_errors_debug"));
-	addChild(new KHRDebug::LabelsTest(m_context, true, "labels_debug"));
-	addChild(new KHRDebug::SynchronousCallsTest(m_context));
+	addChild(new KHRDebug::APIErrorsTest(m_testCtx, m_apiType, false, "api_errors_non_debug"));
+	addChild(new KHRDebug::LabelsTest(m_testCtx, m_apiType, false, "labels_non_debug"));
+	addChild(new KHRDebug::ReceivingMessagesTest(m_testCtx, m_apiType));
+	addChild(new KHRDebug::GroupsTest(m_testCtx, m_apiType));
+	addChild(new KHRDebug::APIErrorsTest(m_testCtx, m_apiType, true, "api_errors_debug"));
+	addChild(new KHRDebug::LabelsTest(m_testCtx, m_apiType, true, "labels_debug"));
+	addChild(new KHRDebug::SynchronousCallsTest(m_testCtx, m_apiType));
 }
 
-} /* gl4cts namespace */
+} /* glcts namespace */
diff --git a/external/openglcts/modules/gl/gl4cKHRDebugTests.hpp b/external/openglcts/modules/common/glcKHRDebugTests.hpp
similarity index 92%
rename from external/openglcts/modules/gl/gl4cKHRDebugTests.hpp
rename to external/openglcts/modules/common/glcKHRDebugTests.hpp
index badb52f..cce0c5a 100644
--- a/external/openglcts/modules/gl/gl4cKHRDebugTests.hpp
+++ b/external/openglcts/modules/common/glcKHRDebugTests.hpp
@@ -1,10 +1,10 @@
-#ifndef _GL4CKHRDEBUGTESTS_HPP
-#define _GL4CKHRDEBUGTESTS_HPP
+#ifndef _GLCKHRDEBUGTESTS_HPP
+#define _GLCKHRDEBUGTESTS_HPP
 /*-------------------------------------------------------------------------
  * OpenGL Conformance Test Suite
  * -----------------------------
  *
- * Copyright (c) 2015-2016 The Khronos Group Inc.
+ * Copyright (c) 2015-2018 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.
@@ -24,7 +24,7 @@
  */ /*-------------------------------------------------------------------*/
 
 /**
- * \file  gl4cKHRDebugTests.hpp
+ * \file  glcKHRDebugTests.hpp
  * \brief Declares test classes for "KHR Debug" functionality.
  */ /*-------------------------------------------------------------------*/
 
@@ -43,7 +43,7 @@
 class Functions;
 }
 
-namespace gl4cts
+namespace glcts
 {
 namespace KHRDebug
 {
@@ -54,7 +54,7 @@
 {
 public:
 	/* Public methods */
-	TestBase(deqp::Context& context, bool is_debug);
+	TestBase(tcu::TestContext& testContext, glu::ApiType apiType, bool is_debug);
 	virtual ~TestBase();
 
 protected:
@@ -73,8 +73,8 @@
 	void initNonDebug();
 
 	/* Private fields */
-	deqp::Context&		m_test_base_context;
-	glu::RenderContext* m_orig_rc;
+	tcu::TestContext&	m_testContext;
+	glu::ApiType		m_apiType;
 };
 
 /** Implementation of test APIErrors. Description follows:
@@ -139,11 +139,11 @@
  * GetPointerv function should generate:
  * - INVALID_ENUM when <pname> is invalid.
  **/
-class APIErrorsTest : public deqp::TestCase, public TestBase
+class APIErrorsTest : public TestBase, public tcu::TestCase
 {
 public:
 	/* Public methods */
-	APIErrorsTest(deqp::Context& context, bool is_debug, const glw::GLchar* name);
+	APIErrorsTest(tcu::TestContext& testCtx, glu::ApiType apiType, bool is_debug, const glw::GLchar* name);
 
 	virtual ~APIErrorsTest()
 	{
@@ -180,11 +180,11 @@
  * will be zero;
  * - delete object.
  **/
-class LabelsTest : public deqp::TestCase, public TestBase
+class LabelsTest : public tcu::TestCase, public TestBase
 {
 public:
 	/* Public methods */
-	LabelsTest(deqp::Context& context, bool is_debug, const glw::GLchar* name);
+	LabelsTest(tcu::TestContext& testCtx, glu::ApiType apiType, bool is_debug, const glw::GLchar* name);
 
 	virtual ~LabelsTest()
 	{
@@ -220,7 +220,7 @@
 	static glw::GLvoid deleteVertexArray(const glw::Functions* gl, glw::GLuint id);
 };
 
-/** Implementation of test ReceiveingMessages. Description follows:
+/** Implementation of test ReceivingMessages. Description follows:
  *
  * This test verifies that it is possible to receive messages.
  *
@@ -302,13 +302,13 @@
  * available;
  * - fetch the message and verify it is the newest one;
  **/
-class ReceiveingMessagesTest : public deqp::TestCase, public TestBase
+class ReceivingMessagesTest : public tcu::TestCase, public TestBase
 {
 public:
 	/* Public methods */
-	ReceiveingMessagesTest(deqp::Context& context);
+	ReceivingMessagesTest(tcu::TestContext& testCtx, glu::ApiType apiType);
 
-	virtual ~ReceiveingMessagesTest()
+	virtual ~ReceivingMessagesTest()
 	{
 	}
 
@@ -383,11 +383,11 @@
  *
  * - check state of DEBUG_GROUP_STACK_DEPTH; It should be 1.
  **/
-class GroupsTest : public deqp::TestCase, public TestBase
+class GroupsTest : public tcu::TestCase, public TestBase
 {
 public:
 	/* Public methods */
-	GroupsTest(deqp::Context& context);
+	GroupsTest(tcu::TestContext& testCtx, glu::ApiType apiType);
 
 	virtual ~GroupsTest()
 	{
@@ -433,11 +433,11 @@
  *   * callback_executed is set to 1 and thread_id is the same
  *   as "test" thread - implementation sent message to proper thread;
  **/
-class SynchronousCallsTest : public deqp::TestCase, public TestBase
+class SynchronousCallsTest : public tcu::TestCase, public TestBase
 {
 public:
 	/* Public methods */
-	SynchronousCallsTest(deqp::Context& context);
+	SynchronousCallsTest(tcu::TestContext& testCtx, glu::ApiType apiType);
 	~SynchronousCallsTest(void);
 
 	/* Public methods inherited from TestCase */
@@ -454,11 +454,11 @@
 } /* KHRDebug */
 
 /** Group class for khr debug conformance tests */
-class KHRDebugTests : public deqp::TestCaseGroup
+class KHRDebugTests : public tcu::TestCaseGroup
 {
 public:
 	/* Public methods */
-	KHRDebugTests(deqp::Context& context);
+	KHRDebugTests(tcu::TestContext& testCtx, glu::ApiType apiType);
 
 	virtual ~KHRDebugTests(void)
 	{
@@ -470,8 +470,11 @@
 	/* Private methods */
 	KHRDebugTests(const KHRDebugTests& other);
 	KHRDebugTests& operator=(const KHRDebugTests& other);
+
+	/* Private members */
+	glu::ApiType m_apiType;
 };
 
-} /* gl4cts */
+} /* glcts */
 
-#endif // _GL4CKHRDEBUGTESTS_HPP
+#endif // _GLCKHRDEBUGTESTS_HPP
diff --git a/external/openglcts/modules/common/glcNoDefaultContextPackage.cpp b/external/openglcts/modules/common/glcNoDefaultContextPackage.cpp
index e918e67..77c67b1 100644
--- a/external/openglcts/modules/common/glcNoDefaultContextPackage.cpp
+++ b/external/openglcts/modules/common/glcNoDefaultContextPackage.cpp
@@ -23,6 +23,7 @@
 
 #include "glcNoDefaultContextPackage.hpp"
 #include "glcContextFlagsTests.hpp"
+#include "glcKHRDebugTests.hpp"
 #include "glcMultipleContextsTests.hpp"
 #include "glcNoErrorTests.hpp"
 #include "glcRobustnessTests.hpp"
@@ -93,6 +94,10 @@
 	gl40Group->addChild(new glcts::MultipleContextsTests(getTestContext(), glu::ApiType::core(4, 0)));
 	addChild(gl40Group);
 
+	tcu::TestCaseGroup* gl43Group = new tcu::TestCaseGroup(getTestContext(), "gl43", "");
+	gl43Group->addChild(new glcts::KHRDebugTests(getTestContext(), glu::ApiType::core(4, 3)));
+	addChild(gl43Group);
+
 	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)));
diff --git a/external/openglcts/modules/gl/CMakeLists.txt b/external/openglcts/modules/gl/CMakeLists.txt
index a50d553..41f4f4a 100644
--- a/external/openglcts/modules/gl/CMakeLists.txt
+++ b/external/openglcts/modules/gl/CMakeLists.txt
@@ -48,8 +48,6 @@
 	gl4cES31CompatibilityShaderStorageBufferObjectTests.cpp
 	gl4cES31CompatibilityTests.cpp
 	gl4cES31CompatibilityTests.hpp
-	gl4cKHRDebugTests.cpp
-	gl4cKHRDebugTests.hpp
 	gl4cMapBufferAlignmentTests.cpp
 	gl4cMapBufferAlignmentTests.hpp
 	gl4cMultiBindTests.cpp
diff --git a/external/openglcts/modules/gl/gl4cTestPackages.cpp b/external/openglcts/modules/gl/gl4cTestPackages.cpp
index a1bc0a7..4bc5887 100644
--- a/external/openglcts/modules/gl/gl4cTestPackages.cpp
+++ b/external/openglcts/modules/gl/gl4cTestPackages.cpp
@@ -38,7 +38,6 @@
 #include "gl4cGlSpirvTests.hpp"
 #include "gl4cIncompleteTextureAccessTests.hpp"
 #include "gl4cIndirectParametersTests.hpp"
-#include "gl4cKHRDebugTests.hpp"
 #include "gl4cLimitsTests.hpp"
 #include "gl4cMapBufferAlignmentTests.hpp"
 #include "gl4cMultiBindTests.hpp"
@@ -230,7 +229,6 @@
 		addChild(new glcts::ArrayOfArraysTestGroupGL(getContext()));
 		addChild(new gl4cts::CopyImageTests(getContext()));
 		addChild(new glcts::DrawIndirectTestsGL43(getContext()));
-		addChild(new gl4cts::KHRDebugTests(getContext()));
 		addChild(new gl4cts::ProgramInterfaceQueryTests(getContext()));
 		addChild(new gl4cts::ComputeShaderTests(getContext()));
 		addChild(new deqp::RobustBufferAccessBehaviorTests(getContext()));
diff --git a/external/openglcts/modules/runner/glcKhronosMustpassGlNocontext.hpp b/external/openglcts/modules/runner/glcKhronosMustpassGlNocontext.hpp
index c1281dc..d74d9c9 100644
--- a/external/openglcts/modules/runner/glcKhronosMustpassGlNocontext.hpp
+++ b/external/openglcts/modules/runner/glcKhronosMustpassGlNocontext.hpp
@@ -24,6 +24,7 @@
 static const RunParams khronos_mustpass_gl_nocontext_first_cfg[] = {
 	{ glu::ApiType::core(3, 0), "khr-master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 },
 	{ glu::ApiType::core(4, 0), "khr-master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 },
+	{ glu::ApiType::core(4, 3), "khr-master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 },
 	{ glu::ApiType::core(4, 5), "khr-master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 },
 };
 
diff --git a/external/openglcts/scripts/build_caselists.py b/external/openglcts/scripts/build_caselists.py
index 828b2cc..35710b9 100644
--- a/external/openglcts/scripts/build_caselists.py
+++ b/external/openglcts/scripts/build_caselists.py
@@ -77,6 +77,7 @@
 	Module("GTF-GL30",		"GL30"),
 	Module("KHR-NOCTX-GL30","GL30"),
 	Module("KHR-NOCTX-GL40","GL40"),
+	Module("KHR-NOCTX-GL43","GL43"),
 	Module("KHR-NOCTX-GL45","GL45"),
 ]
 GLCTS_BIN_NAME = "glcts"
@@ -103,7 +104,7 @@
 
 def getCaseListFileName (module, caseListType):
 	mname = module.name
-	if mname == "KHR-NOCTX-ES2" or mname == "KHR-NOCTX-ES32" or mname == "KHR-NOCTX-GL30" or mname == "KHR-NOCTX-GL40" or mname == "KHR-NOCTX-GL45":
+	if mname == "KHR-NOCTX-ES2" or mname == "KHR-NOCTX-ES32" or mname == "KHR-NOCTX-GL30" or mname == "KHR-NOCTX-GL40" or mname == "KHR-NOCTX-GL43" or mname == "KHR-NOCTX-GL45":
 		mname =  "KHR-NoContext"
 	return "%s-cases.%s" % (mname, caseListType)
 
diff --git a/external/openglcts/scripts/build_mustpass.py b/external/openglcts/scripts/build_mustpass.py
index c3531a2..0e9fee9 100644
--- a/external/openglcts/scripts/build_mustpass.py
+++ b/external/openglcts/scripts/build_mustpass.py
@@ -1014,6 +1014,7 @@
 
 NOCTX_GL30_KHR_MODULE			= getModuleByName("KHR-NOCTX-GL30")
 NOCTX_GL40_KHR_MODULE			= getModuleByName("KHR-NOCTX-GL40")
+NOCTX_GL43_KHR_MODULE			= getModuleByName("KHR-NOCTX-GL43")
 NOCTX_GL45_KHR_MODULE			= getModuleByName("KHR-NOCTX-GL45")
 
 GLCTS_NOCTX_GL30_KHR_PKG			= Package(module = NOCTX_GL30_KHR_MODULE, configurations = [
@@ -1034,6 +1035,15 @@
 					filters			= [include("gl40-khr-master.txt")]),
 	])
 
+GLCTS_NOCTX_GL43_KHR_PKG			= Package(module = NOCTX_GL43_KHR_MODULE, configurations = [
+		# Master
+		Configuration(name			= "khr-master",
+					surfacewidth	= "64",
+					surfaceheight	= "64",
+					baseseed		= "1",
+					filters			= [include("gl43-khr-master.txt")]),
+	])
+
 GLCTS_NOCTX_GL45_KHR_PKG			= Package(module = NOCTX_GL45_KHR_MODULE, configurations = [
 		# Master
 		Configuration(name			= "khr-master",
@@ -1070,7 +1080,7 @@
 			gl_packages.append(pkg1)
 
 		mustpass = [Mustpass(project = GL_CTS_KHR_MP_PROJECT, version = "4.6.0.x", isCurrent=True, packages = gl_packages),
-					Mustpass(project = GL_CTS_NOCTX_PROJECT, version = "4.6.0.x", isCurrent=True, packages = [GLCTS_NOCTX_GL30_KHR_PKG, GLCTS_NOCTX_GL40_KHR_PKG, GLCTS_NOCTX_GL45_KHR_PKG]),
+					Mustpass(project = GL_CTS_NOCTX_PROJECT, version = "4.6.0.x", isCurrent=True, packages = [GLCTS_NOCTX_GL30_KHR_PKG, GLCTS_NOCTX_GL40_KHR_PKG, GLCTS_NOCTX_GL43_KHR_PKG, GLCTS_NOCTX_GL45_KHR_PKG]),
 					]
 		return mustpass