greping on Windows

Switching to the gnuwin32 grep solved a bunch of the problems I had way back when with the test on Windows, but there still seem to be a few issues left.

The first one I encounter in the tests is in address-space-field1.c.

It uses something like: “grep” “addrspace(1)” …

but either Windows or the gnuwin32 grep is choking on the ‘’'s

The test passes if I change it to:

// RUN: grep addrspace(1) %t | count 9 &&
// RUN: grep addrspace(2) %t | count 9

So, the question is, how to handle it?

Could the python script be given smarts to convert it per platform>

It seems that using preprocessor conditionals in the actual test file won’t work.

Or maybe some sort of conditional in the annoation language, i.e.:

// RUNWIN32: …

or

// IF WIN32 RUN: …

-John

Switching to the gnuwin32 grep solved a bunch of the problems I had way back when with the test on Windows, but there still seem to be a few issues left.

The first one I encounter in the tests is in address-space-field1.c.

It uses something like: “grep” “addrspace(1)” …

but either Windows or the gnuwin32 grep is choking on the ‘’'s

Hi John,

It would be best to convert this test to FileCheck. Among other things it will be faster to run and more portable.

-Chris

Thanks for the pointer, Chris.

I’ve enclosed my attempt to convert address-space-field1.c to using FileCheck.

It seems to work on both Windows and Linux x86 32-bit, though perhaps I included too much of the output file in the checks.

If this is okay, shall I do it on the other failing tests? Or should I ping the individual test owners first?

-John

addressspacefield1.patch (2.15 KB)

Thanks! Committed in r83158. Changing the other tests sounds good.

There is probably too much output included in this test, but I'm ok with just reducing the matches in the future if it gets too fragile.

Thanks John!

-Chris