[Piglit] [PATCH 1/2] arb_color_buffer_float/render: refactor code for easier debugging

Brian Paul brian.e.paul at gmail.com
Sun Oct 2 15:34:25 PDT 2011


On Sat, Oct 1, 2011 at 10:03 PM, Eric Anholt <eric at anholt.net> wrote:
> On Wed, 28 Sep 2011 14:13:14 -0600, Brian Paul <brianp at vmware.com> wrote:
>> If you have to debug a failing case in this test it's now a simple
>> matter to add a new call to test_one() passing just the parameters
>> you're interested in.
>> +             if (pass) {
>> +                     npass++;
>>               }
>> -             if (test_fog && fpmode)
>> -             {
>> -                     //printf("Unclear specification on GL_ARB_fog_*\n");
>> -                     opass = GL_TRUE;
>> +             else {
>> +                     printf("Re-running failed test\n");
>> +                     pass = test_one(vert_clamp, frag_clamp, semantic,
>> +                                     blend, logicop, vpmode, fpmode);
>>               }
>>
>> -             if (!opass) {
>> -                     printf("%s: %s\n", (cpass ? "PASS" : (opass ? "XFAIL" : "FAIL")), test_name);
>> -                     printf("  Expected: %f %f %f %f\n", expected[0], expected[1], expected[2], expected[3]);
>> -                     printf("  Observed: %f %f %f %f\n", probe[0], probe[1], probe[2], probe[3]);
>> -
>> -             } else {
>> -                     npass++;
>> -             }
>>               total++;
>>
>> -             pass = opass && pass;
>> +             all_pass = all_pass && pass;
>>       }
>>
>>       printf("Summary: %i/%i passed.\n", npass, total);
>> -     return pass;
>> +     return all_pass;
>
> So, if the test intermittently fails, we'll end up not reporting that as
> failure if it's not immediately reproduced?  That seems bad.

I'm not sure follow what you mean.  I only rearranged the code to make
it bit more debug-able.  AFAICT, I didn't change it's behavior.  I'll
double-check tomorrow though.

-Brian


More information about the Piglit mailing list