Remove vsnprintf from OpenGL CTS, part 1
authorPiotr Byszewski <piotr.byszewski@mobica.com>
Fri, 14 Jul 2017 09:13:45 +0000 (11:13 +0200)
committerAlexander Galazin <alexander.galazin@arm.com>
Wed, 19 Jul 2017 10:31:38 +0000 (12:31 +0200)
This change replaces usage of vsnprintf with tcu::TestLog.

Components: OpenGL

VK-GL-CTS issue: 482

Affects:
KHR-GL43.compute_shader.*
KHR-GL43.program_interface_query.*
KHR-GL42.shader_image_load_store.*

Change-Id: I4460f5f5ae37608735322a5735a526f6c2f0f941

external/openglcts/modules/gl/gl4cComputeShaderTests.cpp
external/openglcts/modules/gl/gl4cES31CompatibilityShaderImageLoadStoreTests.cpp
external/openglcts/modules/gl/gl4cES31CompatibilityShaderStorageBufferObjectTests.cpp
external/openglcts/modules/gl/gl4cProgramInterfaceQueryTests.cpp

index 011f04e..7eb6f7f 100644 (file)
@@ -52,33 +52,6 @@ typedef UVec3 uvec3;
 typedef UVec4 uvec4;
 typedef Mat4  mat4;
 
-static tcu::TestLog* currentLog;
-
-void setOutput(tcu::TestLog& log)
-{
-       currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
-       va_list args;
-       va_start(args, format);
-
-       const int   MAX_OUTPUT_STRING_SIZE = 40000;
-       static char temp[MAX_OUTPUT_STRING_SIZE];
-
-       vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
-       temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
-       char* logLine = strtok(temp, "\n");
-       while (logLine != NULL)
-       {
-               currentLog->writeMessage(logLine);
-               logLine = strtok(NULL, "\n");
-       }
-       va_end(args);
-}
-
 const char* const kGLSLVer = "#version 430 core\n";
 
 class ComputeShaderBase : public deqp::SubcaseBase
@@ -152,25 +125,34 @@ public:
                                        switch (type)
                                        {
                                        case GL_VERTEX_SHADER:
-                                               Output("*** Vertex Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_TESS_CONTROL_SHADER:
-                                               Output("*** Tessellation Control Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Tessellation Control Shader ***"
+                                                       << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_TESS_EVALUATION_SHADER:
-                                               Output("*** Tessellation Evaluation Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Tessellation Evaluation Shader ***"
+                                                       << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_GEOMETRY_SHADER:
-                                               Output("*** Geometry Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Geometry Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_FRAGMENT_SHADER:
-                                               Output("*** Fragment Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_COMPUTE_SHADER:
-                                               Output("*** Compute Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Compute Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        default:
-                                               Output("*** Unknown Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        }
 
@@ -185,7 +167,8 @@ public:
                                        {
                                                std::vector<GLchar> source(length);
                                                glGetShaderSource(shaders[i], length, NULL, &source[0]);
-                                               Output("%s\n", &source[0]);
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
                                        }
 
                                        glGetShaderiv(shaders[i], GL_INFO_LOG_LENGTH, &length);
@@ -193,7 +176,8 @@ public:
                                        {
                                                std::vector<GLchar> log(length);
                                                glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
-                                               Output("%s\n", &log[0]);
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
                                        }
                                }
                        }
@@ -204,7 +188,7 @@ public:
                        {
                                std::vector<GLchar> log(length);
                                glGetProgramInfoLog(program, length, NULL, &log[0]);
-                               Output("%s\n", &log[0]);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
                        }
                }
 
@@ -304,9 +288,11 @@ public:
                        {
                                if (!ColorEqual(display[j * w + i], expected, g_color_eps))
                                {
-                                       Output("Color at (%d, %d) is [%f, %f, %f, %f] should be [%f, %f, %f, %f].\n", x + i, y + j,
-                                                  display[j * w + i].x(), display[j * w + i].y(), display[j * w + i].z(),
-                                                  display[j * w + i].w(), expected.x(), expected.y(), expected.z(), expected.w());
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Color at (" << (x + i) << ", " << (y + j) << ") is ["
+                                               << display[j * w + i].x() << ", " << display[j * w + i].y() << ", " << display[j * w + i].z()
+                                               << ", " << display[j * w + i].w() << "] should be [" << expected.x() << ", " << expected.y()
+                                               << ", " << expected.z() << ", " << expected.w() << "]." << tcu::TestLog::EndMessage;
                                        return false;
                                }
                        }
@@ -385,7 +371,9 @@ public:
                                const int idx = y * width + x;
                                if (!ColorEqual(fb[idx], lb, g_color_eps))
                                {
-                                       Output("First bad color (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "First bad color (" << x << ", " << y << "): " << fb[idx].x() << " "
+                                               << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
                                        status = false;
                                }
                        }
@@ -398,7 +386,9 @@ public:
                                const int idx = y * width + x;
                                if (!ColorEqual(fb[idx], rb, g_color_eps))
                                {
-                                       Output("Bad color at (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Bad color at (" << x << ", " << y << "): " << fb[idx].x() << " "
+                                               << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
                                        status = false;
                                }
                        }
@@ -411,7 +401,9 @@ public:
                                const int idx = y * width + x;
                                if (!ColorEqual(fb[idx], rt, g_color_eps))
                                {
-                                       Output("Bad color at (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Bad color at (" << x << ", " << y << "): " << fb[idx].x() << " "
+                                               << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
                                        status = false;
                                }
                        }
@@ -424,7 +416,9 @@ public:
                                const int idx = y * width + x;
                                if (!ColorEqual(fb[idx], lt, g_color_eps))
                                {
-                                       Output("Bad color at (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Bad color at (" << x << ", " << y << "): " << fb[idx].x() << " "
+                                               << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
                                        status = false;
                                }
                        }
@@ -437,7 +431,9 @@ public:
                                const int idx = y * width + x;
                                if (!ColorEqual(fb[idx], vec3(0), g_color_eps))
                                {
-                                       Output("Bad color at (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Bad color at (" << x << ", " << y << "): " << fb[idx].x() << " "
+                                               << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
                                        status = false;
                                }
                        }
@@ -450,7 +446,9 @@ public:
                                const int idx = y * width + x;
                                if (!ColorEqual(fb[idx], vec3(0), g_color_eps))
                                {
-                                       Output("Bad color at (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Bad color at (" << x << ", " << y << "): " << fb[idx].x() << " "
+                                               << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
                                        status = false;
                                }
                        }
@@ -514,7 +512,9 @@ class SimpleCompute : public ComputeShaderBase
                glGetProgramiv(m_program, GL_COMPUTE_WORK_GROUP_SIZE, v);
                if (v[0] != 1 || v[1] != 1 || v[2] != 1)
                {
-                       Output("Got %d, %d, %d, expected: 1, 1, 1 in GL_COMPUTE_WORK_GROUP_SIZE check", v[0], v[1], v[2]);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Got " << v[0] << ", " << v[1] << ", " << v[2]
+                               << ", expected: 1, 1, 1 in GL_COMPUTE_WORK_GROUP_SIZE check" << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -614,8 +614,10 @@ class BasicOneWorkGroup : public ComputeShaderBase
                glGetProgramiv(m_program, GL_COMPUTE_WORK_GROUP_SIZE, v);
                if (v[0] != local_size_x || v[1] != local_size_y || v[2] != local_size_z)
                {
-                       Output("GL_COMPUTE_LOCAL_WORK_SIZE is (%d %d %d) should be (%d %d %d)\n", v[0], v[1], v[2], local_size_x,
-                                  local_size_y, local_size_z);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "GL_COMPUTE_LOCAL_WORK_SIZE is (" << v[0] << " " << v[1] << " " << v[2]
+                               << ") should be (" << local_size_x << " " << local_size_y << " " << local_size_z << ")"
+                               << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -659,7 +661,8 @@ class BasicOneWorkGroup : public ComputeShaderBase
                                        const int index = z * local_size_x * local_size_y + y * local_size_x + x;
                                        if (!IsEqual(data[index], uvec4(x, y, z, 0)))
                                        {
-                                               Output("Invalid data at offset %d.\n", index);
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "Invalid data at offset " << index << tcu::TestLog::EndMessage;
                                                ret = false;
                                        }
                                }
@@ -797,7 +800,9 @@ class BasicResourceUBO : public ComputeShaderBase
                        glGetActiveUniformBlockiv(m_program, index, GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER, &p);
                        if (p == GL_FALSE)
                        {
-                               Output("UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER should be TRUE.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER should be TRUE."
+                                       << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -856,7 +861,8 @@ class BasicResourceUBO : public ComputeShaderBase
                                        {
                                                if (!IsEqual(data[index * 12 + i], vec4(static_cast<float>(index * 12 + i))))
                                                {
-                                                       Output("Incorrect data at offset %d.\n", index * 12 + i);
+                                                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Incorrect data at offset "
+                                                                                                                               << index * 12 + i << "." << tcu::TestLog::EndMessage;
                                                        return false;
                                                }
                                        }
@@ -1089,7 +1095,8 @@ class BasicResourceTexture : public ComputeShaderBase
                {
                        if (!IsEqual(buffer_data[index], vec4(123.0f)))
                        {
-                               Output("Incorrect data at index %d.\n", index);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Incorrect data at index " << index << "." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -1251,9 +1258,11 @@ class BasicResourceImage : public ComputeShaderBase
                                const vec4 c = vec4(float(y + x) / 255.0f);
                                if (!ColorEqual(display[y * kWidth + x], c, g_color_eps))
                                {
-                                       Output("Got %f, %f, %f, %f, expected %f, %f, %f, %f at %d, %d", display[y * kWidth + x].x(),
-                                                  display[y * kWidth + x].y(), display[y * kWidth + x].z(), display[y * kWidth + x].w(), c.x(),
-                                                  c.y(), c.z(), c.w(), x, y);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Got " << display[y * kWidth + x].x() << ", "
+                                               << display[y * kWidth + x].y() << ", " << display[y * kWidth + x].z() << ", "
+                                               << display[y * kWidth + x].w() << ", expected " << c.x() << ", " << c.y() << ", " << c.z()
+                                               << ", " << c.w() << " at " << x << ", " << y << tcu::TestLog::EndMessage;
                                        return false;
                                }
                        }
@@ -1299,7 +1308,8 @@ class BasicResourceImage : public ComputeShaderBase
 
                if (!pixelFormat.alphaBits)
                {
-                       OutputNotSupported("Test requires default framebuffer alpha bits");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Test requires default framebuffer alpha bits" << tcu::TestLog::EndMessage;
                        return NO_ERROR;
                }
 
@@ -1395,7 +1405,9 @@ class BasicResourceAtomicCounter : public ComputeShaderBase
 
                if (p[0] == GL_FALSE || p[1] == GL_FALSE)
                {
-                       Output("ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER should be TRUE.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER should be TRUE."
+                               << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -1448,7 +1460,8 @@ class BasicResourceAtomicCounter : public ComputeShaderBase
                {
                        if (data[i] != i)
                        {
-                               Output("Value at index %d is %d should be %d.\n", i, data[i], i);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Value at index " << i << " is "
+                                                                                                       << data[i] << " should be " << i << "." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -1458,7 +1471,8 @@ class BasicResourceAtomicCounter : public ComputeShaderBase
                glGetBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(GLuint), &value);
                if (value != kSize)
                {
-                       Output("Final atomic counter value (buffer 0) is %d should be %d.\n", value, kSize);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Final atomic counter value (buffer 0) is "
+                                                                                               << value << " should be " << kSize << "." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -1466,7 +1480,8 @@ class BasicResourceAtomicCounter : public ComputeShaderBase
                glGetBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(GLuint), &value);
                if (value != 0)
                {
-                       Output("Final atomic counter value (buffer 1) is %d should be %d.\n", value, 0);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Final atomic counter value (buffer 1) is "
+                                                                                               << value << " should be 0." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -1661,7 +1676,8 @@ class BasicResourceSubroutine : public ComputeShaderBase
                {
                        if (!IsEqual(data[i], uvec4(i)))
                        {
-                               Output("Invalid value at index %d.\n", i);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Invalid value at index " << i << "." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -1671,7 +1687,8 @@ class BasicResourceSubroutine : public ComputeShaderBase
                glGetBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(GLuint), &value);
                if (value != 16)
                {
-                       Output("Final atomic counter value is %d should be %d.\n", value, 16);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Final atomic counter value is " << value
+                                                                                               << " should be 16." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -1845,7 +1862,8 @@ class BasicResourceUniform : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
                        if (data != 1)
                        {
-                               Output("Data is %d should be 1.\n", data);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -1934,7 +1952,8 @@ class BasicResourceUniform : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
                        if (data != 1)
                        {
-                               Output("Data is %d should be 1.\n", data);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -2052,7 +2071,9 @@ class BasicBuiltinVariables : public ComputeShaderBase
                {
                        if (!IsEqual(data[index], uvec4(num_groups.x(), num_groups.y(), num_groups.z(), 0)))
                        {
-                               Output("gl_NumWorkGroups: Invalid data at index %d.\n", index);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "gl_NumWorkGroups: Invalid data at index " << index << "."
+                                       << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2061,7 +2082,9 @@ class BasicBuiltinVariables : public ComputeShaderBase
                {
                        if (!IsEqual(data[index], uvec4(local_size.x(), local_size.y(), local_size.z(), 0)))
                        {
-                               Output("gl_WorkGroupSize: Invalid data at index %d.\n", index);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "gl_WorkGroupSize: Invalid data at index " << index << "."
+                                       << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2075,7 +2098,8 @@ class BasicBuiltinVariables : public ComputeShaderBase
                        expected.z() /= local_size.z();
                        if (!IsEqual(data[index], uvec4(expected.x(), expected.y(), expected.z(), 0)))
                        {
-                               Output("gl_WorkGroupID: Invalid data at index %d.\n", index);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "gl_WorkGroupID: Invalid data at index "
+                                                                                                       << index << "." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2089,7 +2113,9 @@ class BasicBuiltinVariables : public ComputeShaderBase
                        expected.z() %= local_size.z();
                        if (!IsEqual(data[index], uvec4(expected.x(), expected.y(), expected.z(), 0)))
                        {
-                               Output("gl_LocalInvocationID: Invalid data at index %d.\n", index);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "gl_LocalInvocationID: Invalid data at index " << index << "."
+                                       << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2100,7 +2126,9 @@ class BasicBuiltinVariables : public ComputeShaderBase
                                                                                        local_size.y() * num_groups.y());
                        if (!IsEqual(data[index], uvec4(expected.x(), expected.y(), expected.z(), 0)))
                        {
-                               Output("gl_GlobalInvocationID: Invalid data at index %d.\n", index);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "gl_GlobalInvocationID: Invalid data at index " << index << "."
+                                       << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2113,7 +2141,9 @@ class BasicBuiltinVariables : public ComputeShaderBase
                                                                        (coord.z() % local_size.z()) * local_size.x() * local_size.y();
                        if (!IsEqual(data[index], uvec4(expected)))
                        {
-                               Output("gl_LocalInvocationIndex: Invalid data at index %d.\n", index);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "gl_LocalInvocationIndex: Invalid data at index " << index << "."
+                                       << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2196,7 +2226,8 @@ class BasicMax : public ComputeShaderBase
                        glGetIntegeri_v(target, c, &i);
                        if (i < min_values[c])
                        {
-                               Output("Is %d should be at least %d.\n", i, min_values[c]);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Is " << i << " should be at least "
+                                                                                                       << min_values[c] << "." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2205,7 +2236,9 @@ class BasicMax : public ComputeShaderBase
                        glGetInteger64i_v(target, c, &i64);
                        if (i64 < static_cast<GLint64>(min_values[c]))
                        {
-                               Output("Is %d should be at least %d.\n", static_cast<GLint>(i64), min_values[c]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Is " << static_cast<GLint>(i64) << " should be at least "
+                                       << min_values[c] << "." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2214,7 +2247,9 @@ class BasicMax : public ComputeShaderBase
                        glGetFloati_v(target, c, &f);
                        if (f < static_cast<GLfloat>(min_values[c]))
                        {
-                               Output("Is %d should be at least %d.\n", static_cast<GLint>(f), min_values[c]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Is " << static_cast<GLint>(f) << " should be at least "
+                                       << min_values[c] << "." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2223,7 +2258,9 @@ class BasicMax : public ComputeShaderBase
                        glGetDoublei_v(target, c, &d);
                        if (d < static_cast<GLdouble>(min_values[c]))
                        {
-                               Output("Is %d should be at least %d.\n", static_cast<GLint>(d), min_values[c]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Is " << static_cast<GLint>(d) << " should be at least "
+                                       << min_values[c] << "." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2232,7 +2269,8 @@ class BasicMax : public ComputeShaderBase
                        glGetBooleani_v(target, c, &b);
                        if (b == GL_FALSE)
                        {
-                               Output("Is GL_FALSE should be at least GL_TRUE.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Is GL_FALSE should be at least GL_TRUE." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2251,31 +2289,39 @@ class BasicMax : public ComputeShaderBase
                glGetIntegerv(target, &i);
                if (i < min_value)
                {
-                       Output("Is %d should be at least %d.\n", i, min_value);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Is " << i << " should be at least "
+                                                                                               << min_value << "." << tcu::TestLog::EndMessage;
                        return false;
                }
                glGetInteger64v(target, &i64);
                if (static_cast<GLint>(i64) < min_value)
                {
-                       Output("Is %d should be at least %d.\n", static_cast<GLint>(i64), min_value);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Is " << static_cast<GLint>(i64) << " should be at least " << min_value
+                               << "." << tcu::TestLog::EndMessage;
                        return false;
                }
                glGetFloatv(target, &f);
                if (f < static_cast<GLfloat>(min_value))
                {
-                       Output("Is %d should be at least %d.\n", static_cast<GLint>(f), min_value);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Is " << static_cast<GLint>(f) << " should be at least " << min_value << "."
+                               << tcu::TestLog::EndMessage;
                        return false;
                }
                glGetDoublev(target, &d);
                if (d < static_cast<GLdouble>(min_value))
                {
-                       Output("Is %d should be at least %d.\n", static_cast<GLint>(d), min_value);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Is " << static_cast<GLint>(d) << " should be at least " << min_value << "."
+                               << tcu::TestLog::EndMessage;
                        return false;
                }
                glGetBooleanv(target, &b);
                if (b != (min_value ? GL_TRUE : GL_FALSE))
                {
-                       Output("Is %d should be %d.\n", b, (min_value ? GL_TRUE : GL_FALSE));
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Is " << b << " should be "
+                                                                                               << (min_value ? GL_TRUE : GL_FALSE) << "." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -2440,7 +2486,8 @@ class BasicBuildMonolithic : public ComputeShaderBase
                glGetShaderiv(sh1, GL_SHADER_TYPE, &type);
                if (static_cast<GLenum>(type) != GL_COMPUTE_SHADER)
                {
-                       Output("SHADER_TYPE should be COMPUTE_SHADER.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "SHADER_TYPE should be COMPUTE_SHADER." << tcu::TestLog::EndMessage;
                        glDeleteShader(sh1);
                        return false;
                }
@@ -2483,7 +2530,8 @@ class BasicBuildMonolithic : public ComputeShaderBase
                glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4), &data[0]);
                if (!IsEqual(data, vec4(1.0f, 2.0f, 3.0f, 4.0f)))
                {
-                       Output("Invalid value!\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Invalid value!" << tcu::TestLog::EndMessage;
                        res = false;
                }
 
@@ -2549,7 +2597,8 @@ class BasicBuildSeparable : public ComputeShaderBase
                glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4), &data[0]);
                if (!IsEqual(data, vec4(1.0f, 2.0f, 3.0f, 4.0f)))
                {
-                       Output("Invalid value!\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Invalid value!" << tcu::TestLog::EndMessage;
                        res = false;
                }
 
@@ -2567,7 +2616,8 @@ class BasicBuildSeparable : public ComputeShaderBase
                glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4), &data[0]);
                if (!IsEqual(data, vec4(1.0f, 2.0f, 3.0f, 4.0f)))
                {
-                       Output("Invalid value!\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Invalid value!" << tcu::TestLog::EndMessage;
                        res = false;
                }
 
@@ -2642,7 +2692,8 @@ class BasicSharedSimple : public ComputeShaderBase
                {
                        if (data[i] != 1)
                        {
-                               Output("Data at index %d is %d should be %d.\n", i, data[i], 1);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at index " << i << " is "
+                                                                                                       << data[i] << " should be 1." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2761,7 +2812,8 @@ class BasicSharedStruct : public ComputeShaderBase
                {
                        if (!IsEqual(data[i], vec4(static_cast<float>(i))))
                        {
-                               Output("Invalid data at index %d.\n", i);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Invalid data at index " << i << "." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -2868,7 +2920,8 @@ class BasicDispatchIndirect : public ComputeShaderBase
                {
                        if (data[i] != i)
                        {
-                               Output("Data at index %d is %d should be %d.\n", i, data[i], i);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at index " << i << " is "
+                                                                                                       << data[i] << " should be " << i << "." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -3313,7 +3366,8 @@ class BasicSSOCase3 : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(int), &data);
                        if (data != 1)
                        {
-                               Output("Data is %d should be 1.\n", data);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -3328,7 +3382,8 @@ class BasicSSOCase3 : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(int), &data);
                        if (data != 2)
                        {
-                               Output("Data is %d should be 2.\n", data);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is " << data << " should be 2." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -3343,7 +3398,8 @@ class BasicSSOCase3 : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(int), &data);
                        if (data != 2)
                        {
-                               Output("Data is %d should be 2.\n", data);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is " << data << " should be 2." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -3359,7 +3415,8 @@ class BasicSSOCase3 : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(int), &data);
                        if (data != 1)
                        {
-                               Output("Data is %d should be 1.\n", data);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -3440,7 +3497,8 @@ class BasicAtomicCase1 : public ComputeShaderBase
                {
                        if (data[i] != i)
                        {
-                               Output("Data at index %d is %d should be %d.\n", i, data[i], i);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at index " << i << " is "
+                                                                                                       << data[i] << " should be " << i << "." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -3451,7 +3509,8 @@ class BasicAtomicCase1 : public ComputeShaderBase
                {
                        if (data[i] != i)
                        {
-                               Output("Data at index %d is %d should be %d.\n", i, data[i], i);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at index " << i << " is "
+                                                                                                       << data[i] << " should be " << i << "." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -3568,7 +3627,8 @@ class BasicAtomicCase2 : public ComputeShaderBase
                {
                        if (udata[i] != 7)
                        {
-                               Output("uData at index %d is %d should be %d.\n", i, udata[i], 7);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+                                                                                                       << udata[i] << " should be 7." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -3580,7 +3640,8 @@ class BasicAtomicCase2 : public ComputeShaderBase
                {
                        if (idata[i] != 7)
                        {
-                               Output("iData at index %d is %d should be %d.\n", i, idata[i], 7);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at index " << i << " is "
+                                                                                                       << idata[i] << " should be 7." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -3717,7 +3778,8 @@ class BasicAtomicCase3 : public ComputeShaderBase
                {
                        if (udata[i] != 7)
                        {
-                               Output("uData at index %d is %d should be %d.\n", i, udata[i], 7);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+                                                                                                       << udata[i] << " should be 7." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -3729,7 +3791,8 @@ class BasicAtomicCase3 : public ComputeShaderBase
                {
                        if (idata[i] != 7)
                        {
-                               Output("iData at index %d is %d should be %d.\n", i, idata[i], 7);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+                                                                                                       << idata[i] << " should be 7." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -3840,7 +3903,9 @@ class AdvancedCopyImage : public ComputeShaderBase
                {
                        if (getWindowWidth() > 100 && data[i] != 0x0f)
                        {
-                               Output("Data at index %d is %d should be %d.\n", i, data[i], 0x0f);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data at index " << i << " is " << data[i] << " should be " << 0x0f
+                                       << "." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -4330,7 +4395,8 @@ class AdvancedPipelineComputeChain : public ComputeShaderBase
                        {
                                if (!ColorEqual(data[i], vec4(0.25f, 0.5f, 0.75f, 1.0f), g_color_eps))
                                {
-                                       Output("Invalid data at texture.\n");
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Invalid data at texture." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -4344,7 +4410,8 @@ class AdvancedPipelineComputeChain : public ComputeShaderBase
                        {
                                if (data[i] != 4)
                                {
-                                       Output("Data is: %d should be: %d.\n", data[i], 2);
+                                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data is " << data[i]
+                                                                                                               << " should be 2." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -4358,7 +4425,8 @@ class AdvancedPipelineComputeChain : public ComputeShaderBase
                        {
                                if (data[i] != i)
                                {
-                                       Output("Data is: %d should be: %d.\n", data[i], i);
+                                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data is " << data[i]
+                                                                                                               << " should be " << i << "." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -4372,12 +4440,14 @@ class AdvancedPipelineComputeChain : public ComputeShaderBase
                        {
                                if (data[i] != 5)
                                {
-                                       Output("Data is: %d should be: %d.\n", data[i], 5);
+                                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data is: " << data[i]
+                                                                                                               << " should be: 5." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                                if (data[i + 256] != 7)
                                {
-                                       Output("Data is: %d should be: %d.\n", data[i + 256], 7);
+                                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data is: " << data[i + 256]
+                                                                                                               << " should be: 7." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -4389,12 +4459,14 @@ class AdvancedPipelineComputeChain : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data[0](0, 0));
                        if (data[0] != translationMatrix(vec3(10.0f, 20.0f, 30.0f)))
                        {
-                               Output("Data is incorrect.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is incorrect." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                        if (data[1] != transpose(translationMatrix(vec3(10.0f, 20.0f, 30.0f))))
                        {
-                               Output("Data is incorrect.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is incorrect." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -4404,7 +4476,8 @@ class AdvancedPipelineComputeChain : public ComputeShaderBase
                        glGetBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(data), data);
                        if (data[3] != 4)
                        {
-                               Output("Data is: %d should be: %d.\n", data[3], 4);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is: " << data[3] << " should be: 4." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -4565,7 +4638,8 @@ class AdvancedPipelinePostFS : public ComputeShaderBase
                        {
                                if (!IsEqual(data[i], vec4(1, 1, 0, 1)))
                                {
-                                       Output("Invalid data at index %d.\n", i);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Invalid data at index " << i << "." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -4715,7 +4789,9 @@ class AdvancedPipelinePostXFB : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), data);
                        if (memcmp(data, in_data, sizeof(data)) != 0)
                        {
-                               Output("Data in shader storage buffer is incorrect.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data in shader storage buffer is incorrect."
+                                       << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -4729,7 +4805,8 @@ class AdvancedPipelinePostXFB : public ComputeShaderBase
                        glGetBufferSubData(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(data), data);
                        if (memcmp(data, ref_data, sizeof(data)) != 0)
                        {
-                               Output("Data in xfb buffer is incorrect.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data in xfb buffer is incorrect." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -4844,7 +4921,8 @@ class AdvancedSharedIndexing : public ComputeShaderBase
                        {
                                if (!IsEqual(data[i], vec4(0, 1, 0, 1)))
                                {
-                                       Output("Invalid data at index %d.\n", i);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Invalid data at index " << i << "." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -4928,7 +5006,8 @@ class AdvancedSharedMax : public ComputeShaderBase
                        {
                                if (!IsEqual(data[i], vec4(1.0f)))
                                {
-                                       Output("Invalid data at index %d.\n", i);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Invalid data at index " << i << "." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -5058,7 +5137,8 @@ class AdvancedDynamicPaths : public ComputeShaderBase
                        {
                                if (!IsEqual(data[i], expected[i]))
                                {
-                                       Output("Invalid data at index %d.\n", i);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Invalid data at index " << i << "." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -5171,7 +5251,8 @@ class AdvancedResourcesMax : public ComputeShaderBase
 
                        if (data != (index + 1) * 6)
                        {
-                               Output("Data is %d should be %d.\n", data, (index + 1) * 6);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data is " << data << " should be "
+                                                                                                       << (index + 1) * 6 << "." << tcu::TestLog::EndMessage;
                                result = false;
                        }
                        glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
@@ -5337,7 +5418,9 @@ class AdvancedFP64Case1 : public ComputeShaderBase
                                glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
                                if (data != expected[i])
                                {
-                                       Output("Data at index %d is %f should be %f.\n", i, data, expected[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Data at index " << i << " is " << data << " should be "
+                                               << expected[i] << "." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -5487,7 +5570,8 @@ class AdvancedFP64Case2 : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
                        if (data != 1)
                        {
-                               Output("Data is %d should be 1.\n", data);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -5564,7 +5648,8 @@ class AdvancedFP64Case2 : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
                        if (data != 1)
                        {
-                               Output("Data is %d should be 1.\n", data);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -5676,7 +5761,9 @@ class AdvancedFP64Case3 : public ComputeShaderBase
                        {
                                if (fabs(data[i] - expected[i]) > g_color_eps.x())
                                {
-                                       Output("Data at index %d is %f should be %f.\n", i, data[i], expected[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Data at index " << i << " is " << data[i] << " should be "
+                                               << expected[i] << "." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -5810,7 +5897,8 @@ class AdvancedConditionalDispatching : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
                        if (data != 16)
                        {
-                               Output("Data is %d should be 16.\n", data);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is " << data << " should be 16." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -5829,12 +5917,14 @@ class AdvancedConditionalDispatching : public ComputeShaderBase
                        glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
                        if (data != 16 && m_context.getRenderContext().getRenderTarget().getDepthBits() != 0)
                        {
-                               Output("Data is %d should be 16.\n", data);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is " << data << " should be 16." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                        else if (data != 32 && m_context.getRenderContext().getRenderTarget().getDepthBits() == 0)
                        {
-                               Output("Data is %d should be 32.\n", data);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data is " << data << " should be 32." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -5890,9 +5980,10 @@ class NegativeAPINoActiveProgram : public ComputeShaderBase
                glDispatchCompute(1, 2, 3);
                if (glGetError() != GL_INVALID_OPERATION)
                {
-                       Output("INVALID_OPERATION is generated by DispatchCompute or\n"
-                                  "DispatchComputeIndirect if there is no active program for the compute\n"
-                                  "shader stage.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_OPERATION is generated by DispatchCompute or\n"
+                               << "DispatchComputeIndirect if there is no active program for the compute\n"
+                               << "shader stage." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -5907,9 +5998,10 @@ class NegativeAPINoActiveProgram : public ComputeShaderBase
                        glDeleteBuffers(1, &buffer);
                        if (glGetError() != GL_INVALID_OPERATION)
                        {
-                               Output("INVALID_OPERATION is generated by DispatchCompute or\n"
-                                          "DispatchComputeIndirect if there is no active program for the compute\n"
-                                          "shader stage.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "INVALID_OPERATION is generated by DispatchCompute or\n"
+                                       << "DispatchComputeIndirect if there is no active program for the compute\n"
+                                       << "shader stage." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -5930,9 +6022,10 @@ class NegativeAPINoActiveProgram : public ComputeShaderBase
                glDispatchCompute(1, 2, 3);
                if (glGetError() != GL_INVALID_OPERATION)
                {
-                       Output("INVALID_OPERATION is generated by DispatchCompute or\n"
-                                  "DispatchComputeIndirect if there is no active program for the compute\n"
-                                  "shader stage.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_OPERATION is generated by DispatchCompute or\n"
+                               << "DispatchComputeIndirect if there is no active program for the compute\n"
+                               << "shader stage." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -5947,9 +6040,10 @@ class NegativeAPINoActiveProgram : public ComputeShaderBase
                        glDeleteBuffers(1, &buffer);
                        if (glGetError() != GL_INVALID_OPERATION)
                        {
-                               Output("INVALID_OPERATION is generated by DispatchCompute or\n"
-                                          "DispatchComputeIndirect if there is no active program for the compute\n"
-                                          "shader stage.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "INVALID_OPERATION is generated by DispatchCompute or\n"
+                                       << "DispatchComputeIndirect if there is no active program for the compute\n"
+                                       << "shader stage." << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -6017,27 +6111,30 @@ class NegativeAPIWorkGroupCount : public ComputeShaderBase
                glDispatchCompute(x + 1, 1, 1);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
-                                  "<num_groups_y> or <num_groups_z> is greater than the value of\n"
-                                  "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
+                               << "<num_groups_y> or <num_groups_z> is greater than the value of\n"
+                               << "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
                glDispatchCompute(1, y + 1, 1);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
-                                  "<num_groups_y> or <num_groups_z> is greater than the value of\n"
-                                  "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
+                               << "<num_groups_y> or <num_groups_z> is greater than the value of\n"
+                               << "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
                glDispatchCompute(1, 1, z + 1);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
-                                  "<num_groups_y> or <num_groups_z> is greater than the value of\n"
-                                  "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
+                               << "<num_groups_y> or <num_groups_z> is greater than the value of\n"
+                               << "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -6107,25 +6204,29 @@ class NegativeAPIIndirect : public ComputeShaderBase
                glDispatchComputeIndirect(-2);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("INVALID_VALUE is generated by DispatchComputeIndirect if <indirect> is\n"
-                                  "less than zero or not a multiple of four.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_VALUE is generated by DispatchComputeIndirect if <indirect> is\n"
+                               << "less than zero or not a multiple of four." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
                glDispatchComputeIndirect(3);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("INVALID_VALUE is generated by DispatchComputeIndirect if <indirect> is\n"
-                                  "less than zero or not a multiple of four.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_VALUE is generated by DispatchComputeIndirect if <indirect> is\n"
+                               << "less than zero or not a multiple of four." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
                glDispatchComputeIndirect(16);
                if (glGetError() != GL_INVALID_OPERATION)
                {
-                       Output("INVALID_OPERATION is generated by DispatchComputeIndirect if no buffer is\n"
-                                  "bound to DISPATCH_INDIRECT_BUFFER or if the command would source data\n"
-                                  "beyond the end of the bound buffer object.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message
+                               << "INVALID_OPERATION is generated by DispatchComputeIndirect if no buffer is\n"
+                               << "bound to DISPATCH_INDIRECT_BUFFER or if the command would source data\n"
+                               << "beyond the end of the bound buffer object." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -6133,9 +6234,11 @@ class NegativeAPIIndirect : public ComputeShaderBase
                glDispatchComputeIndirect(0);
                if (glGetError() != GL_INVALID_OPERATION)
                {
-                       Output("INVALID_OPERATION is generated by DispatchComputeIndirect if no buffer is\n"
-                                  "bound to DISPATCH_INDIRECT_BUFFER or if the command would source data\n"
-                                  "beyond the end of the bound buffer object.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message
+                               << "INVALID_OPERATION is generated by DispatchComputeIndirect if no buffer is\n"
+                               << "bound to DISPATCH_INDIRECT_BUFFER or if the command would source data\n"
+                               << "beyond the end of the bound buffer object." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -6192,9 +6295,10 @@ class NegativeAPIProgram : public ComputeShaderBase
                glGetProgramiv(m_program, GL_COMPUTE_WORK_GROUP_SIZE, v);
                if (glGetError() != GL_INVALID_OPERATION)
                {
-                       Output("INVALID_OPERATION is generated by GetProgramiv if <pname> is\n"
-                                  "COMPUTE_LOCAL_WORK_SIZE and either the program has not been linked\n"
-                                  "successfully, or has been linked but contains no compute shaders.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_OPERATION is generated by GetProgramiv if <pname> is\n"
+                               << "COMPUTE_LOCAL_WORK_SIZE and either the program has not been linked\n"
+                               << "successfully, or has been linked but contains no compute shaders." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -6205,9 +6309,10 @@ class NegativeAPIProgram : public ComputeShaderBase
                glGetProgramiv(m_program, GL_COMPUTE_WORK_GROUP_SIZE, v);
                if (glGetError() != GL_INVALID_OPERATION)
                {
-                       Output("INVALID_OPERATION is generated by GetProgramiv if <pname> is\n"
-                                  "COMPUTE_LOCAL_WORK_SIZE and either the program has not been linked\n"
-                                  "successfully, or has been linked but contains no compute shaders.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_OPERATION is generated by GetProgramiv if <pname> is\n"
+                               << "COMPUTE_LOCAL_WORK_SIZE and either the program has not been linked\n"
+                               << "successfully, or has been linked but contains no compute shaders." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                glDeleteProgram(m_program);
@@ -6240,8 +6345,10 @@ class NegativeAPIProgram : public ComputeShaderBase
                glGetProgramiv(m_program, GL_LINK_STATUS, &status);
                if (status == GL_TRUE)
                {
-                       Output("LinkProgram will fail if <program> contains a combination of compute and\n"
-                                  "non-compute shaders.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "LinkProgram will fail if <program> contains a combination"
+                               << " of compute and\n non-compute shaders.\n"
+                               << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -6334,7 +6441,8 @@ class NegativeGLSLCompileTimeErrors : public ComputeShaderBase
 
                GLchar log[1024];
                glGetShaderInfoLog(sh, sizeof(log), NULL, log);
-               Output("Shader Info Log:\n%s\n", log);
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+                                                                                       << log << tcu::TestLog::EndMessage;
 
                GLint status;
                glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
@@ -6342,7 +6450,8 @@ class NegativeGLSLCompileTimeErrors : public ComputeShaderBase
 
                if (status == GL_TRUE)
                {
-                       Output("Compilation should fail.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Compilation should fail." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -6404,7 +6513,8 @@ class NegativeGLSLLinkTimeErrors : public ComputeShaderBase
                        if (status == GL_FALSE)
                        {
                                glDeleteProgram(p);
-                               Output("CS0 compilation should be ok.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "CS0 compilation should be ok." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -6422,7 +6532,8 @@ class NegativeGLSLLinkTimeErrors : public ComputeShaderBase
                        if (status == GL_FALSE)
                        {
                                glDeleteProgram(p);
-                               Output("CS1 compilation should be ok.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "CS1 compilation should be ok." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -6431,7 +6542,8 @@ class NegativeGLSLLinkTimeErrors : public ComputeShaderBase
 
                GLchar log[1024];
                glGetProgramInfoLog(p, sizeof(log), NULL, log);
-               Output("Program Info Log:\n%s\n", log);
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+                                                                                       << log << tcu::TestLog::EndMessage;
 
                GLint status;
                glGetProgramiv(p, GL_LINK_STATUS, &status);
@@ -6439,7 +6551,8 @@ class NegativeGLSLLinkTimeErrors : public ComputeShaderBase
 
                if (status == GL_TRUE)
                {
-                       Output("Link operation should fail.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Link operation should fail." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -6511,7 +6624,9 @@ class BasicWorkGroupSizeIsConst : public ComputeShaderBase
                {
                        if (data[i] != (i + 25))
                        {
-                               Output("Data at index %u is %u should be %u.\n", i, data[i], i + 25);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Data at index " << i << " is " << data[i] << " should be " << i + 25
+                                       << "." << tcu::TestLog::EndMessage;
                                error = ERROR;
                        }
                }
@@ -6542,7 +6657,6 @@ ComputeShaderTests::~ComputeShaderTests(void)
 void ComputeShaderTests::init()
 {
        using namespace deqp;
-       setOutput(m_context.getTestContext().getLog());
        addChild(new TestSubcase(m_context, "simple-compute", TestSubcase::Create<SimpleCompute>));
        addChild(new TestSubcase(m_context, "one-work-group", TestSubcase::Create<BasicOneWorkGroup>));
        addChild(new TestSubcase(m_context, "resource-ubo", TestSubcase::Create<BasicResourceUBO>));
index 9c6cfad..37aa5b2 100644 (file)
@@ -52,32 +52,6 @@ enum Target
        T2DA
 };
 
-static tcu::TestLog* currentLog;
-void setOutput(tcu::TestLog& log)
-{
-       currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
-       va_list args;
-       va_start(args, format);
-
-       const int   MAX_OUTPUT_STRING_SIZE = 40000;
-       static char temp[MAX_OUTPUT_STRING_SIZE];
-
-       vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
-       temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
-       char* logLine = strtok(temp, "\n");
-       while (logLine != NULL)
-       {
-               currentLog->writeMessage(logLine);
-               logLine = strtok(NULL, "\n");
-       }
-       va_end(args);
-}
-
 const char* const kGLSLVer = "#version 310 es";
 const char* const kGLSLSIA = NL "#extension GL_OES_shader_image_atomic : require";
 const char* const kGLSLPrec =
@@ -241,8 +215,9 @@ public:
                {
                        if (!Equal(map_data[i], expected_value, internalformat))
                        {
-                               Output("[%d] Value is: %s. Value should be: %s.\n", i, ToString(map_data[i]).c_str(),
-                                          ToString(expected_value).c_str());
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+                                       << ". Value should be: " << ToString(expected_value).c_str() << "." << tcu::TestLog::EndMessage;
                                return false;
                        }
                }
@@ -257,8 +232,9 @@ public:
                {
                        if (always)
                        {
-                               Output("[%d] Value is: %s. Value should be: %s.\n", i, ToString(map_data[i]).c_str(),
-                                          ToString(expected_value).c_str());
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+                                       << ". Value should be: " << ToString(expected_value).c_str() << "." << tcu::TestLog::EndMessage;
                        }
                }
                return true;
@@ -282,11 +258,11 @@ public:
                                        fabs(fb[i + 1] / g_color_max[1] - expected[1]) > g_color_eps[1] ||
                                        fabs(fb[i + 2] / g_color_max[2] - expected[2]) > g_color_eps[2])
                                {
-
-                                       Output("Incorrect framebuffer color at pixel (%d %d). Color is (%f %f %f). "
-                                                  "Color should be (%f %f %f).\n",
-                                                  x, y, fb[i + 0] / g_color_max[0], fb[i + 1] / g_color_max[1], fb[i + 2] / g_color_max[2],
-                                                  expected[0], expected[1], expected[2]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Incorrect framebuffer color at pixel (" << x << ", " << y
+                                               << "). Color is (" << fb[i + 0] / g_color_max[0] << ", " << fb[i + 1] / g_color_max[1] << ", "
+                                               << fb[i + 2] / g_color_max[2] << "). Color should be (" << expected[0] << ", " << expected[1]
+                                               << ", " << expected[2] << ")." << tcu::TestLog::EndMessage;
                                        return false;
                                }
                        }
@@ -306,7 +282,8 @@ public:
                        glGetShaderInfoLog(shader, sizeof(log), &length, log);
                        if (length > 1)
                        {
-                               Output("Shader Info Log:\n%s\n", log);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+                                                                                                       << log << tcu::TestLog::EndMessage;
                        }
                        return false;
                }
@@ -326,7 +303,8 @@ public:
                        glGetProgramInfoLog(program, sizeof(log), &length, log);
                        if (length > 1)
                        {
-                               Output("Program Info Log:\n%s\n", log);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+                                                                                                       << log << tcu::TestLog::EndMessage;
                        }
                        return false;
                }
@@ -352,7 +330,8 @@ public:
                        glShaderSource(sh, 2, src, NULL);
                        if (!CompileShader(sh))
                        {
-                               Output("%s%s\n", src[0], src[1]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
                                return p;
                        }
                }
@@ -365,16 +344,19 @@ public:
                        glShaderSource(sh, 2, src, NULL);
                        if (!CompileShader(sh))
                        {
-                               Output("%s%s\n", src[0], src[1]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
                                return p;
                        }
                }
                if (!LinkProgram(p))
                {
                        if (src_vs)
-                               Output("%s%s\n", hvs.c_str(), src_vs);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << hvs.c_str() << src_vs << tcu::TestLog::EndMessage;
                        if (src_fs)
-                               Output("%s%s\n", hfs.c_str(), src_fs);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << hfs.c_str() << src_fs << tcu::TestLog::EndMessage;
                        return p;
                }
 
@@ -397,14 +379,16 @@ public:
                        glShaderSource(sh, 2, src, NULL);
                        if (!CompileShader(sh))
                        {
-                               Output("%s%s\n", src[0], src[1]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
                                return p;
                        }
                }
                if (!LinkProgram(p))
                {
                        if (!cs.empty())
-                               Output("%s%s\n", hcs.c_str(), cs.c_str());
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << hcs.c_str() << cs.c_str() << tcu::TestLog::EndMessage;
                        return p;
                }
 
@@ -421,7 +405,11 @@ public:
                {
                        GLchar log[1024];
                        glGetProgramInfoLog(p, sizeof(log), NULL, log);
-                       Output("Program Info Log:\n%s\n%s\n%s\n%s\n", log, src3[0], src3[1], src3[2]);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+                                                                                               << log << "\n"
+                                                                                               << src3[0] << "\n"
+                                                                                               << src3[1] << "\n"
+                                                                                               << src3[2] << tcu::TestLog::EndMessage;
                }
                return p;
        }
@@ -581,14 +569,16 @@ public:
                glGetIntegeri_v(GL_IMAGE_BINDING_NAME, unit, &i);
                if (static_cast<GLuint>(i) != texture)
                {
-                       Output("GL_IMAGE_BINDING_NAME is %d should be %d.\n", i, texture);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_NAME is " << i
+                                                                                               << " should be " << texture << "." << tcu::TestLog::EndMessage;
                        return false;
                }
 
                glGetIntegeri_v(GL_IMAGE_BINDING_LEVEL, unit, &i);
                if (i != level)
                {
-                       Output("GL_IMAGE_BINDING_LEVEL is %d should be %d.\n", i, level);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_LEVEL is " << i
+                                                                                               << " should be " << level << "." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -596,28 +586,32 @@ public:
                glGetBooleani_v(GL_IMAGE_BINDING_LAYERED, unit, &b);
                if (i != layered || b != layered)
                {
-                       Output("GL_IMAGE_BINDING_LAYERED is %d should be %d.\n", i, layered);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_LAYERED is " << i
+                                                                                               << " should be " << layered << "." << tcu::TestLog::EndMessage;
                        return false;
                }
 
                glGetIntegeri_v(GL_IMAGE_BINDING_LAYER, unit, &i);
                if (i != layer)
                {
-                       Output("GL_IMAGE_BINDING_LAYER is %d should be %d.\n", i, layer);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_LAYER is " << i
+                                                                                               << " should be " << layer << "." << tcu::TestLog::EndMessage;
                        return false;
                }
 
                glGetIntegeri_v(GL_IMAGE_BINDING_ACCESS, unit, &i);
                if (static_cast<GLenum>(i) != access)
                {
-                       Output("GL_IMAGE_BINDING_ACCESS is %d should be %d.\n", i, access);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_ACCESS is " << i
+                                                                                               << " should be " << access << "." << tcu::TestLog::EndMessage;
                        return false;
                }
 
                glGetIntegeri_v(GL_IMAGE_BINDING_FORMAT, unit, &i);
                if (static_cast<GLenum>(i) != format)
                {
-                       Output("GL_IMAGE_BINDING_FORMAT is %d should be %d.\n", i, format);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_FORMAT is " << i
+                                                                                               << " should be " << format << "." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -873,32 +867,43 @@ class BasicAPIGet : public ShaderImageLoadStoreBase
        {
                if (!CheckMax(GL_MAX_IMAGE_UNITS, 4))
                {
-                       Output("GL_MAX_IMAGE_UNITS value is invalid.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "GL_MAX_IMAGE_UNITS value is invalid." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                if (!CheckMax(GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES, 4))
                {
-                       Output("GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES value is invalid.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES value is invalid."
+                               << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                if (!CheckMax(GL_MAX_VERTEX_IMAGE_UNIFORMS, 0))
                {
-                       Output("GL_MAX_VERTEX_IMAGE_UNIFORMS value is invalid.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "GL_MAX_VERTEX_IMAGE_UNIFORMS value is invalid."
+                               << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                if (!CheckMax(GL_MAX_FRAGMENT_IMAGE_UNIFORMS, 0))
                {
-                       Output("GL_MAX_FRAGMENT_IMAGE_UNIFORMS value is invalid.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "GL_MAX_FRAGMENT_IMAGE_UNIFORMS value is invalid."
+                               << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                if (!CheckMax(GL_MAX_COMBINED_IMAGE_UNIFORMS, 4))
                {
-                       Output("GL_MAX_COMBINED_IMAGE_UNIFORMS value is invalid.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "GL_MAX_COMBINED_IMAGE_UNIFORMS value is invalid."
+                               << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                if (!CheckMax(GL_MAX_COMPUTE_IMAGE_UNIFORMS, 4))
                {
-                       Output("GL_MAX_COMPUTE_IMAGE_UNIFORMS value is invalid.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "GL_MAX_COMPUTE_IMAGE_UNIFORMS value is invalid."
+                               << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                return NO_ERROR;
@@ -925,7 +930,8 @@ class BasicAPIBind : public ShaderImageLoadStoreBase
                {
                        if (!CheckBinding(index, 0, 0, GL_FALSE, 0, GL_READ_ONLY, GL_R32UI))
                        {
-                               Output("Binding point %d has invalid default state.\n", index);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Binding point " << index
+                                                                                                       << " has invalid default state." << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -960,7 +966,9 @@ class BasicAPIBind : public ShaderImageLoadStoreBase
                        glGetIntegeri_v(GL_IMAGE_BINDING_NAME, index, &name);
                        if (name != 0)
                        {
-                               Output("Binding point %d should be set to 0 after texture deletion.\n", index);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Binding point " << index
+                                       << " should be set to 0 after texture deletion." << tcu::TestLog::EndMessage;
                                status = false;
                        }
                        if (!CheckBinding(index, 0, 0, GL_FALSE, 0, GL_READ_ONLY, GL_R32UI))
@@ -1053,15 +1061,19 @@ class BasicAPITexParam : public ShaderImageLoadStoreBase
                glGetTexParameteriv(GL_TEXTURE_2D, GL_IMAGE_FORMAT_COMPATIBILITY_TYPE, &i);
                if (i != GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE)
                {
-                       Output("GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
-                                  "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL.");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
+                               << "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL."
+                               << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                glGetTexParameterfv(GL_TEXTURE_2D, GL_IMAGE_FORMAT_COMPATIBILITY_TYPE, &f);
                if (static_cast<GLenum>(f) != GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE)
                {
-                       Output("GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
-                                  "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL.");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
+                               << "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL."
+                               << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -1171,9 +1183,11 @@ class BasicAllFormatsStoreFS : public ShaderImageLoadStoreBase
                {
                        if (!Equal(map_data[i], expected_value, internalformat))
                        {
-                               Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
-                                          ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
-                                          FormatEnumToString(internalformat).c_str(), unit);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+                                       << ". Value should be: " << ToString(expected_value).c_str()
+                                       << ". Format is: " << FormatEnumToString(internalformat).c_str() << ". Unit is: " << unit << "."
+                                       << tcu::TestLog::EndMessage;
                                glDeleteTextures(1, &texture);
                                glUseProgram(0);
                                glDeleteProgram(program);
@@ -1295,9 +1309,11 @@ class BasicAllFormatsStoreCS : public ShaderImageLoadStoreBase
                {
                        if (!Equal(map_data[i], expected_value, internalformat))
                        {
-                               Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
-                                          ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
-                                          FormatEnumToString(internalformat).c_str(), unit);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+                                       << ". Value should be: " << ToString(expected_value).c_str()
+                                       << ". Format is: " << FormatEnumToString(internalformat).c_str() << ". Unit is: " << unit << "."
+                                       << tcu::TestLog::EndMessage;
                                glDeleteTextures(1, &texture);
                                glUseProgram(0);
                                glDeleteProgram(program);
@@ -1454,9 +1470,11 @@ class BasicAllFormatsLoadFS : public ShaderImageLoadStoreBase
                {
                        if (!Equal(map_data[i], expected_value, internalformat))
                        {
-                               Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
-                                          ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
-                                          FormatEnumToString(internalformat).c_str(), unit);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+                                       << ". Value should be: " << ToString(expected_value).c_str()
+                                       << ". Format is: " << FormatEnumToString(internalformat).c_str() << ". Unit is: " << unit << "."
+                                       << tcu::TestLog::EndMessage;
                                glUseProgram(0);
                                glDeleteProgram(program);
                                glDeleteTextures(1, &texture);
@@ -1590,9 +1608,11 @@ class BasicAllFormatsLoadCS : public ShaderImageLoadStoreBase
                {
                        if (!Equal(map_data[i], expected_value, internalformat))
                        {
-                               Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
-                                          ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
-                                          FormatEnumToString(internalformat).c_str(), unit);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+                                       << ". Value should be: " << ToString(expected_value).c_str()
+                                       << ". Format is: " << FormatEnumToString(internalformat).c_str() << ". Unit is: " << unit << "."
+                                       << tcu::TestLog::EndMessage;
                                glUseProgram(0);
                                glDeleteProgram(program);
                                glDeleteTextures(1, &texture);
@@ -1708,8 +1728,10 @@ class BasicAllFormatsLoadStoreComputeStage : public ShaderImageLoadStoreBase
                {
                        if (!Equal(map_data[i], expected_value, internalformat))
                        {
-                               Output("[%d] Value is: %s. Value should be: %s. Format is: %s.\n", i, ToString(map_data[i]).c_str(),
-                                          ToString(expected_value).c_str(), FormatEnumToString(internalformat).c_str());
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+                                       << ". Value should be: " << ToString(expected_value).c_str()
+                                       << ". Format is: " << FormatEnumToString(internalformat).c_str() << "." << tcu::TestLog::EndMessage;
                                glDeleteTextures(2, texture);
                                glUseProgram(0);
                                glDeleteProgram(program);
@@ -1904,7 +1926,9 @@ class BasicAllTargetsStoreFS : public ShaderImageLoadStoreBase
                        layers = 6;
                status   = CompareValues(map_data, kSize, expected_value, internalformat, layers);
                if (!status)
-                       Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat).c_str()
+                               << " format failed." << tcu::TestLog::EndMessage;
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
 
                glDeleteTextures(8, textures);
@@ -2144,7 +2168,9 @@ class BasicAllTargetsStoreCS : public ShaderImageLoadStoreBase
                        layers = 6;
                status   = CompareValues(map_data, kSize, expected_value, internalformat, layers);
                if (!status)
-                       Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat).c_str()
+                               << " format failed." << tcu::TestLog::EndMessage;
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
 
                glDeleteTextures(8, textures);
@@ -2395,7 +2421,9 @@ class BasicAllTargetsLoadFS : public ShaderImageLoadStoreBase
                        layers = 6;
                status   = CompareValues(map_data, kSize, expected_value, internalformat, layers);
                if (!status)
-                       Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat).c_str()
+                               << " format failed." << tcu::TestLog::EndMessage;
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
 
                glUseProgram(0);
@@ -2606,7 +2634,9 @@ class BasicAllTargetsLoadCS : public ShaderImageLoadStoreBase
                        layers = 6;
                status   = CompareValues(map_data, kSize, expected_value, internalformat, layers);
                if (!status)
-                       Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat).c_str()
+                               << " format failed." << tcu::TestLog::EndMessage;
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
 
                glUseProgram(0);
@@ -2802,8 +2832,10 @@ class BasicAllTargetsAtomicFS : public ShaderImageLoadStoreBase
                        if (!Equal(out_data[i], ivec4(10, 10, 10, 10), 0))
                        {
                                status = false;
-                               Output("[%d] Atomic operation check failed. (operation/target coded: %s) \n", i,
-                                          ToString(out_data[i]).c_str());
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i
+                                       << "] Atomic operation check failed. (operation/target coded: " << ToString(out_data[i]).c_str()
+                                       << ")" << tcu::TestLog::EndMessage;
                        }
                }
 
@@ -2983,7 +3015,9 @@ class LoadStoreMachine : public ShaderImageLoadStoreBase
                        if (!Equal(out_data[i], ivec4(0, 1, 0, 1), 0))
                        {
                                status = false;
-                               Output("[%d] load/store operation check failed. (%s) \n", i, ToString(out_data[i]).c_str());
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i << "] load/store operation check failed. ("
+                                       << ToString(out_data[i]).c_str() << ")" << tcu::TestLog::EndMessage;
                        }
                }
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
@@ -3216,7 +3250,9 @@ class AtomicMachine : public ShaderImageLoadStoreBase
                        if (!Equal(out_data[i], ivec4(0, 1, 0, 1), 0))
                        {
                                status = false;
-                               Output("[%d] Atomic operation check failed. (%s) \n", i, ToString(out_data[i]).c_str());
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i << "] Atomic operation check failed. ("
+                                       << ToString(out_data[i]).c_str() << ")" << tcu::TestLog::EndMessage;
                        }
                }
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
@@ -3477,8 +3513,10 @@ class BasicGLSLMiscFS : public ShaderImageLoadStoreBase
                        if (!Equal(out_data[i], ivec4(5, 0, 0, 2), 0))
                        {
                                status = false;
-                               Output("[%d] Check failed. Received: %s instead of: %s \n", i, ToString(out_data[i]).c_str(),
-                                          ToString(ivec4(5, 0, 0, 2)).c_str());
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i
+                                       << "] Check failed. Received: " << ToString(out_data[i]).c_str()
+                                       << " instead of: " << ToString(ivec4(5, 0, 0, 2)).c_str() << tcu::TestLog::EndMessage;
                        }
                }
 
@@ -3560,8 +3598,10 @@ class BasicGLSLMiscCS : public ShaderImageLoadStoreBase
                        if (!Equal(out_data[i], ivec4(5, 0, 0, 2), 0))
                        {
                                status = false;
-                               Output("[%d] Check failed. Received: %s instead of: %s \n", i, ToString(out_data[i]).c_str(),
-                                          ToString(ivec4(5, 0, 0, 2)).c_str());
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "[" << i
+                                       << "] Check failed. Received: " << ToString(out_data[i]).c_str()
+                                       << " instead of: " << ToString(ivec4(5, 0, 0, 2)).c_str() << tcu::TestLog::EndMessage;
                        }
                }
 
@@ -3789,8 +3829,9 @@ class BasicGLSLConst : public ShaderImageLoadStoreBase
 
                if (!Equal(map_data[0], ivec4(0, 1, 0, 1), 0))
                {
-                       Output("[%d] Value is: %s. Value should be: %s.\n", i, ToString(map_data[0]).c_str(),
-                                  ToString(ivec4(0, 1, 0, 1)).c_str());
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[0]).c_str()
+                               << ". Value should be: " << ToString(ivec4(0, 1, 0, 1)).c_str() << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                return NO_ERROR;
@@ -5060,7 +5101,9 @@ class NegativeUniform : public ShaderImageLoadStoreBase
 
                if (!status)
                {
-                       Output("glUniform* should generate INVALID_OPERATION if the location refers to an image variable.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "glUniform* should generate INVALID_OPERATION "
+                               << "if the location refers to an image variable." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -5080,8 +5123,9 @@ class NegativeUniform : public ShaderImageLoadStoreBase
 
                if (!status)
                {
-                       Output(
-                               "glProgramUniform* should generate INVALID_OPERATION if the location refers to an image variable.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "glProgramUniform* should generate INVALID_OPERATION "
+                               << "if the location refers to an image variable." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -5121,37 +5165,45 @@ class NegativeBind : public ShaderImageLoadStoreBase
                glBindImageTexture(max_image_units, m_texture, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("BindImageTexture should generate INVALID_VALUE if <unit> is greater than or equal to the value of "
-                                  "MAX_IMAGE_UNITS.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <unit> "
+                               << "is greater than or equal to the value of MAX_IMAGE_UNITS." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
                glBindImageTexture(0, 123, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("BindImageTexture should generate INVALID_VALUE if <texture> is not the name of an existing texture "
-                                  "object.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <texture> "
+                               << "is not the name of an existing texture object." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
                glBindImageTexture(1, m_texture, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("BindImageTexture should generate INVALID_VALUE if <format> is not a legal format.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <format> "
+                               << "is not a legal format." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
                glBindImageTexture(1, m_texture, -1, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("BindImageTexture should generate INVALID_VALUE if <level> is less than zero.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <level> "
+                               << "is less than zero." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
                glBindImageTexture(1, m_texture, 0, GL_FALSE, -1, GL_READ_ONLY, GL_RGBA32F);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("BindImageTexture should generate INVALID_VALUE if <layer> is less than zero.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <layer> "
+                               << "is less than zero." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -5160,7 +5212,9 @@ class NegativeBind : public ShaderImageLoadStoreBase
                glBindImageTexture(1, m_texture2, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
                if (glGetError() != GL_INVALID_OPERATION)
                {
-                       Output("BindImageTexture should generate INVALID_OPERATION if <texture> is a mutable texture object.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <texture> "
+                               << "is a mutable texture object." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -5258,7 +5312,8 @@ class NegativeCompileErrors : public ShaderImageLoadStoreBase
 
                GLchar log[1024];
                glGetShaderInfoLog(sh, sizeof(log), NULL, log);
-               Output("Shader Info Log:\n%s\n", log);
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+                                                                                       << log << tcu::TestLog::EndMessage;
 
                GLint status;
                glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
@@ -5266,7 +5321,8 @@ class NegativeCompileErrors : public ShaderImageLoadStoreBase
 
                if (status == GL_TRUE)
                {
-                       Output("Compilation should fail [compute shader].\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Compilation should fail [compute shader]." << tcu::TestLog::EndMessage;
                        return false;
                }
                const char* const fsVer   = "#version 310 es" NL "precision highp float;";
@@ -5276,14 +5332,15 @@ class NegativeCompileErrors : public ShaderImageLoadStoreBase
                glCompileShader(fsh);
 
                glGetShaderInfoLog(fsh, sizeof(log), NULL, log);
-               Output("Shader Info Log:\n%s\n", log);
-
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+                                                                                       << log << tcu::TestLog::EndMessage;
                glGetShaderiv(fsh, GL_COMPILE_STATUS, &status);
                glDeleteShader(fsh);
 
                if (status == GL_TRUE)
                {
-                       Output("Compilation should fail [fragment shader].\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Compilation should fail [fragment shader]." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -5345,14 +5402,16 @@ class NegativeLinkErrors : public ShaderImageLoadStoreBase
                if (status == GL_FALSE)
                {
                        glDeleteProgram(p);
-                       Output("VS compilation should be ok.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "VS compilation should be ok." << tcu::TestLog::EndMessage;
                        return false;
                }
                glGetShaderiv(fsh, GL_COMPILE_STATUS, &status);
                if (status == GL_FALSE)
                {
                        glDeleteProgram(p);
-                       Output("FS compilation should be ok.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "FS compilation should be ok." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -5360,14 +5419,16 @@ class NegativeLinkErrors : public ShaderImageLoadStoreBase
 
                GLchar log[1024];
                glGetProgramInfoLog(p, sizeof(log), NULL, log);
-               Output("Program Info Log:\n%s\n", log);
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+                                                                                       << log << tcu::TestLog::EndMessage;
 
                glGetProgramiv(p, GL_LINK_STATUS, &status);
                glDeleteProgram(p);
 
                if (status == GL_TRUE)
                {
-                       Output("Link operation should fail.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Link operation should fail." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -5389,7 +5450,6 @@ ShaderImageLoadStoreTests::~ShaderImageLoadStoreTests(void)
 void ShaderImageLoadStoreTests::init()
 {
        using namespace deqp;
-       setOutput(m_context.getTestContext().getLog());
        addChild(new TestSubcase(m_context, "basic-api-get", TestSubcase::Create<BasicAPIGet>));
        addChild(new TestSubcase(m_context, "basic-api-bind", TestSubcase::Create<BasicAPIBind>));
        addChild(new TestSubcase(m_context, "basic-api-barrier", TestSubcase::Create<BasicAPIBarrier>));
index 6bb85cf..d590644 100644 (file)
@@ -74,32 +74,6 @@ enum BindingSeq
        bindrangesize
 };
 
-static tcu::TestLog* currentLog;
-void setOutput(tcu::TestLog& log)
-{
-       currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
-       va_list args;
-       va_start(args, format);
-
-       const int   MAX_OUTPUT_STRING_SIZE = 40000;
-       static char temp[MAX_OUTPUT_STRING_SIZE];
-
-       vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
-       temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
-       char* logLine = strtok(temp, "\n");
-       while (logLine != NULL)
-       {
-               currentLog->writeMessage(logLine);
-               logLine = strtok(NULL, "\n");
-       }
-       va_end(args);
-}
-
 const char* const kGLSLVer = "#version 310 es" NL "precision highp float;" NL "precision highp int;";
 
 class ShaderStorageBufferObjectBase : public deqp::SubcaseBase
@@ -178,17 +152,20 @@ public:
                                        switch (type)
                                        {
                                        case GL_VERTEX_SHADER:
-                                               Output("*** Vertex Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_FRAGMENT_SHADER:
-                                               Output("*** Fragment Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_COMPUTE_SHADER:
-                                               Output("*** Compute Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Compute Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        default:
-                                               Output("*** Unknown Shader ***\n");
-                                               break;
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
                                        }
                                        GLint length;
                                        glGetShaderiv(shaders[i], GL_SHADER_SOURCE_LENGTH, &length);
@@ -196,14 +173,16 @@ public:
                                        {
                                                std::vector<GLchar> source(length);
                                                glGetShaderSource(shaders[i], length, NULL, &source[0]);
-                                               Output("%s\n", &source[0]);
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
                                        }
                                        glGetShaderiv(shaders[i], GL_INFO_LOG_LENGTH, &length);
                                        if (length > 0)
                                        {
                                                std::vector<GLchar> log(length);
                                                glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
-                                               Output("%s\n", &log[0]);
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
                                        }
                                }
                        }
@@ -213,7 +192,7 @@ public:
                        {
                                std::vector<GLchar> log(length);
                                glGetProgramInfoLog(program, length, NULL, &log[0]);
-                               Output("%s\n", &log[0]);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
                        }
                }
 
@@ -278,11 +257,11 @@ public:
                        status = false;
 
                if (!status)
-                       Output("Incorrect framebuffer color at pixel (%d %d). Color is (%f %f %f). "
-                                  "Color should be (%f %f %f).\n",
-                                  x, y, c0[0] / color_max[0], c0[1] / color_max[1], c0[2] / color_max[2], expected[0], expected[1],
-                                  expected[2]);
-
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Incorrect framebuffer color at pixel (" << x << " " << y << "). Color is ("
+                               << c0[0] / color_max[0] << " " << c0[1] / color_max[1] << " " << c0[2] / color_max[2]
+                               << "). Color should be (" << expected[0] << " " << expected[1] << " " << expected[2] << ")."
+                               << tcu::TestLog::EndMessage;
                return status;
        }
 
@@ -304,11 +283,11 @@ public:
                                        fabs(fb[i + 1] / g_color_max[1] - expected[1]) > g_color_eps[1] ||
                                        fabs(fb[i + 2] / g_color_max[2] - expected[2]) > g_color_eps[2])
                                {
-
-                                       Output("Incorrect framebuffer color at pixel (%d %d). Color is (%f %f %f). "
-                                                  "Color should be (%f %f %f).\n",
-                                                  x, y, fb[i + 0] / g_color_max[0], fb[i + 1] / g_color_max[1], fb[i + 2] / g_color_max[2],
-                                                  expected[0], expected[1], expected[2]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Incorrect framebuffer color at pixel (" << x << " " << y
+                                               << "). Color is (" << fb[i + 0] / g_color_max[0] << " " << fb[i + 1] / g_color_max[1] << " "
+                                               << fb[i + 2] / g_color_max[2] << "). Color should be (" << expected[0] << " " << expected[1]
+                                               << " " << expected[2] << ")." << tcu::TestLog::EndMessage;
                                        return false;
                                }
                        }
@@ -346,7 +325,9 @@ public:
                }
                if (!status)
                {
-                       Output("Left-bottom quad checking failed. Bad pixels: %d", bad);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Left-bottom quad checking failed. Bad pixels: " << bad
+                               << tcu::TestLog::EndMessage;
                        //return status;
                }
                // right-bottom quad
@@ -364,7 +345,9 @@ public:
                }
                if (!status)
                {
-                       Output("right-bottom quad checking failed. Bad pixels: %d", bad);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "right-bottom quad checking failed. Bad pixels: " << bad
+                               << tcu::TestLog::EndMessage;
                        //return status;
                }
                // right-top quad
@@ -382,7 +365,9 @@ public:
                }
                if (!status)
                {
-                       Output("right-top quad checking failed. Bad pixels: %d", bad);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "right-top quad checking failed. Bad pixels: " << bad
+                               << tcu::TestLog::EndMessage;
                        //return status;
                }
                // left-top quad
@@ -400,7 +385,9 @@ public:
                }
                if (!status)
                {
-                       Output("left-top quad checking failed. Bad pixels: %d", bad);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "left-top quad checking failed. Bad pixels: " << bad
+                               << tcu::TestLog::EndMessage;
                        //return status;
                }
                // middle horizontal line should be black
@@ -418,7 +405,9 @@ public:
                }
                if (!status)
                {
-                       Output("middle horizontal line checking failed. Bad pixels: %d", bad);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "middle horizontal line checking failed. Bad pixels: " << bad
+                               << tcu::TestLog::EndMessage;
                        //return status;
                }
                // middle vertical line should be black
@@ -436,13 +425,17 @@ public:
                }
                if (!status)
                {
-                       Output("middle vertical line checking failed. Bad pixels: %d", bad);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "middle vertical line checking failed. Bad pixels: " << bad
+                               << tcu::TestLog::EndMessage;
                        //return status;
                }
 
                if (bad_pixels)
                        *bad_pixels = bad;
-               Output("Bad pixels:%d, counted bad:%d\n", bad_pixels == NULL ? 0 : *bad_pixels, bad);
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "Bad pixels: " << (bad_pixels == NULL ? 0 : *bad_pixels)
+                       << ", counted bad: " << bad << tcu::TestLog::EndMessage;
                return status;
        }
 
@@ -627,7 +620,9 @@ class BasicMax : public ShaderStorageBufferObjectBase
 
                        if (!status)
                        {
-                               Output("%s is %d should be at least %d.\n", GLenumToString(e), i, static_cast<GLint>(value));
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << GLenumToString(e) << " is " << i << " should be at least "
+                                       << static_cast<GLint>(value) << tcu::TestLog::EndMessage;
                        }
                }
                else
@@ -641,7 +636,9 @@ class BasicMax : public ShaderStorageBufferObjectBase
 
                        if (!status)
                        {
-                               Output("%s is %d should be at most %d.\n", GLenumToString(e), i, static_cast<GLint>(value));
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << GLenumToString(e) << " is " << i << " should be at most "
+                                       << static_cast<GLint>(value) << tcu::TestLog::EndMessage;
                        }
                }
                return status;
@@ -701,7 +698,8 @@ class BasicBinding : public ShaderStorageBufferObjectBase
 
                if (!status)
                {
-                       Output("%s is %d should be %d.\n", GLenumToString(e), i, expected);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << GLenumToString(e) << " is " << i
+                                                                                               << " should be " << expected << tcu::TestLog::EndMessage;
                }
                return status;
        }
@@ -722,7 +720,8 @@ class BasicBinding : public ShaderStorageBufferObjectBase
 
                if (!status)
                {
-                       Output("%s at index %d is %d should be %d.\n", GLenumToString(e), index, i, expected);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << GLenumToString(e) << " at index " << index
+                                                                                               << " is " << i << " should be " << expected << tcu::TestLog::EndMessage;
                }
                return status;
        }
@@ -1251,7 +1250,9 @@ class BasicStdLayoutBaseVS : public ShaderStorageBufferObjectBase
                {
                        if (in_data[i] != out_data[i])
                        {
-                               Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], in_data[i]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+                                       << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[i]) << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -1320,7 +1321,9 @@ class BasicStdLayoutBaseCS : public ShaderStorageBufferObjectBase
                {
                        if (in_data[i] != out_data[i])
                        {
-                               Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], in_data[i]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+                                       << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[i]) << tcu::TestLog::EndMessage;
                                status = false;
                        }
                        else
@@ -2271,7 +2274,8 @@ class BasicAtomicCase1VSFS : public ShaderStorageBufferObjectBase
                                {
                                        if (data[i] != 7)
                                        {
-                                               Output("uData at index %d is %d should be %d.\n", i, data[i], 7);
+                                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+                                                                                                                       << data[i] << " should be 7." << tcu::TestLog::EndMessage;
                                                return ERROR;
                                        }
                                }
@@ -2287,7 +2291,8 @@ class BasicAtomicCase1VSFS : public ShaderStorageBufferObjectBase
                                {
                                        if (data[i] != 7)
                                        {
-                                               Output("iData at index %d is %d should be %d.\n", i, data[i], 7);
+                                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+                                                                                                                       << data[i] << " should be 7." << tcu::TestLog::EndMessage;
                                                return ERROR;
                                        }
                                }
@@ -2374,7 +2379,8 @@ class BasicAtomicCase1CS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != 7)
                                {
-                                       Output("uData at index %d is %d should be %d.\n", i, data[i], 7);
+                                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+                                                                                                               << data[i] << " should be 7." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -2390,7 +2396,8 @@ class BasicAtomicCase1CS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != 7)
                                {
-                                       Output("iData at index %d is %d should be %d.\n", i, data[i], 7);
+                                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+                                                                                                               << data[i] << " should be 7." << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -2493,7 +2500,8 @@ class BasicAtomicCase3VSFS : public ShaderStorageBufferObjectBase
                        return ERROR;
                if (*u != 16)
                {
-                       Output("Data at offset 0 is %d should be %d.\n", *u, 16);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *u
+                                                                                               << " should be 16." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
@@ -2502,7 +2510,8 @@ class BasicAtomicCase3VSFS : public ShaderStorageBufferObjectBase
                        return ERROR;
                if (*i != 16)
                {
-                       Output("Data at offset 0 is %d should be %d.\n", *i, 16);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *i
+                                                                                               << " should be 16." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
@@ -2572,7 +2581,8 @@ class BasicAtomicCase3CS : public ShaderStorageBufferObjectBase
                        return ERROR;
                if (*u != 16)
                {
-                       Output("Data at offset 0 is %d should be %d.\n", *u, 16);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *u
+                                                                                               << " should be 16." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
@@ -2581,7 +2591,8 @@ class BasicAtomicCase3CS : public ShaderStorageBufferObjectBase
                        return ERROR;
                if (*i != 16)
                {
-                       Output("Data at offset 0 is %d should be %d.\n", *i, 16);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *i
+                                                                                               << " should be 16." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
@@ -2688,7 +2699,8 @@ class BasicAtomicCase4VSFS : public ShaderStorageBufferObjectBase
                {
                        if (udata[i] != i)
                        {
-                               Output("uData at index %d is %d should be %d.\n", i, udata[i], i);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+                                                                                                       << udata[i] << " should be " << i << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -2700,7 +2712,8 @@ class BasicAtomicCase4VSFS : public ShaderStorageBufferObjectBase
                {
                        if (idata[i] != i)
                        {
-                               Output("iData at index %d is %d should be %d.\n", i, idata[i], i);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+                                                                                                       << idata[i] << " should be " << i << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -2773,7 +2786,8 @@ class BasicAtomicCase4CS : public ShaderStorageBufferObjectBase
                {
                        if (udata[i] != i)
                        {
-                               Output("uData at index %d is %d should be %d.\n", i, udata[i], i);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+                                                                                                       << udata[i] << " should be " << i << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -2785,7 +2799,8 @@ class BasicAtomicCase4CS : public ShaderStorageBufferObjectBase
                {
                        if (idata[i] != i)
                        {
-                               Output("iData at index %d is %d should be %d.\n", i, idata[i], i);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+                                                                                                       << idata[i] << " should be " << i << tcu::TestLog::EndMessage;
                                return ERROR;
                        }
                }
@@ -2867,8 +2882,10 @@ class BasicStdLayoutBase2VS : public ShaderStorageBufferObjectBase
                        {
                                if (in_data[j][i] != out_data[i])
                                {
-                                       Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
-                                                  in_data[j][i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+                                               << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+                                               << tcu::TestLog::EndMessage;
                                        status = false;
                                }
                        }
@@ -2947,8 +2964,10 @@ class BasicStdLayoutBase2CS : public ShaderStorageBufferObjectBase
                        {
                                if (in_data[j][i] != out_data[i])
                                {
-                                       Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
-                                                  in_data[j][i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+                                               << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+                                               << tcu::TestLog::EndMessage;
                                        status = false;
                                }
                        }
@@ -3624,7 +3643,9 @@ class BasicOperationsBaseVS : public ShaderStorageBufferObjectBase
                {
                        if (expected_data[i] != out_data[i])
                        {
-                               Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], expected_data[i]);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i)
+                                                                                                       << " is " << tcu::toHex(out_data[i]) << " should be "
+                                                                                                       << tcu::toHex(expected_data[i]) << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -3701,7 +3722,9 @@ class BasicOperationsBaseCS : public ShaderStorageBufferObjectBase
                {
                        if (expected_data[i] != out_data[i])
                        {
-                               Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], expected_data[i]);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i)
+                                                                                                       << " is " << tcu::toHex(out_data[i]) << " should be "
+                                                                                                       << tcu::toHex(expected_data[i]) << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -4013,8 +4036,10 @@ class BasicStdLayoutBase3VS : public ShaderStorageBufferObjectBase
                        {
                                if (in_data[j][i] != out_data[i])
                                {
-                                       Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
-                                                  in_data[j][i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+                                               << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+                                               << tcu::TestLog::EndMessage;
                                        status = false;
                                }
                        }
@@ -4101,8 +4126,10 @@ class BasicStdLayoutBase3CS : public ShaderStorageBufferObjectBase
                        {
                                if (in_data[j][i] != out_data[i])
                                {
-                                       Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
-                                                  in_data[j][i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+                                               << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+                                               << tcu::TestLog::EndMessage;
                                        status = false;
                                }
                        }
@@ -4424,7 +4451,9 @@ class BasicMatrixOperationsBaseVS : public ShaderStorageBufferObjectBase
                {
                        if (!Equal(expected[i], out_data[i]))
                        {
-                               Output("Float at index %3d is %f should be %f.\n", static_cast<int>(i), out_data[i], expected[i]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Float at index " << static_cast<int>(i) << " is " << out_data[i]
+                                       << " should be " << expected[i] << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -4503,7 +4532,9 @@ class BasicMatrixOperationsBaseCS : public ShaderStorageBufferObjectBase
                {
                        if (!Equal(expected[i], out_data[i]))
                        {
-                               Output("Float at index %3d is %f should be %f.\n", static_cast<int>(i), out_data[i], expected[i]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Float at index  " << static_cast<int>(i) << " is " << out_data[i]
+                                       << " should be " << expected[i] << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -5070,8 +5101,11 @@ class AdvancedSwitchBuffersCS : public ShaderStorageBufferObjectBase
                if (out_data[0] != expected[0] || out_data[1] != expected[1] || out_data[2] != expected[2] ||
                        out_data[3] != expected[3])
                {
-                       Output("Received: %x, %x, %x, %x, but expected: %x, %x, %x, %x\n", out_data[0], out_data[1], out_data[2],
-                                  out_data[3], expected[0], expected[1], expected[2], expected[3]);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Received: " << tcu::toHex(out_data[0]) << ", " << tcu::toHex(out_data[1])
+                               << ", " << tcu::toHex(out_data[2]) << ", " << tcu::toHex(out_data[3])
+                               << ", but expected: " << tcu::toHex(expected[0]) << ", " << tcu::toHex(expected[1]) << ", "
+                               << tcu::toHex(expected[2]) << ", " << tcu::toHex(expected[3]) << ", " << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
@@ -5090,8 +5124,11 @@ class AdvancedSwitchBuffersCS : public ShaderStorageBufferObjectBase
                if (out_data[0] != expected[0] || out_data[1] != expected[1] || out_data[2] != expected[2] ||
                        out_data[3] != expected[3])
                {
-                       Output("Received: %x, %x, %x, %x, but expected: %x, %x, %x, %x\n", out_data[0], out_data[1], out_data[2],
-                                  out_data[3], expected[0], expected[1], expected[2], expected[3]);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Received: " << tcu::toHex(out_data[0]) << ", " << tcu::toHex(out_data[1])
+                               << ", " << tcu::toHex(out_data[2]) << ", " << tcu::toHex(out_data[3])
+                               << ", but expected: " << tcu::toHex(expected[0]) << ", " << tcu::toHex(expected[1]) << ", "
+                               << tcu::toHex(expected[2]) << ", " << tcu::toHex(expected[3]) << ", " << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -5298,8 +5335,11 @@ class AdvancedSwitchProgramsCS : public ShaderStorageBufferObjectBase
                if (out_data[0] != expected[0] || out_data[1] != expected[1] || out_data[2] != expected[2] ||
                        out_data[3] != expected[3])
                {
-                       Output("Received: %x, %x, %x, %x, but expected: %x, %x, %x, %x\n", out_data[0], out_data[1], out_data[2],
-                                  out_data[3], expected[0], expected[1], expected[2], expected[3]);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Received: " << tcu::toHex(out_data[0]) << ", " << tcu::toHex(out_data[1])
+                               << ", " << tcu::toHex(out_data[2]) << ", " << tcu::toHex(out_data[3])
+                               << ", but expected: " << tcu::toHex(expected[0]) << ", " << tcu::toHex(expected[1]) << ", "
+                               << tcu::toHex(expected[2]) << ", " << tcu::toHex(expected[3]) << ", " << tcu::TestLog::EndMessage;
                        return ERROR;
                }
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
@@ -5813,8 +5853,10 @@ class AdvancedIndirectAddressingCase1CS : public ShaderStorageBufferObjectBase
                        if (out_data[i * 4 + 0] != expected[i * 4 + 0] || out_data[i * 4 + 1] != expected[i * 4 + 1] ||
                                out_data[i * 4 + 2] != expected[i * 4 + 2])
                        {
-                               Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data[i * 4 + 0], out_data[i * 4 + 1],
-                                          out_data[i * 4 + 2], expected[i * 4 + 0], expected[i * 4 + 1], expected[i * 4 + 2]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 0] << ", " << out_data[i * 4 + 1]
+                                       << ", " << out_data[i * 4 + 2] << ", but expected: " << expected[i * 4 + 0] << ", "
+                                       << expected[i * 4 + 1] << ", " << expected[i * 4 + 2] << ", " << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -5823,8 +5865,10 @@ class AdvancedIndirectAddressingCase1CS : public ShaderStorageBufferObjectBase
                        if (fabs(out_data[i * 2 + 0] - expected[i * 2 + 0]) > 1e-6 ||
                                fabs(out_data[i * 2 + 1] - expected[i * 2 + 1]) > 1e-6)
                        {
-                               Output("Received: %f, %f, but expected: %f, %f\n", out_data[i * 2 + 0], out_data[i * 2 + 1],
-                                          expected[i * 2 + 0], expected[i * 2 + 1]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Received: " << out_data[i * 2 + 0] << ", " << out_data[i * 2 + 1]
+                                       << ", but expected: " << expected[i * 2 + 0] << ", " << expected[i * 2 + 1] << ", "
+                                       << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -5866,8 +5910,10 @@ class AdvancedIndirectAddressingCase1CS : public ShaderStorageBufferObjectBase
                        if (out_data2[i * 4 + 0] != expected2[i * 4 + 0] || out_data2[i * 4 + 1] != expected2[i * 4 + 1] ||
                                out_data2[i * 4 + 2] != expected2[i * 4 + 2])
                        {
-                               Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data2[i * 4 + 0], out_data2[i * 4 + 1],
-                                          out_data2[i * 4 + 2], expected2[i * 4 + 0], expected2[i * 4 + 1], expected2[i * 4 + 2]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Received: " << out_data2[i * 4 + 0] << ", " << out_data2[i * 4 + 1]
+                                       << ", " << out_data2[i * 4 + 2] << ", but expected: " << expected2[i * 4 + 0] << ", "
+                                       << expected2[i * 4 + 1] << ", " << expected2[i * 4 + 2] << ", " << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -5876,8 +5922,10 @@ class AdvancedIndirectAddressingCase1CS : public ShaderStorageBufferObjectBase
                        if (fabs(out_data2[i * 2 + 0] - expected2[i * 2 + 0]) > 1e-6 ||
                                fabs(out_data2[i * 2 + 1] - expected2[i * 2 + 1]) > 1e-6)
                        {
-                               Output("Received: %f, %f, but expected: %f, %f\n", out_data2[i * 2 + 0], out_data2[i * 2 + 1],
-                                          expected2[i * 2 + 0], expected2[i * 2 + 1]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Received: " << out_data2[i * 2 + 0] << ", " << out_data2[i * 2 + 1]
+                                       << ", but expected: " << expected2[i * 2 + 0] << ", " << expected2[i * 2 + 1] << ", "
+                                       << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -6133,8 +6181,10 @@ class AdvancedIndirectAddressingCase2CS : public ShaderStorageBufferObjectBase
                        if (out_data[i * 4 + 0] != expected[0] || out_data[i * 4 + 1] != expected[1] ||
                                out_data[i * 4 + 2] != expected[2])
                        {
-                               Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data[i * 4 + 0], out_data[i * 4 + 1],
-                                          out_data[i * 4 + 2], expected[0], expected[1], expected[2]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 0] << ", " << out_data[i * 4 + 1]
+                                       << ", " << out_data[i * 4 + 2] << ", but expected: " << expected[i * 4 + 0] << ", "
+                                       << expected[i * 4 + 1] << ", " << expected[i * 4 + 2] << ", " << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -6151,8 +6201,10 @@ class AdvancedIndirectAddressingCase2CS : public ShaderStorageBufferObjectBase
                        if (out_data[i * 4 + 0] != expected[0] || out_data[i * 4 + 1] != expected[1] ||
                                out_data[i * 4 + 2] != expected[2])
                        {
-                               Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data[i * 4 + 0], out_data[i * 4 + 1],
-                                          out_data[i * 4 + 2], expected[0], expected[1], expected[2]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 0] << ", " << out_data[i * 4 + 1]
+                                       << ", " << out_data[i * 4 + 2] << ", but expected: " << expected[0] << ", " << expected[1] << ", "
+                                       << expected[2] << ", " << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -6330,8 +6382,10 @@ class AdvancedReadWriteCase1CS : public ShaderStorageBufferObjectBase
                {
                        if (out_data[i * 4 + 3] != data[i * 4])
                        {
-                               Output("Received: %d, but expected: %d -> %d -> %d\n", out_data[i * 4 + 3], data[i * 4],
-                                          out_data[i * 4 + 1], out_data[i * 4 + 2]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 3] << ", but expected: " << data[i * 4]
+                                       << " -> " << out_data[i * 4 + 1] << " -> " << out_data[i * 4 + 2] << " -> "
+                                       << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -6354,7 +6408,8 @@ class AdvancedReadWriteCase1CS : public ShaderStorageBufferObjectBase
                {
                        if (out_data[i * 4 + 3] != data[i * 4])
                        {
-                               Output("Received: %d, but expected: %d\n", out_data[i * 4 + 3], data[i * 4]);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 3]
+                                                                                                       << ", but expected: " << data[i * 4] << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -6615,7 +6670,9 @@ class AdvancedUsageSyncVSFS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6632,7 +6689,9 @@ class AdvancedUsageSyncVSFS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer1] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer1] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6649,7 +6708,9 @@ class AdvancedUsageSyncVSFS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer2] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer2] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6666,7 +6727,9 @@ class AdvancedUsageSyncVSFS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer3] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer3] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6683,7 +6746,9 @@ class AdvancedUsageSyncVSFS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer4] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer4] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6700,7 +6765,9 @@ class AdvancedUsageSyncVSFS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer5] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer5] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6717,7 +6784,9 @@ class AdvancedUsageSyncVSFS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer6] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer6] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6841,7 +6910,9 @@ class AdvancedUsageSyncCS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6858,7 +6929,9 @@ class AdvancedUsageSyncCS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer1] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer1] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6875,7 +6948,9 @@ class AdvancedUsageSyncCS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer2] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer2] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6892,7 +6967,9 @@ class AdvancedUsageSyncCS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer3] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer3] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6909,7 +6986,9 @@ class AdvancedUsageSyncCS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer4] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer4] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6926,7 +7005,9 @@ class AdvancedUsageSyncCS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer5] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer5] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -6943,7 +7024,9 @@ class AdvancedUsageSyncCS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer6] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer6] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -7030,7 +7113,9 @@ class AdvancedUsageOperatorsVS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -7047,7 +7132,9 @@ class AdvancedUsageOperatorsVS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer1] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer1] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -7124,7 +7211,9 @@ class AdvancedUsageOperatorsCS : public ShaderStorageBufferObjectBase
                        {
                                if (data[i] != ref_data[i])
                                {
-                                       Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+                                       m_context.getTestContext().getLog()
+                                               << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+                                               << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
                                        return ERROR;
                                }
                        }
@@ -7271,12 +7360,16 @@ class AdvancedUnsizedArrayLength : public ShaderStorageBufferObjectBase
                for (int i = 0; i < kBufs - 1; ++i)
                        if (dataout[i + 1] != sizes[i])
                        {
-                               Output("Array %d length is %d should be %d.\n", i, dataout[i + 1], sizes[i]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Array " << i << " length is " << dataout[i + 1] << " should be "
+                                       << sizes[i] << tcu::TestLog::EndMessage;
                                status = false;
                        }
                if (dataout[0] != sizes[kBufs - 1] - 1)
                {
-                       Output("Array %d length is %d should be %d.\n", kBufs - 1, dataout[0], sizes[kBufs - 1] - 1);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Array " << (kBufs - 1) << " length is " << dataout[0] << " should be "
+                               << (sizes[kBufs - 1] - 1) << tcu::TestLog::EndMessage;
                        status = false;
                }
                glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
@@ -7519,12 +7612,16 @@ class AdvancedUnsizedArrayLength2 : public ShaderStorageBufferObjectBase
                                sizes[i] -= 2; // space constrained by offset of range size
                        if ((layout == std140 || layout == std430) && dataout[i] != sizes[i])
                        {
-                               Output("Array %d length is %d should be %d.\n", i, dataout[i], sizes[i]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Array " << i << " length is " << dataout[i] << " should be "
+                                       << sizes[i] << tcu::TestLog::EndMessage;
                                status = false;
                        }
                        if ((layout == packed || layout == shared) && (dataout[i] > sizes[i]))
                        {
-                               Output("Array %d length is %d should be not greater that %d.\n", i, dataout[i], sizes[i]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Array " << i << " length is " << dataout[i]
+                                       << " should be not greater that " << sizes[i] << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -7539,7 +7636,8 @@ class AdvancedUnsizedArrayLength2 : public ShaderStorageBufferObjectBase
                        int i = (sizes[4] - 2) * columns[etype][4] * scalars[etype][4];
                        if (dataout[i] != 82)
                        {
-                               Output("Array 4 index %d is %d should be 82.\n", i, dataout[i]);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Array 4 index " << i << " is "
+                                                                                                       << dataout[i] << " should be 82." << tcu::TestLog::EndMessage;
                                status = false;
                        }
                        glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
@@ -7550,7 +7648,8 @@ class AdvancedUnsizedArrayLength2 : public ShaderStorageBufferObjectBase
                        i = (sizes[6] - 2) * columns[etype][6] * scalars[etype][6];
                        if (dataout[i] != 82)
                        {
-                               Output("Array 6 index %d is %d should be 82.\n", i, dataout[i]);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Array 6 index " << i << " is "
+                                                                                                       << dataout[i] << " should be 82." << tcu::TestLog::EndMessage;
                                status = false;
                        }
                        glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
@@ -8030,7 +8129,8 @@ class AdvancedMatrixCS : public ShaderStorageBufferObjectBase
                {
                        if (out_data[i] != expected[i])
                        {
-                               Output("Received: %f, but expected: %f\n", out_data[i], expected[i]);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Received: " << out_data[i]
+                                                                                                       << ", but expected: " << expected[i] << tcu::TestLog::EndMessage;
                                status = false;
                        }
                }
@@ -8061,25 +8161,29 @@ class NegativeAPIBind : public ShaderStorageBufferObjectBase
                GLint  alignment;
                GLuint buffer;
                glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &bindings);
-               Output("Max storage buffer bindings %d\n", bindings);
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "Max storage buffer bindings " << bindings << tcu::TestLog::EndMessage;
                glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &alignment);
-               Output("Storage buffer offset alignment %d\n", alignment);
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "Storage buffer offset alignment " << alignment << tcu::TestLog::EndMessage;
 
                glBindBufferBase(GL_SHADER_STORAGE_BUFFER, bindings, 0);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("INVALID_VALUE is generated by BindBufferBase if <target> is\n"
-                                  "SHADER_STORAGE_BUFFER and <index> is greater than or equal to the value of\n"
-                                  "MAX_SHADER_STORAGE_BUFFER_BINDINGS.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_VALUE is generated by BindBufferBase if <target> is\n"
+                               << "SHADER_STORAGE_BUFFER and <index> is greater than or equal to the value of\n"
+                               << "MAX_SHADER_STORAGE_BUFFER_BINDINGS." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
                glBindBufferRange(GL_SHADER_STORAGE_BUFFER, bindings, 0, 0, 0);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("INVALID_VALUE is generated by BindBufferRange if <target> is\n"
-                                  "SHADER_STORAGE_BUFFER and <index> is greater than or equal to the value of\n"
-                                  "MAX_SHADER_STORAGE_BUFFER_BINDINGS.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_VALUE is generated by BindBufferBase if <target> is\n"
+                               << "SHADER_STORAGE_BUFFER and <index> is greater than or equal to the value of\n"
+                               << "MAX_SHADER_STORAGE_BUFFER_BINDINGS." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -8087,9 +8191,10 @@ class NegativeAPIBind : public ShaderStorageBufferObjectBase
                glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 0, buffer, alignment - 1, 0);
                if (glGetError() != GL_INVALID_VALUE)
                {
-                       Output("INVALID_VALUE is generated by BindBufferRange if <target> is\n"
-                                  "SHADER_STORAGE_BUFFER and <offset> is not a multiple of the value of\n"
-                                  "SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "INVALID_VALUE is generated by BindBufferBase if <target> is\n"
+                               << "SHADER_STORAGE_BUFFER and <offset>  is not a multiple of the value of\n"
+                               << "SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT." << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -8226,7 +8331,8 @@ class NegativeGLSLCompileTime : public ShaderStorageBufferObjectBase
 
                GLchar log[1024];
                glGetShaderInfoLog(sh, sizeof(log), NULL, log);
-               Output("Shader Info Log:\n%s\n", log);
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+                                                                                       << log << tcu::TestLog::EndMessage;
 
                GLint status;
                glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
@@ -8234,7 +8340,8 @@ class NegativeGLSLCompileTime : public ShaderStorageBufferObjectBase
 
                if (status == GL_TRUE)
                {
-                       Output("Compilation should fail.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Compilation should fail." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -8290,7 +8397,8 @@ class NegativeGLSLLinkTime : public ShaderStorageBufferObjectBase
                        glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
                        if (status == GL_FALSE)
                        {
-                               Output("VS compilation should be ok.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "VS compilation should be ok." << tcu::TestLog::EndMessage;
                                CheckProgram(p);
                                glDeleteProgram(p);
                                return false;
@@ -8309,7 +8417,8 @@ class NegativeGLSLLinkTime : public ShaderStorageBufferObjectBase
                        glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
                        if (status == GL_FALSE)
                        {
-                               Output("FS compilation should be ok.\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "FS compilation should be ok." << tcu::TestLog::EndMessage;
                                CheckProgram(p);
                                glDeleteProgram(p);
                                return false;
@@ -8320,7 +8429,8 @@ class NegativeGLSLLinkTime : public ShaderStorageBufferObjectBase
 
                GLchar log[1024];
                glGetProgramInfoLog(p, sizeof(log), NULL, log);
-               Output("Program Info Log:\n%s\n", log);
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+                                                                                       << log << tcu::TestLog::EndMessage;
 
                GLint status;
                glGetProgramiv(p, GL_LINK_STATUS, &status);
@@ -8328,7 +8438,8 @@ class NegativeGLSLLinkTime : public ShaderStorageBufferObjectBase
 
                if (status == GL_TRUE)
                {
-                       Output("Link operation should fail.\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Link operation should fail." << tcu::TestLog::EndMessage;
                        return false;
                }
 
@@ -8349,7 +8460,6 @@ ShaderStorageBufferObjectTests::~ShaderStorageBufferObjectTests(void)
 void ShaderStorageBufferObjectTests::init()
 {
        using namespace deqp;
-       setOutput(m_context.getTestContext().getLog());
        addChild(new TestSubcase(m_context, "basic-basic-vs", TestSubcase::Create<BasicBasicVS>));
        addChild(new TestSubcase(m_context, "basic-basic-cs", TestSubcase::Create<BasicBasicCS>));
        addChild(new TestSubcase(m_context, "basic-max", TestSubcase::Create<BasicMax>));
index 1d0b0f4..8bfd856 100644 (file)
@@ -36,32 +36,6 @@ using namespace glw;
 namespace
 {
 
-static tcu::TestLog* currentLog;
-void setOutput(tcu::TestLog& log)
-{
-       currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
-       va_list args;
-       va_start(args, format);
-
-       const int   MAX_OUTPUT_STRING_SIZE = 40000;
-       static char temp[MAX_OUTPUT_STRING_SIZE];
-
-       vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
-       temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
-       char* logLine = strtok(temp, "\n");
-       while (logLine != NULL)
-       {
-               currentLog->writeMessage(logLine);
-               logLine = strtok(NULL, "\n");
-       }
-       va_end(args);
-}
-
 class PIQBase : public deqp::SubcaseBase
 {
 
@@ -112,7 +86,8 @@ protected:
                glGetProgramInfoLog(program, sizeof(log), &length, log);
                if (length > 1)
                {
-                       Output("Program Info Log:\n%s\n", log);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+                                                                                               << log << tcu::TestLog::EndMessage;
                }
        }
 
@@ -217,13 +192,15 @@ protected:
                GLenum tmp = glGetError();
                if (tmp == expected)
                {
-                       Output("Found expected error\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Found expected error" << tcu::TestLog::EndMessage;
                        error = NO_ERROR; // Error is expected
                }
                else
                {
                        error = ERROR;
-                       Output("%d error was expected, found: %d.\n", expected, tmp);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << expected
+                                                                                               << " error was expected, found: " << tmp << tcu::TestLog::EndMessage;
                }
        }
 
@@ -234,7 +211,8 @@ protected:
                glGetProgramInterfaceiv(program, programInterface, pname, &res);
                if (res != expected)
                {
-                       Output("ERROR: Got %d, expected %d\n", res, expected);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res << ", expected "
+                                                                                               << expected << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
        }
@@ -245,7 +223,8 @@ protected:
                GLuint res = glGetProgramResourceIndex(program, programInterface, name.c_str());
                if (res != expected)
                {
-                       Output("ERROR: Got %d, expected %d\n", res, expected);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res << ", expected "
+                                                                                               << expected << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
        }
@@ -257,7 +236,8 @@ protected:
                GLuint res = glGetProgramResourceIndex(program, programInterface, name.c_str());
                if (res == GL_INVALID_INDEX)
                {
-                       Output("ERROR: Got %d, expected number other than -1\n", res);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res
+                                                                                               << ", expected number other than -1" << tcu::TestLog::EndMessage;
                        error = ERROR;
                        return;
                }
@@ -266,7 +246,8 @@ protected:
                {
                        if (it->second == res)
                        {
-                               Output("ERROR: Duplicated value found: %d\n", res);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "ERROR: Duplicated value found: " << res << tcu::TestLog::EndMessage;
                                error = ERROR;
                                return;
                        }
@@ -283,12 +264,16 @@ protected:
                glGetProgramResourceName(program, programInterface, index, 1024, &len, name);
                if (len <= 0 || len > 1023 || name[len - 1] == '\0')
                {
-                       Output("ERROR: Length in glGetProgramResourceName should not count null terminator!\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message
+                               << "ERROR: Length in glGetProgramResourceName should not count null terminator!"
+                               << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
                else if (name != expected || name[len] != '\0')
                {
-                       Output("ERROR: Got %s, expected %s\n", name, expected.c_str());
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << name << ", expected "
+                                                                                               << expected << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
        }
@@ -299,7 +284,8 @@ protected:
                GLint res = glGetProgramResourceLocation(program, programInterface, name.c_str());
                if (res != expected)
                {
-                       Output("ERROR: Got %d, expected %d\n", res, expected);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res << ", expected "
+                                                                                               << expected << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
        }
@@ -311,7 +297,8 @@ protected:
                GLint res = glGetProgramResourceLocation(program, programInterface, name.c_str());
                if (res < 0)
                {
-                       Output("ERROR: Got %d, expected not less than 0\n", res);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res
+                                                                                               << ", expected not less than 0" << tcu::TestLog::EndMessage;
                        error = ERROR;
                        return;
                }
@@ -320,7 +307,8 @@ protected:
                {
                        if (it->second == res)
                        {
-                               Output("ERROR: Duplicated value found: %d\n", res);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "ERROR: Duplicated value found: " << res << tcu::TestLog::EndMessage;
                                error = ERROR;
                                return;
                        }
@@ -340,8 +328,10 @@ protected:
                if (length != expectedLength || length <= 0)
                {
                        error = ERROR;
-                       Output("ERROR: Got length %d, expected %d\n", length, expectedLength);
-                       Output("CALL: glGetProgramResourceiv, with %d, %d\n", programInterface, index);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "ERROR: Got length " << length << ", expected " << expectedLength
+                               << "\nCALL: glGetProgramResourceiv, with " << programInterface << ", " << index
+                               << tcu::TestLog::EndMessage;
                        return;
                }
                for (int i = 0; i < length; ++i)
@@ -349,8 +339,10 @@ protected:
                        if (params[i] != expected[i])
                        {
                                error = ERROR;
-                               Output("ERROR: Got %d, expected %d at: %d\n", params[i], expected[i], i);
-                               Output("CALL: glGetProgramResourceiv, with %d, %d\n", programInterface, index);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "ERROR: Got " << params[i] << ", expected " << expected[i]
+                                       << " at: " << i << "\nCALL: glGetProgramResourceiv, with " << programInterface << ", " << index
+                                       << tcu::TestLog::EndMessage;
                        }
                }
        }
@@ -361,8 +353,9 @@ protected:
                GLint res = glGetProgramResourceLocationIndex(program, programInterface, name.c_str());
                if (res != expected)
                {
-                       Output("ERROR: Got %d, expected %d\n", res, expected);
-                       Output("CALL: glGetProgramResourceLocationIndex, with %d, %s\n", programInterface, name.c_str());
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res << ", expected "
+                                                                                               << expected << "\nCALL: glGetProgramResourceLocationIndex, with "
+                                                                                               << programInterface << ", " << name << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
        }
@@ -1752,15 +1745,20 @@ class UniformBlockTypes : public PIQBase
                {
                        if (exp.find(param[i]) == exp.end())
                        {
-                               Output("Unexpected index found in active variables of SimpleBlock: %d\n", param[i]);
-                               Output("Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message
+                                       << "Unexpected index found in active variables of SimpleBlock: " << param[i]
+                                       << "\nCall: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK"
+                                       << tcu::TestLog::EndMessage;
                                glDeleteProgram(program);
                                return ERROR;
                        }
                        else if (length != 3)
                        {
-                               Output("Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK\n");
-                               Output("Expected length: 3, actual length: %d\n", length);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message
+                                       << "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK\n"
+                                       << "Expected length: 3, actual length: " << length << tcu::TestLog::EndMessage;
                                glDeleteProgram(program);
                                return ERROR;
                        }
@@ -1775,15 +1773,20 @@ class UniformBlockTypes : public PIQBase
                {
                        if (exp2.find(param[i]) == exp2.end())
                        {
-                               Output("Unexpected index found in active variables of NotSoSimpleBlockk: %d\n", param[i]);
-                               Output("Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message
+                                       << "Unexpected index found in active variables of NotSoSimpleBlockk: " << param[i]
+                                       << "\nCall: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK"
+                                       << tcu::TestLog::EndMessage;
                                glDeleteProgram(program);
                                return ERROR;
                        }
                        else if (length != 3)
                        {
-                               Output("Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK\n");
-                               Output("Expected length: 3, actual length: %d\n", length);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message
+                                       << "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK"
+                                       << "\nExpected length: 3, actual length: " << length << tcu::TestLog::EndMessage;
                                glDeleteProgram(program);
                                return ERROR;
                        }
@@ -1793,7 +1796,9 @@ class UniformBlockTypes : public PIQBase
                glGetProgramInterfaceiv(program, GL_UNIFORM_BLOCK, GL_MAX_NUM_ACTIVE_VARIABLES, &res);
                if (res < 3)
                {
-                       Output("Value of GL_MAX_NUM_ACTIVE_VARIABLES less than 3!\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Value of GL_MAX_NUM_ACTIVE_VARIABLES less than 3!"
+                               << tcu::TestLog::EndMessage;
                        glDeleteProgram(program);
                        return ERROR;
                }
@@ -2003,13 +2008,17 @@ public:
                {
                        if (exp.find(param[i]) == exp.end() || length != 2)
                        {
-                               Output("Length: %d\n", length);
-                               Output("Unexpected index/length found in active variables of ATOMIC_COUNTER_BUFFER: %d\n", param[i]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Length: " << length
+                                       << "\nUnexpected index/length found in active variables of ATOMIC_COUNTER_BUFFER: " << param[i]
+                                       << tcu::TestLog::EndMessage;
                                glDeleteProgram(program);
                                return ERROR;
                        }
                }
-               Output("GL_ACTIVE_VARIABLES ok for 1st ATOMIC_COUNTER_BUFFER\n");
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "GL_ACTIVE_VARIABLES ok for 1st ATOMIC_COUNTER_BUFFER"
+                       << tcu::TestLog::EndMessage;
                std::set<GLuint> exp2;
                GLint                    param2[bufSize];
                exp2.insert(indicesU["d"]);
@@ -2020,8 +2029,10 @@ public:
                {
                        if (exp2.find(param2[i]) == exp2.end() || length != 2)
                        {
-                               Output("Length: %d\n", length);
-                               Output("Unexpected index/length found in active variables of ATOMIC_COUNTER_BUFFER: %d\n", param2[i]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Length: " << length
+                                       << "\nUnexpected index/length found in active variables of ATOMIC_COUNTER_BUFFER: " << param2[i]
+                                       << tcu::TestLog::EndMessage;
                                glDeleteProgram(program);
                                return ERROR;
                        }
@@ -2185,9 +2196,10 @@ protected:
                {
                        if (exp.find(param[i]) == exp.end() || length != 2)
                        {
-                               Output("Length: %d\n", length);
-                               Output("Unexpected index/length found in active variables of GL_VERTEX_SUBROUTINE_UNIFORM: %d\n",
-                                          param[i]);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Length: " << length
+                                       << "\nUnexpected index/length found in active variables of GL_VERTEX_SUBROUTINE_UNIFORM: "
+                                       << param[i] << tcu::TestLog::EndMessage;
                                error = ERROR;
                        }
                }
@@ -2562,26 +2574,34 @@ class SoubroutinesCompute : public PIQBase
                                        switch (type)
                                        {
                                        case GL_VERTEX_SHADER:
-                                               Output("*** Vertex Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_TESS_CONTROL_SHADER:
-                                               Output("*** Tessellation Control Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Tessellation Control Shader ***"
+                                                       << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_TESS_EVALUATION_SHADER:
-                                               Output("*** Tessellation Evaluation Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Tessellation Evaluation Shader ***"
+                                                       << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_GEOMETRY_SHADER:
-                                               Output("*** Geometry Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Geometry Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_FRAGMENT_SHADER:
-                                               Output("*** Fragment Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_COMPUTE_SHADER:
-                                               Output("*** Compute Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Compute Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        default:
-                                               Output("*** Unknown Shader ***\n");
-                                               break;
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
                                        }
 
                                        GLint res;
@@ -2596,7 +2616,8 @@ class SoubroutinesCompute : public PIQBase
                                        {
                                                std::vector<GLchar> source(length);
                                                glGetShaderSource(shaders[i], length, NULL, &source[0]);
-                                               Output("%s\n", &source[0]);
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
                                        }
 
                                        // shader info log
@@ -2605,7 +2626,8 @@ class SoubroutinesCompute : public PIQBase
                                        {
                                                std::vector<GLchar> log(length);
                                                glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
-                                               Output("%s\n", &log[0]);
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
                                        }
                                }
                        }
@@ -2617,7 +2639,7 @@ class SoubroutinesCompute : public PIQBase
                        {
                                std::vector<GLchar> log(length);
                                glGetProgramInfoLog(program, length, NULL, &log[0]);
-                               Output("%s\n", &log[0]);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
                        }
                }
 
@@ -2731,7 +2753,9 @@ class InvalidValueTest : public SimpleShaders
                GLchar  name[100] = { '\0' };
                GLenum  props[1]  = { GL_NAME_LENGTH };
 
-               Output("Case 1: <program> not a name of shader/program object\n");
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "Case 1: <program> not a name of shader/program object"
+                       << tcu::TestLog::EndMessage;
                glGetProgramInterfaceiv(1337u, GL_PROGRAM_INPUT, GL_ACTIVE_RESOURCES, &res);
                ExpectError(GL_INVALID_VALUE, error);
                glGetProgramResourceIndex(31337u, GL_PROGRAM_INPUT, "pie");
@@ -2744,22 +2768,27 @@ class InvalidValueTest : public SimpleShaders
                ExpectError(GL_INVALID_VALUE, error);
                glGetProgramResourceLocationIndex(1337u, GL_PROGRAM_OUTPUT, "pie");
                ExpectError(GL_INVALID_VALUE, error);
-               Output("Case 1 finished\n");
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 1 finished" << tcu::TestLog::EndMessage;
 
                GLuint program = CreateProgram(VertexShader().c_str(), FragmentShader().c_str(), false);
                glBindAttribLocation(program, 0, "position");
                glBindFragDataLocation(program, 0, "color");
                LinkProgram(program);
 
-               Output("Case 2: <index> is greater than the number of the active resources in GetProgramResourceName\n");
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message
+                       << "Case 2: <index> is greater than the number of the active resources in GetProgramResourceName"
+                       << tcu::TestLog::EndMessage;
                glGetProgramResourceName(program, GL_PROGRAM_INPUT, 3000, 1024, &len, name);
                ExpectError(GL_INVALID_VALUE, error);
-               Output("Case 2 finished\n");
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 2 finished" << tcu::TestLog::EndMessage;
 
-               Output("Case 3: <propCount> is zero in GetProgramResourceiv\n");
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "Case 3: <propCount> is zero in GetProgramResourceiv"
+                       << tcu::TestLog::EndMessage;
                glGetProgramResourceiv(program, GL_PROGRAM_INPUT, 0, 0, props, 1024, &len, &res);
                ExpectError(GL_INVALID_VALUE, error);
-               Output("Case 3 finished\n");
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 3 finished" << tcu::TestLog::EndMessage;
 
                std::string str = "position";
                glGetProgramResourceName(program, GL_PROGRAM_INPUT, 0, -100, NULL, const_cast<char*>(str.c_str()));
@@ -2809,18 +2838,21 @@ class InvalidEnumTest : public AtomicCounterSimple
                GLchar  name[100] = { '\0' };
                GLenum  props[1]  = { GL_TEXTURE_1D };
 
-               Output("Case 1: <programInterface> is ATOMIC_COUNTER_BUFFER in GetProgramResourceIndex or "
-                          "GetProgramResourceName\n");
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "Case 1: <programInterface> is ATOMIC_COUNTER_BUFFER "
+                       << "in GetProgramResourceIndex or GetProgramResourceName" << tcu::TestLog::EndMessage;
                glGetProgramResourceIndex(program, GL_ATOMIC_COUNTER_BUFFER, name);
                ExpectError(GL_INVALID_ENUM, error);
                glGetProgramResourceName(program, GL_ATOMIC_COUNTER_BUFFER, 0, 1024, &len, name);
                ExpectError(GL_INVALID_ENUM, error);
-               Output("Case 1 finished\n");
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 1 finished" << tcu::TestLog::EndMessage;
 
-               Output("Case 2: <props> is not a property name supported by the command GetProgramResourceiv\n");
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "Case 2: <props> is not a property name supported by "
+                       << "the command GetProgramResourceiv" << tcu::TestLog::EndMessage;
                glGetProgramResourceiv(program, GL_PROGRAM_INPUT, 0, 1, props, 1024, &len, &res);
                ExpectError(GL_INVALID_ENUM, error);
-               Output("Case 2 finished\n");
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 2 finished" << tcu::TestLog::EndMessage;
 
                glGetProgramResourceLocation(program, GL_ATOMIC_COUNTER_BUFFER, "position");
                ExpectError(GL_INVALID_ENUM, error);
@@ -2868,7 +2900,8 @@ class InvalidOperationTest : public SimpleShaders
                GLchar           name[100] = { '\0' };
                GLenum           props[1]  = { GL_OFFSET };
 
-               Output("Case 1: <program> is the name of a shader object\n");
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "Case 1: <program> is the name of a shader object" << tcu::TestLog::EndMessage;
                glGetProgramInterfaceiv(sh, GL_PROGRAM_INPUT, GL_ACTIVE_RESOURCES, &res);
                ExpectError(GL_INVALID_OPERATION, error);
                glGetProgramResourceIndex(sh, GL_PROGRAM_INPUT, "pie");
@@ -2882,24 +2915,28 @@ class InvalidOperationTest : public SimpleShaders
                glGetProgramResourceLocationIndex(sh, GL_PROGRAM_OUTPUT, "pie");
                ExpectError(GL_INVALID_OPERATION, error);
                glDeleteShader(sh);
-               Output("Case 1 finished\n");
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "Case 1 finished\n"
+                       << "Case 2: <pname> is not supported in GetProgramInterfacei" << tcu::TestLog::EndMessage;
 
-               Output("Case 2: <pname> is not supported in GetProgramInterfaceiv\n");
                glGetProgramInterfaceiv(program, GL_PROGRAM_INPUT, GL_MAX_NUM_ACTIVE_VARIABLES, &res);
                ExpectError(GL_INVALID_OPERATION, error);
-               Output("Case 2 finished\n");
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "Case 2 finished\n"
+                       << "Case 3: <props> is not supported in GetProgramResourceiv" << tcu::TestLog::EndMessage;
 
-               Output("Case 3: <props> is not supported in GetProgramResourceiv");
                glGetProgramResourceiv(program, GL_PROGRAM_INPUT, 0, 1, props, 1024, &len, &res);
                ExpectError(GL_INVALID_OPERATION, error);
-               Output("Case 3 finished\n");
+               m_context.getTestContext().getLog()
+                       << tcu::TestLog::Message << "Case 3 finished\n"
+                       << "Case 4: <program> has not been linked in GetProgramResourceLocation/GetProgramResourceLocationIndex"
+                       << tcu::TestLog::EndMessage;
 
-               Output("Case 4: <program> has not been linked in GetProgramResourceLocation/GetProgramResourceLocationIndex\n");
                glGetProgramResourceLocation(program2, GL_PROGRAM_INPUT, "pie");
                ExpectError(GL_INVALID_OPERATION, error);
                glGetProgramResourceLocationIndex(program2, GL_PROGRAM_OUTPUT, "pie");
                ExpectError(GL_INVALID_OPERATION, error);
-               Output("Case 4 finished\n");
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 4 finished\n" << tcu::TestLog::EndMessage;
 
                glDeleteProgram(program);
                glDeleteProgram(program2);
@@ -2986,8 +3023,10 @@ class ShaderStorageBlock : public SimpleShaders
                glGetProgramInterfaceiv(program, GL_BUFFER_VARIABLE, GL_ACTIVE_RESOURCES, &res);
                if (res < 7)
                {
-                       Output("Error on: glGetProgramInterfaceiv, if: GL_BUFFER_VARIABLE, param: GL_ACTIVE_RESOURCES\n");
-                       Output("Expected value greater or equal to 7, got %d\n", res);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message
+                               << "Error on: glGetProgramInterfaceiv, if: GL_BUFFER_VARIABLE, param: GL_ACTIVE_RESOURCES\n"
+                               << "Expected value greater or equal to 7, got " << res << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
                VerifyGetProgramInterfaceiv(program, GL_SHADER_STORAGE_BLOCK, GL_ACTIVE_RESOURCES, 4, error);
@@ -3114,17 +3153,21 @@ class ShaderStorageBlock : public SimpleShaders
                {
                        if (exp.find(param[i]) == exp.end())
                        {
-                               Output("Unexpected index found in active variables of SimpleBuffer: %d\n", param[i]);
-                               Output(
-                                       "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_SHADER_STORAGE_BLOCK\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message
+                                       << "Unexpected index found in active variables of SimpleBuffer: " << param[i]
+                                       << "\nCall: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: "
+                                          "GL_SHADER_STORAGE_BLOCK"
+                                       << tcu::TestLog::EndMessage;
                                glDeleteProgram(program);
                                return ERROR;
                        }
                        else if (length != 3)
                        {
-                               Output(
-                                       "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_SHADER_STORAGE_BLOCK\n");
-                               Output("Expected length: 3, actual length: %d\n", length);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES "
+                                                                                               "interface: GL_SHADER_STORAGE_BLOCK\n"
+                                       << "Expected length: 3, actual length: " << length << tcu::TestLog::EndMessage;
                                glDeleteProgram(program);
                                return ERROR;
                        }
@@ -3139,17 +3182,21 @@ class ShaderStorageBlock : public SimpleShaders
                {
                        if (exp2.find(param[i]) == exp2.end())
                        {
-                               Output("Unexpected index found in active variables of NotSoSimpleBuffer: %d\n", param[i]);
-                               Output(
-                                       "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_SHADER_STORAGE_BLOCK\n");
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message
+                                       << "Unexpected index found in active variables of NotSoSimpleBuffer: " << param[i]
+                                       << "\nCall: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: "
+                                          "GL_SHADER_STORAGE_BLOCK"
+                                       << tcu::TestLog::EndMessage;
                                glDeleteProgram(program);
                                return ERROR;
                        }
                        else if (length != 3)
                        {
-                               Output(
-                                       "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_SHADER_STORAGE_BLOCK\n");
-                               Output("Expected length: 3, actual length: %d\n", length);
+                               m_context.getTestContext().getLog()
+                                       << tcu::TestLog::Message << "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES "
+                                                                                               "interface: GL_SHADER_STORAGE_BLOCK\n"
+                                       << "Expected length: 3, actual length: " << length << tcu::TestLog::EndMessage;
                                glDeleteProgram(program);
                                return ERROR;
                        }
@@ -3158,8 +3205,9 @@ class ShaderStorageBlock : public SimpleShaders
                glGetProgramInterfaceiv(program, GL_SHADER_STORAGE_BLOCK, GL_MAX_NUM_ACTIVE_VARIABLES, &res);
                if (res < 3)
                {
-                       Output("Value of GL_MAX_NUM_ACTIVE_VARIABLES less than 3!\n");
-                       Output("Call: glGetProgramInterfaceiv, interface: GL_SHADER_STORAGE_BLOCK\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Value of GL_MAX_NUM_ACTIVE_VARIABLES less than 3!\n"
+                               << "Call: glGetProgramInterfaceiv, interface: GL_SHADER_STORAGE_BLOCK" << tcu::TestLog::EndMessage;
                        return ERROR;
                }
 
@@ -3245,9 +3293,10 @@ class TransformFeedbackBuiltin : public SimpleShaders
                        indices[name] = i;
                }
 
-               Output("Indices of builtins:\n");
-               Output("%d, %d, %d, %d, %d\n", indices["gl_NextBuffer"], indices["gl_SkipComponents1"],
-                          indices["gl_SkipComponents2"], indices["gl_SkipComponents3"], indices["gl_SkipComponents4"]);
+               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Indices of builtins:\n"
+                                                                                       << indices["gl_NextBuffer"] << ", " << indices["gl_SkipComponents1"] << ", "
+                                                                                       << indices["gl_SkipComponents2"] << ", " << indices["gl_SkipComponents3"]
+                                                                                       << ", " << indices["gl_SkipComponents4"] << tcu::TestLog::EndMessage;
 
                GLenum props[]  = { GL_NAME_LENGTH, GL_TYPE, GL_ARRAY_SIZE };
                GLint  expected[] = { 14, GL_NONE, 0 };
@@ -3321,13 +3370,15 @@ class NullLength : public SimpleShaders
                std::string expected = "color";
                if (name != expected)
                {
-                       Output("Expected name: %s, got: %s\n", expected.c_str(), name);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Expected name: " << expected
+                                                                                               << ", got: " << name << tcu::TestLog::EndMessage;
                        glDeleteProgram(program);
                        return ERROR;
                }
                else if (res != 1)
                {
-                       Output("Expected array_size: 1, got: %d\n", res);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Expected array_size: 1, got: " << res << tcu::TestLog::EndMessage;
                        glDeleteProgram(program);
                        return ERROR;
                }
@@ -3493,8 +3544,10 @@ class TopLevelArray : public SimpleShaders
                glGetProgramResourceiv(program, GL_BUFFER_VARIABLE, indicesBV["a[0][0]"], 1, &prop, 1024, &len, &res);
                if (res <= 0)
                {
-                       Output("Call: glGetProgramResourceiv, interface: GL_BUFFER_VARIABLE, param: GL_TOP_LEVEL_ARRAY_STRIDE\n");
-                       Output("Expected value greater than 0, got: %d\n", res);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message
+                               << "Call: glGetProgramResourceiv, interface: GL_BUFFER_VARIABLE, param: GL_TOP_LEVEL_ARRAY_STRIDE\n"
+                               << "Expected value greater than 0, got: " << res << tcu::TestLog::EndMessage;
                        glDeleteProgram(program);
                        return ERROR;
                }
@@ -3535,7 +3588,8 @@ public:
                        glGetProgramInfoLog(program, sizeof(log), &length, log);
                        if (length > 1)
                        {
-                               Output("Program Info Log:\n%s\n", log);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+                                                                                                       << log << tcu::TestLog::EndMessage;
                        }
                }
                return program;
@@ -4134,22 +4188,27 @@ class UniformBlockAdvanced : public SimpleShaders
                glGetProgramResourceiv(program, GL_UNIFORM, indicesU["a"], 1, &prop, 1024, &len, &res);
                if (res < 1)
                {
-                       Output("ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_MATRIX_STRIDE\n");
-                       Output("Expected value greater than 0, got %d\n", res);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message
+                               << "ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_MATRIX_STRIDE\n"
+                               << "Expected value greater than 0, got " << res << tcu::TestLog::EndMessage;
                }
                prop = GL_OFFSET;
                glGetProgramResourceiv(program, GL_UNIFORM, indicesU["a"], 1, &prop, 1024, &len, &res);
                if (res < 0)
                {
-                       Output("ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_OFFSET\n");
-                       Output("Expected value not less than 0, got %d\n", res);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_OFFSET\n"
+                               << "Expected value not less than 0, got " << res << tcu::TestLog::EndMessage;
                }
                prop = GL_ARRAY_STRIDE;
                glGetProgramResourceiv(program, GL_UNIFORM, indicesU["b"], 1, &prop, 1024, &len, &res);
                if (res < 1)
                {
-                       Output("ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_ARRAY_STRIDE\n");
-                       Output("Expected value greater than 0, got %d\n", res);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message
+                               << "ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_ARRAY_STRIDE\n"
+                               << "Expected value greater than 0, got " << res << tcu::TestLog::EndMessage;
                }
 
                glDeleteProgram(program);
@@ -4262,18 +4321,21 @@ class BuffLength : public SimpleShaders
                glGetProgramResourceName(program, GL_UNIFORM, index, 0, NULL, buff);
                if (buff[0] != 'a' || buff[1] != 'b' || buff[2] != 'c')
                {
-                       Output("ERROR: buff has changed\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "ERROR: buff has changed" << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
                glGetProgramResourceName(program, GL_UNIFORM, index, 2, &length, buff);
                if (buff[0] != 's' || buff[1] != '\0' || buff[2] != 'c')
                {
-                       Output("ERROR: buff different then expected\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "ERROR: buff different then expected" << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
                if (length != 1)
                {
-                       Output("ERROR: incorrect length, expected 1, got %d\n", length);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: incorrect length, expected 1, got "
+                                                                                               << length << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
 
@@ -4295,18 +4357,21 @@ class BuffLength : public SimpleShaders
                glGetProgramResourceiv(program, GL_UNIFORM, index, 13, props, 0, NULL, params);
                if (params[0] != 1 || params[1] != 2 || params[2] != 3)
                {
-                       Output("ERROR: params has changed\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "ERROR: params has changed" << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
                glGetProgramResourceiv(program, GL_UNIFORM, index, 13, props, 2, &length, params);
                if (params[0] != 13 || params[1] != GL_FLOAT_VEC4 || params[2] != 3)
                {
-                       Output("ERROR: params has incorrect values\n");
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "ERROR: params has incorrect values" << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
                if (length != 2)
                {
-                       Output("ERROR: incorrect length, expected 2, got %d\n", length);
+                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: incorrect length, expected 2, got "
+                                                                                               << length << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
 
@@ -4491,26 +4556,34 @@ class ComputeShaderTest : public PIQBase
                                        switch (type)
                                        {
                                        case GL_VERTEX_SHADER:
-                                               Output("*** Vertex Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_TESS_CONTROL_SHADER:
-                                               Output("*** Tessellation Control Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Tessellation Control Shader ***"
+                                                       << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_TESS_EVALUATION_SHADER:
-                                               Output("*** Tessellation Evaluation Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Tessellation Evaluation Shader ***"
+                                                       << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_GEOMETRY_SHADER:
-                                               Output("*** Geometry Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Geometry Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_FRAGMENT_SHADER:
-                                               Output("*** Fragment Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        case GL_COMPUTE_SHADER:
-                                               Output("*** Compute Shader ***\n");
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Compute Shader ***" << tcu::TestLog::EndMessage;
                                                break;
                                        default:
-                                               Output("*** Unknown Shader ***\n");
-                                               break;
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
                                        }
 
                                        GLint res;
@@ -4525,7 +4598,8 @@ class ComputeShaderTest : public PIQBase
                                        {
                                                std::vector<GLchar> source(length);
                                                glGetShaderSource(shaders[i], length, NULL, &source[0]);
-                                               Output("%s\n", &source[0]);
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
                                        }
 
                                        // shader info log
@@ -4534,7 +4608,8 @@ class ComputeShaderTest : public PIQBase
                                        {
                                                std::vector<GLchar> log(length);
                                                glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
-                                               Output("%s\n", &log[0]);
+                                               m_context.getTestContext().getLog()
+                                                       << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
                                        }
                                }
                        }
@@ -4546,7 +4621,7 @@ class ComputeShaderTest : public PIQBase
                        {
                                std::vector<GLchar> log(length);
                                glGetProgramInfoLog(program, length, NULL, &log[0]);
-                               Output("%s\n", &log[0]);
+                               m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
                        }
                }
 
@@ -4928,13 +5003,17 @@ class LinkFailure : public SimpleShaders
                glGetProgramInterfaceiv(program, GL_PROGRAM_INPUT, GL_ACTIVE_RESOURCES, &res);
                if (res != 0 && res != 1)
                {
-                       Output("Error, expected 0 or 1 active resources, got: %d", res);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Error, expected 0 or 1 active resources, got: " << res
+                               << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
                glGetProgramInterfaceiv(program, GL_PROGRAM_INPUT, GL_MAX_NAME_LENGTH, &res);
                if (res != 0 && res != 9)
                {
-                       Output("Error, expected 1 or 9 GL_MAX_NAME_LENGTH, got: %d", res);
+                       m_context.getTestContext().getLog()
+                               << tcu::TestLog::Message << "Error, expected 1 or 9 GL_MAX_NAME_LENGTH, got: " << res
+                               << tcu::TestLog::EndMessage;
                        error = ERROR;
                }
                VerifyGetProgramResourceLocation(program, GL_PROGRAM_OUTPUT, "color", -1, error);
@@ -4959,7 +5038,6 @@ ProgramInterfaceQueryTests::~ProgramInterfaceQueryTests(void)
 void ProgramInterfaceQueryTests::init()
 {
        using namespace deqp;
-       setOutput(m_context.getTestContext().getLog());
        addChild(new TestSubcase(m_context, "empty-shaders", TestSubcase::Create<NoShaders>));
        addChild(new TestSubcase(m_context, "simple-shaders", TestSubcase::Create<SimpleShaders>));
        addChild(new TestSubcase(m_context, "input-types", TestSubcase::Create<InputTypes>));