[cfe-dev] Need Python help in TestRunner.py

Daniel Dunbar daniel at zuster.org
Sat Nov 7 19:45:20 PST 2009


On Mon, Nov 2, 2009 at 3:16 PM, John Thompson
<john.thompson.jtsoftware at gmail.com> wrote:
> Daniel,
>
> I'm afraid the result of this change is that instead of appending to the
> file, it overwrites the beginning of the file.  This is the result in
> ast.c.tmp (on Windows):

Looks like a bug in Win32 or the subprocess module. r86437 adds a
workaround that works for me.

 - Daniel

> END
> put, "C:\Tools\llvm\tools\clang\test\Driver\ast.c", c
> 1: preprocessor, {0}, cpp-output
> 2: compiler, {1}, ast
> Compared to Linux:
>
> 0: input, "/home/john/llvm/tools/clang/test/Driver/Output/ast.c.tmp.ast",
> ast
> 1: compiler, {0}, assembler
> 2: assembler, {1}, object
> END
> -John
>
> On Sat, Oct 24, 2009 at 12:41 PM, Daniel Dunbar <daniel at zuster.org> wrote:
>>
>> On Tue, Oct 13, 2009 at 7:19 AM, John Thompson
>> <john.thompson.jtsoftware at gmail.com> wrote:
>> > In running the test Driver/ast.c on Windows:
>> >
>> > 2>  File "C:\Tools\llvm\utils\lit\TestRunner.py", line 79, in
>> > executeShCmd
>> > 2>    raise NotImplementedError,"Unsupported redirect: %r" % (r,)
>> > 2>NotImplementedError: Unsupported redirect: (('>>',),
>> > 'C:\\Tools\\llvm\\tools\\clang\\test\\Driver\\Output\\ast.c.tmp')
>> > It appears that '>>' is not one of the conditions in the if/else series,
>> > and
>> > I don't know Python well enough to fix it.
>> >
>> > My guess of adding:
>> >
>> >             elif r[0] == ('>>',):
>> >                 redirects[1] = [r[1], 'a', None]
>>
>> Looks like this should work, to me. I checked it on Darwin using
>> internal-execution of the test scripts and checked it in. Let me know
>> if it seems not to work on Windows.
>>
>>  - Daniel
>>
>> > resulted in the redirected output being put at the front of the output
>> > file.
>> > So if this is a quick fix for someone, I'd appreciate the help.
>>
>>
>> --
>> John Thompson
>> John.Thompson.JTSoftware at gmail.com
>>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>




More information about the cfe-dev mailing list