[PATCH 2 of 2] tests: add new test for #! shbang lines

Matt Harbison mharbison72 at gmail.com
Sun Apr 17 00:03:03 EDT 2016


> On Apr 16, 2016, at 11:51 PM, timeless <timeless at gmail.com> wrote:
> 
> hrm, ok. well, it'd need to be (?),
> if you don't use obsolete markings in your repo, then the output
> wouldn't happen.
> 
> so 2>&1 + (?) seems reasonable.

Since the tests also capture stderr, is the redirect even necessary?

> 
> It is a bunch of files though (I think at least 3).
> 
> It definitely happens on linux too (gcc112 where I do my work).
> 
>> On Sat, Apr 16, 2016 at 11:40 PM, Matt Harbison <mharbison72 at gmail.com> wrote:
>> 
>>> On Apr 16, 2016, at 11:22 PM, timeless <timeless at gmail.com> wrote:
>>> 
>>> I hit them all the time. I've complained but never gotten any
>>> particular help in quieting them. When I suggested 2> /dev/null, I'm
>>> pretty sure someone complained. Also, I had to add them to quite a few
>>> places, which really sucked :(
>> 
>> I'm not keen on throwing away stderr either.  We could put a (?) on the end, since I don't really care what output is captured- it's the false positive that's annoying.  I just wanted to make sure that there wasn't a real issue before burying it.  (E.g., there something wrong with one of the perf tests where it doesn't seem to set HGRCPATH to empty properly on Windows, so it tries and fails to load keyring from the user hgrc, which shows as a diff.  I want to fix that, not hide it.)
>> 
>> 
>>>>> On Fri, Apr 15, 2016 at 10:19 PM, Matt Harbison <mharbison72 at gmail.com> wrote:
>>>>> On Wed, 06 Apr 2016 21:26:37 -0400, timeless <timeless at mozdev.org> wrote:
>>>>> 
>>>>> # HG changeset patch
>>>>> # User timeless <timeless at mozdev.org>
>>>>> # Date 1459969752 0
>>>>> #      Wed Apr 06 19:09:12 2016 +0000
>>>>> # Node ID 16e6523533e263430f06ffd785c921a114268199
>>>>> # Parent  0a413e125a885f3b5349aa8aaa8d7285fbcbdd3e
>>>>> tests: add new test for #! shbang lines
>>>>> 
>>>>> * use #!/bin/sh not e.g. #!/usr/bin/sh
>>>>> * use #!/usr/bin/env python not e.g. #!/usr/bin/python
>>>>> 
>>>>> diff --git a/tests/test-check-execute.t b/tests/test-check-shbang.t
>>>>> copy from tests/test-check-execute.t
>>>>> copy to tests/test-check-shbang.t
>>>>> --- a/tests/test-check-execute.t
>>>>> +++ b/tests/test-check-shbang.t
>>>>> @@ -1,23 +1,13 @@
>>>>> -#require test-repo execbit
>>>>> +#require test-repo
>>>>> $ cd "`dirname "$TESTDIR"`"
>>>>> -look for python scripts without the execute bit
>>>>> +look for python scripts that do not use /usr/bin/env
>>>>> -  $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")'
>>>>> +  $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env
>>>>> python")'
>>>>>  [1]
>>>>> -look for python scripts with execute bit but not shebang
>>>>> +look for shell scripts that do not use /bin/sh
>>>>> -  $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")'
>>>>> +  $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")'
>>>>>  [1]
>>>> 
>>>> 
>>>> Is there a way to lose these lines other than `grep -v`?
>>>> 
>>>>  $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")'
>>>> +  obsolete feature not enabled but 110079 markers found!
>>>>  [1]
>>>> 
>>>> (I'm a bit surprised nobody else is seeing this?)
>>>> 
>>>> _______________________________________________
>>>> Mercurial-devel mailing list
>>>> Mercurial-devel at mercurial-scm.org
>>>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list