[Patch][gcc][testsuite] Skip testcases using freopen when on wrapped board

Jeff Law law@redhat.com
Fri Nov 16 16:21:00 GMT 2018


On 11/16/18 9:16 AM, Matthew Malcomson wrote:
> On 16/11/18 16:04, Jeff Law wrote:
>> On 11/15/18 12:06 PM, Martin Sebor wrote:
>>> On 11/15/2018 02:39 AM, Matthew Malcomson wrote:
>>>> If not we could add an
>>>>      { dg-require-effective-target unwrapped }
>>>> directive in the testcases to stop the failure complaints.
>>> I'm not familiar with this directive or really know what
>>> a status wrapper is but as long as it doesn't change the I/O
>>> the test does I think it should be fine.
>> Wrapping in this context refers to the dejagnu harness wrapping to
>> facilitate testing of remote and embedded targets where getting the real
>> exit status of an execution test is painful.
>>
>> We wrap main, exit and abort.  The wrappers print info to stdout to
>> indicate exit status which can reliably be read by the harness.
>>
>> At least that's my recollection of the wrapper bits.
>>
>> jeff
> 
> That's my understanding too -- since the wrappers print to stdout they 
> are affected by the freopen call the test made and hence the exit status 
> is not printed where DejaGNU is looking.
> Hence DejaGNU can't read the exit status and defaults to a status of 2, 
> FAILing the test.
> 
> This directive just skips the testcase completely when the status 
> wrapper is being used, so we get an UNSUPPORTED instead of FAIL test result.
> 
> 
> Suggested change below.
> =======
> 
> When running the testsuite on boards that can't report an error status
> DejaGNU uses a special wrapper to print the exit code on stdout and
> parses stdout to find whether an execution failed or passed.
> 
> In testcases that use "freopen (..., ..., stdout)" this special line is
> printed to the alternate location described in the freopen call and
> DejaGNU can't find the error code.
> 
> This results in DejaGNU using a default return status of 2 and the test
> failing.
> 
> This patch skips the two testcases that use freopen on stdout when
> testing a board that requires the status wrapper.
> 
> Testing done by running these two tests on arm-none-eabi cross build and
> observing that they are now unsupported.
> 
> gcc/testsuite/ChangeLog:
> 
> 2018-11-16  Matthew Malcomson  <matthew.malcomson@arm.com>
> 
>      * gcc.c-torture/execute/printf-2.c: Skip on wrapped boards.
>      * gcc.c-torture/execute/user-printf.c: Likewise.
OK
jeff



More information about the Gcc-patches mailing list