<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Looks good.</p>
<p><br>
</p>
<p>Reviewed-by: Neha Bhende <bhenden@vmware.com><br>
</p>
<p><br>
</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Regards,</p>
<p>Neha<br>
</p>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Brian Paul <brianp@vmware.com><br>
<b>Sent:</b> Wednesday, June 7, 2017 8:51:52 AM<br>
<b>To:</b> piglit@lists.freedesktop.org<br>
<b>Cc:</b> Charmaine Lee; Neha Bhende; Brian Paul<br>
<b>Subject:</b> [PATCH] util: call fflush() after printf() calls</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Otherwise, on Windows, we don't see the printf() output until the program<br>
exits. That's fine with the -auto option, but a problem w/out -auto.<br>
---<br>
tests/util/piglit-util-gl.c | 21 +++++++++++++++++++++<br>
1 file changed, 21 insertions(+)<br>
<br>
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c<br>
index 5ff13fe..f5734d9 100644<br>
--- a/tests/util/piglit-util-gl.c<br>
+++ b/tests/util/piglit-util-gl.c<br>
@@ -1169,6 +1169,7 @@ piglit_probe_pixel_rgb(int x, int y, const float* expected)<br>
printf("Probe color at (%i,%i)\n", x, y);<br>
printf(" Expected: %f %f %f\n", expected[0], expected[1], expected[2]);<br>
printf(" Observed: %f %f %f\n", probe[0], probe[1], probe[2]);<br>
+ fflush(stdout);<br>
<br>
return 0;<br>
}<br>
@@ -1199,6 +1200,7 @@ piglit_probe_pixel_rgba(int x, int y, const float* expected)<br>
printf("Probe color at (%i,%i)\n", x, y);<br>
printf(" Expected: %f %f %f %f\n", expected[0], expected[1], expected[2], expected[3]);<br>
printf(" Observed: %f %f %f %f\n", probe[0], probe[1], probe[2], probe[3]);<br>
+ fflush(stdout);<br>
<br>
return 0;<br>
}<br>
@@ -1259,6 +1261,7 @@ piglit_probe_rect_ubyte(int x, int y, int w, int h, int num_components,<br>
printf(" Observed: %u %u %u\n",<br>
probe[0], probe[1], probe[2]);<br>
}<br>
+ fflush(stdout);<br>
}<br>
free(pixels);<br>
return false;<br>
@@ -1321,6 +1324,7 @@ piglit_probe_rect_r_ubyte(int x, int y, int w, int h, GLubyte expected)<br>
printf("Probe color at (%i,%i)\n", x+i, y+j);<br>
printf(" Expected: %u\n", expected);<br>
printf(" Observed: %u\n", probe);<br>
+ fflush(stdout);<br>
<br>
free(pixels);<br>
return 0;<br>
@@ -1355,6 +1359,7 @@ piglit_probe_rect_rgb(int x, int y, int w, int h, const float *expected)<br>
expected[0], expected[1], expected[2]);<br>
printf(" Observed: %f %f %f\n",<br>
probe[0], probe[1], probe[2]);<br>
+ fflush(stdout);<br>
<br>
free(pixels);<br>
return 0;<br>
@@ -1425,6 +1430,7 @@ piglit_probe_rect_rgba(int x, int y, int w, int h, const float *expected)<br>
expected[0], expected[1], expected[2], expected[3]);<br>
printf(" Observed: %f %f %f %f\n",<br>
probe[0], probe[1], probe[2], probe[3]);<br>
+ fflush(stdout);<br>
<br>
free(pixels);<br>
return 0;<br>
@@ -1457,6 +1463,7 @@ piglit_probe_rect_rgba_int(int x, int y, int w, int h, const int *expected)<br>
expected[0], expected[1], expected[2], expected[3]);<br>
printf(" Observed: %d %d %d %d\n",<br>
probe[0], probe[1], probe[2], probe[3]);<br>
+ fflush(stdout);<br>
<br>
free(pixels);<br>
return 0;<br>
@@ -1490,6 +1497,7 @@ piglit_probe_rect_rgba_uint(int x, int y, int w, int h,<br>
expected[0], expected[1], expected[2], expected[3]);<br>
printf(" Observed: %u %u %u %u\n",<br>
probe[0], probe[1], probe[2], probe[3]);<br>
+ fflush(stdout);<br>
<br>
free(pixels);<br>
return 0;<br>
@@ -1685,6 +1693,7 @@ piglit_compare_images_ubyte(int x, int y, int w, int h,<br>
printf("Probe at (%i,%i)\n", x+i, y+j);<br>
printf(" Expected: %d\n", expected);<br>
printf(" Observed: %d\n", probe);<br>
+ fflush(stdout);<br>
<br>
return 0;<br>
}<br>
@@ -1858,6 +1867,7 @@ int piglit_probe_texel_rect_rgb(int target, int level, int x, int y,<br>
expected[0], expected[1], expected[2]);<br>
printf(" Observed: %f %f %f\n",<br>
probe[0], probe[1], probe[2]);<br>
+ fflush(stdout);<br>
<br>
free(buffer);<br>
return 0;<br>
@@ -1921,6 +1931,7 @@ int piglit_probe_texel_rect_rgba(int target, int level, int x, int y,<br>
expected[0], expected[1], expected[2], expected[3]);<br>
printf(" Observed: %f %f %f %f\n",<br>
probe[0], probe[1], probe[2], probe[3]);<br>
+ fflush(stdout);<br>
<br>
free(buffer);<br>
return 0;<br>
@@ -1990,6 +2001,7 @@ int piglit_probe_texel_volume_rgba(int target, int level, int x, int y, int z,<br>
expected[0], expected[1], expected[2], expected[3]);<br>
printf(" Observed: %f %f %f %f\n",<br>
probe[0], probe[1], probe[2], probe[3]);<br>
+ fflush(stdout);<br>
<br>
free(buffer);<br>
return 0;<br>
@@ -2024,6 +2036,7 @@ int piglit_probe_pixel_depth(int x, int y, float expected)<br>
printf("Probe depth at (%i,%i)\n", x, y);<br>
printf(" Expected: %f\n", expected);<br>
printf(" Observed: %f\n", probe);<br>
+ fflush(stdout);<br>
<br>
return 0;<br>
}<br>
@@ -2044,6 +2057,7 @@ int piglit_probe_rect_depth(int x, int y, int w, int h, float expected)<br>
printf("Probe depth at (%i,%i)\n", x+i, y+j);<br>
printf(" Expected: %f\n", expected);<br>
printf(" Observed: %f\n", *probe);<br>
+ fflush(stdout);<br>
<br>
free(pixels);<br>
return 0;<br>
@@ -2066,6 +2080,7 @@ int piglit_probe_pixel_stencil(int x, int y, unsigned expected)<br>
printf("Probe stencil at (%i, %i)\n", x, y);<br>
printf(" Expected: %u\n", expected);<br>
printf(" Observed: %u\n", probe);<br>
+ fflush(stdout);<br>
<br>
return 0;<br>
}<br>
@@ -2084,6 +2099,7 @@ int piglit_probe_rect_stencil(int x, int y, int w, int h, unsigned expected)<br>
printf("Probe stencil at (%i, %i)\n", x + i, y + j);<br>
printf(" Expected: %u\n", expected);<br>
printf(" Observed: %u\n", probe);<br>
+ fflush(stdout);<br>
free(pixels);<br>
return 0;<br>
}<br>
@@ -2109,6 +2125,7 @@ bool piglit_probe_buffer(GLuint buf, GLenum target, const char *label,<br>
if (fabs(ptr[i] - expected[i % num_components]) > 0.01) {<br>
printf("%s[%i]: %f, Expected: %f\n", label, i, ptr[i],<br>
expected[i % num_components]);<br>
+ fflush(stdout);<br>
status = false;<br>
}<br>
}<br>
@@ -2133,6 +2150,7 @@ bool piglit_probe_buffer_doubles(GLuint buf, GLenum target, const char *label,<br>
if (fabs(ptr[i] - expected[i % num_components]) > 0.01) {<br>
printf("%s[%i]: %f, Expected: %f\n", label, i, ptr[i],<br>
expected[i % num_components]);<br>
+ fflush(stdout);<br>
status = false;<br>
}<br>
}<br>
@@ -2200,10 +2218,13 @@ GLuint piglit_compile_program(GLenum target, const char* text)<br>
fprintf(stderr, "%c", text[errorPos+a]);<br>
}<br>
fprintf(stderr, "\nin program:\n%s", text);<br>
+ fflush(stderr);<br>
+<br>
piglit_report_result(PIGLIT_FAIL);<br>
}<br>
if (!glIsProgramARB(program)) {<br>
fprintf(stderr, "glIsProgramARB failed\n");<br>
+ fflush(stderr);<br>
piglit_report_result(PIGLIT_FAIL);<br>
}<br>
<br>
-- <br>
1.9.1<br>
<br>
</div>
</span></font>
</body>
</html>