[cfe-dev] Test specific to Windows host?

Jeffrey Walton noloader at gmail.com
Wed Mar 6 18:19:00 PST 2013


On Wed, Mar 6, 2013 at 4:05 PM, Robinson, Paul
<Paul.Robinson at am.sony.com> wrote:
> 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.
Perhaps I'm missing the point, but isn't the failed self-test
indicating a [platform] problem with Clang/Windows? Which means it
could fail in the field? Shouldn't the problem be fixed rather than
working around the one thing that's suppose to catch the failure?

Perhaps Clang on Windows should call GetShortPathName? Or maybe use
the \\?\ prefix in its path routines on Windows? With the latter, the
path can be 65K and each component has a limit of MAX_PATH.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx

Please forgive my ignorance as I feel I missed something here.

Jeff




More information about the cfe-dev mailing list