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

Mike Stump mikestump@comcast.net
Mon Nov 26 22:17:00 GMT 2018


On Nov 16, 2018, at 8:16 AM, Matthew Malcomson <matthew.malcomson@arm.com> 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.

So, a completely different style of fix, is to put the environment back to how it was, at the end of the test, to allow the status wrapper to work as designed.  I'm fine with either approach and would leave it to the test case author which they preferred.  I mention it, not to get you to do the work, but so others know how to make the status wrapper code happy, if they'd like the coverage their test provides on such systems.


More information about the Gcc-patches mailing list