[cfe-dev] Test specific to Windows host?

Robinson, Paul Paul.Robinson at am.sony.com
Wed Mar 6 13:05:56 PST 2013


I can write it this way:

// RUN: %clang -c foo.c -o pathname-too-long-for-Windows-to-handle.o
// XFAIL: windows

This will show as an expected failure when run on Windows, and pass everywhere else.  Not what XFAIL was intended for, but it gets the job done.

I could write it this way:

// RUN: not %clang -c foo.c -o pathname-too-long-for-Windows-to-handle.o

This will pass on Windows (because clang will return an error) but fail on other hosts e.g. Linux (because clang will compile the test successfully).  Nobody will be happy unless I can find a way to make the test be skipped on everything except Windows.

Grasping at straws, I tried adding
// REQUIRES: windows
but that suppresses the test on Windows as well as Linux.

Is there a way to specify a host OS using REQUIRES?  Or some other way to achieve the same effect?  I'll go with XFAIL unless something better shows up.
Thanks,
--paulr

From: Eric Christopher [mailto:echristo at gmail.com]
Sent: Wednesday, March 06, 2013 10:44 AM
To: Robinson, Paul
Cc: cfe-dev at cs.uiuc.edu
Subject: Re: [cfe-dev] Test specific to Windows host?

Yeah. Don't do that. It'll just pass fine on other platforms, that seems ok.

-eric

On Wed, Mar 6, 2013 at 10:31 AM, Robinson, Paul <Paul.Robinson at am.sony.com<mailto:Paul.Robinson at am.sony.com>> wrote:
The target is irrelevant.  Clang running on Windows was hanging if the output-file path name was too long; I have a patch to make it return an error instead.
But another host OS won't get an error for that case.  So, the test behavior will vary by host OS.  (Running Clang on Linux with a Windows target triple will not fail the same way because Linux has different path-length limits.)  I'd rather constrain it to run only on a Windows host.
Or, hm, I suppose I could write the test to expect success and XFAIL: windows, but that seems like a perversion of the intent of XFAIL.
--paulr

From: Eric Christopher [mailto:echristo at gmail.com<mailto:echristo at gmail.com>]
Sent: Tuesday, March 05, 2013 5:26 PM
To: Robinson, Paul
Cc: cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>
Subject: Re: [cfe-dev] Test specific to Windows host?

-target?

Otherwise can you explain more of what you're trying to do?

-eric

On Tue, Mar 5, 2013 at 5:10 PM, Robinson, Paul <Paul.Robinson at am.sony.com<mailto:Paul.Robinson at am.sony.com>> wrote:
I'm working up a fix for a problem but it's specific to Windows;
the test won't behave the same way on Linux or whatever.
AFAICT the ways of expressing constraints are mostly target
based.  Is there a way to express "run only on Windows host"?
Thanks,
--paulr



_______________________________________________
cfe-dev mailing list
cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130306/d75e13cb/attachment.html>


More information about the cfe-dev mailing list