[PATCH v2] tests: add unix-permissions guards
timeless
timeless at gmail.com
Tue Jan 12 23:33:42 CST 2016
Oh right. Sorry, it's late and I'm tired.
On Jan 12, 2016 10:50 PM, "Matt Harbison" <mharbison72 at gmail.com> wrote:
> On Tue, 12 Jan 2016 22:43:34 -0500, timeless <timeless at gmail.com> wrote:
>
> Sigh. Does it do the right or wrong thing on Windows (not msys)?
>>
>> Barring that, your proposal might be right (it's too late for me to
>> reason through).
>>
>
> Not sure what you mean- the tests only run on Windows with msys, and
> vanilla Windows obviously doesn't have `ls`.
>
> On Tue, Jan 12, 2016 at 8:07 PM, Matt Harbison <mharbison72 at gmail.com>
>> wrote:
>>
>>> On Tue, 12 Jan 2016 13:40:37 -0500, timeless <timeless at mozdev.org>
>>> wrote:
>>>
>>> # HG changeset patch
>>>> # User timeless <timeless at mozdev.org>
>>>> # Date 1452576441 18000
>>>> # Tue Jan 12 00:27:21 2016 -0500
>>>> # Node ID c5f8ec6f06171eb42031e9da5395173523abb074
>>>> # Parent edd2615ad226c14f6904fc1738c3dc36431db223
>>>> tests: add unix-permissions guards
>>>>
>>>> Systems that "care" about execute treat file systems that don't support
>>>> execute as if all files are executable.
>>>>
>>>
>>>
>>> Unfortunately, that doesn't extend to msys:
>>>
>>> $ ls -l blacklists
>>> total 2
>>> -rw-r--r-- 1 Matt Administrators 516 Mar 30 2015 README
>>> -rw-r--r-- 1 Matt Administrators 443 Jun 2 2015 linux-vfat
>>>
>>>
>>> Not surprisingly:
>>>
>>> $ ./run-tests.py --local --change=.^ -j9 -t9000
>>> Skipped test-symlinks.t: missing feature: symbolic links
>>> Skipped test-convert-svn-sink.t: missing feature: subversion client and
>>> admin tools >= 1.3
>>> Failed test-dirstate.t: output changed
>>> Failed test-rebuildstate.t: output changed
>>> Failed test-backout.t: output changed
>>> Failed test-transplant.t: output changed
>>> Failed test-largefiles-update.t: output changed
>>> Failed test-largefiles.t: output changed
>>> # Ran 8 tests, 2 skipped, 0 warned, 6 failed.
>>>
>>>
>>> I didn't look into how the other 2 passed. I wonder if your check
>>> should be
>>> something like:
>>>
>>> #if no-unix-permissions no-windows
>>> # assume 755
>>> #else
>>> # existing 644 case
>>> #endif
>>>
>>>
>>>
>>> If they didn't, then, anyone
>>>> trying to "run" any "scripts" or "programs" from them would be upset
>>>> because they wouldn't work at all.
>>>>
>>>> Thus, all 644 become 755.
>>>>
>>>> diff --git a/tests/test-backout.t b/tests/test-backout.t
>>>> --- a/tests/test-backout.t
>>>> +++ b/tests/test-backout.t
>>>> @@ -144,8 +144,13 @@
>>>> $ touch -t 200001010000 c
>>>> $ hg status -A
>>>> C c
>>>> +#if unix-permissions
>>>> $ hg debugstate --nodates
>>>> n 644 12 set c
>>>> +#else
>>>> + $ hg debugstate --nodates
>>>> + n 755 12 set c
>>>> +#endif
>>>> $ hg backout -d '6 0' -m 'to be rollback-ed soon' -r .
>>>> adding b
>>>> removing c
>>>> diff --git a/tests/test-convert-svn-sink.t
>>>> b/tests/test-convert-svn-sink.t
>>>> --- a/tests/test-convert-svn-sink.t
>>>> +++ b/tests/test-convert-svn-sink.t
>>>> @@ -255,9 +255,14 @@
>>>> $ hg --cwd a up 5
>>>> 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>>>> +#endif
>>>> +#if symlink unix-permissions
>>>> $ hg --cwd a --config extensions.strip= strip -r 6
>>>> saved backup bundle to
>>>> $TESTTMP/a/.hg/strip-backup/bd4f7b7a7067-ed505e42-backup.hg (glob)
>>>> -
>>>> +#endif
>>>> +#if symlink no-unix-permissions
>>>> + $ hg --cwd a --config extensions.strip= strip -r 6
>>>> + saved backup bundle to
>>>> $TESTTMP/a/.hg/strip-backup/acd3468d7783-a37941a0-backup.hg (glob)
>>>> #endif
>>>> Convert with --full adds and removes files that didn't change
>>>> diff --git a/tests/test-dirstate.t b/tests/test-dirstate.t
>>>> --- a/tests/test-dirstate.t
>>>> +++ b/tests/test-dirstate.t
>>>> @@ -50,17 +50,28 @@
>>>> Status must not set a's entry to unset (issue1790):
>>>> $ hg status
>>>> +#if unix-permissions
>>>> $ hg debugstate
>>>> n 644 2 2021-01-01 12:00:00 a
>>>> +#else
>>>> + $ hg debugstate
>>>> + n 755 2 2021-01-01 12:00:00 a
>>>> +#endif
>>>> Test modulo storage/comparison of absurd dates:
>>>> #if no-aix
>>>> $ touch -t 195001011200 a
>>>> $ hg st
>>>> +#endif
>>>> +#if no-aix unix-permissions
>>>> $ hg debugstate
>>>> n 644 2 2018-01-19 15:14:08 a
>>>> #endif
>>>> +#if no-aix no-unix-permissions
>>>> + $ hg debugstate
>>>> + n 755 2 2018-01-19 15:14:08 a
>>>> +#endif
>>>> Verify that exceptions during a dirstate change leave the dirstate
>>>> coherent (issue4353)
>>>> diff --git a/tests/test-keyword.t b/tests/test-keyword.t
>>>> --- a/tests/test-keyword.t
>>>> +++ b/tests/test-keyword.t
>>>> @@ -649,8 +649,16 @@
>>>> #if symlink
>>>> $ cp sym i
>>>> +#endif
>>>> +#if symlink unix-permissions
>>>> $ ls -l i
>>>> -rw-r--r--* (glob)
>>>> +#endif
>>>> +#if symlink no-unix-permissions
>>>> + $ ls -l i
>>>> + -rwxrwxrwx* (glob)
>>>> +#endif
>>>> +#if symlink
>>>> $ head -1 i
>>>> expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
>>>> $ hg copy --after --verbose sym i
>>>> diff --git a/tests/test-largefiles-update.t
>>>> b/tests/test-largefiles-update.t
>>>> --- a/tests/test-largefiles-update.t
>>>> +++ b/tests/test-largefiles-update.t
>>>> @@ -68,15 +68,22 @@
>>>> $ hg up
>>>> 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
>>>> +#if unix-permissions
>>>> $ hg debugdirstate --large --nodate
>>>> n 644 7 set large1
>>>> n 644 13 set large2
>>>> +#else
>>>> + $ hg debugdirstate --large --nodate
>>>> + n 755 7 unset large1
>>>> + n 755 13 unset large2
>>>> +#endif
>>>> Test that lfdirstate keeps track of last modification of largefiles and
>>>> prevents unnecessary hashing of content - also after linear/noop update
>>>> $ sleep 1
>>>> $ hg st
>>>> +#if unix-permissions
>>>> $ hg debugdirstate --large --nodate
>>>> n 644 7 set large1
>>>> n 644 13 set large2
>>>> @@ -85,6 +92,16 @@
>>>> $ hg debugdirstate --large --nodate
>>>> n 644 7 set large1
>>>> n 644 13 set large2
>>>> +#else
>>>> + $ hg debugdirstate --large --nodate
>>>> + n 755 7 set large1
>>>> + n 755 13 set large2
>>>> + $ hg up
>>>> + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
>>>> + $ hg debugdirstate --large --nodate
>>>> + n 755 7 set large1
>>>> + n 755 13 set large2
>>>> +#endif
>>>> Test that "hg merge" updates largefiles from "other" correctly
>>>> diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
>>>> --- a/tests/test-largefiles.t
>>>> +++ b/tests/test-largefiles.t
>>>> @@ -47,6 +47,7 @@
>>>> $ touch large1 sub/large2
>>>> $ sleep 1
>>>> $ hg st
>>>> +#if unix-permissions
>>>> $ hg debugstate --nodates
>>>> n 644 41 set .hglf/large1
>>>> n 644 41 set .hglf/sub/large2
>>>> @@ -55,6 +56,16 @@
>>>> $ hg debugstate --large --nodates
>>>> n 644 7 set large1
>>>> n 644 7 set sub/large2
>>>> +#else
>>>> + $ hg debugstate --nodates
>>>> + n 755 41 set .hglf/large1
>>>> + n 755 41 set .hglf/sub/large2
>>>> + n 755 8 set normal1
>>>> + n 755 8 set sub/normal2
>>>> + $ hg debugstate --large --nodates
>>>> + n 755 7 set large1
>>>> + n 755 7 set sub/large2
>>>> +#endif
>>>> $ echo normal11 > normal1
>>>> $ echo normal22 > sub/normal2
>>>> $ echo large11 > large1
>>>> diff --git a/tests/test-rebuildstate.t b/tests/test-rebuildstate.t
>>>> --- a/tests/test-rebuildstate.t
>>>> +++ b/tests/test-rebuildstate.t
>>>> @@ -78,6 +78,7 @@
>>>> ? baz
>>>> C foo
>>>> $ hg debugadddrop --normal-lookup baz
>>>> +#if unix-permissions
>>>> $ hg debugdirstate --nodates
>>>> r 0 0 * bar (glob)
>>>> n 0 -1 * baz (glob)
>>>> @@ -88,6 +89,18 @@
>>>> r 0 0 * bar (glob)
>>>> n 644 0 * foo (glob)
>>>> a 0 -1 * qux (glob)
>>>> +#else
>>>> + $ hg debugdirstate --nodates
>>>> + r 0 0 * bar (glob)
>>>> + n 0 -1 * baz (glob)
>>>> + n 755 0 * foo (glob)
>>>> + a 0 -1 * qux (glob)
>>>> + $ hg debugrebuilddirstate --minimal
>>>> + $ hg debugdirstate --nodates
>>>> + r 0 0 * bar (glob)
>>>> + n 755 0 * foo (glob)
>>>> + a 0 -1 * qux (glob)
>>>> +#endif
>>>> $ hg status -A
>>>> A qux
>>>> R bar
>>>> @@ -104,10 +117,17 @@
>>>> R bar
>>>> ? baz
>>>> C foo
>>>> +#if unix-permissions
>>>> $ hg debugdirstate --nodates
>>>> r 0 0 * bar (glob)
>>>> n 644 0 * foo (glob)
>>>> a 0 -1 * qux (glob)
>>>> +#else
>>>> + $ hg debugdirstate --nodates
>>>> + r 0 0 * bar (glob)
>>>> + n 755 0 * foo (glob)
>>>> + a 0 -1 * qux (glob)
>>>> +#endif
>>>> $ hg debugadddrop --drop foo
>>>> $ hg debugdirstate --nodates
>>>> r 0 0 * bar (glob)
>>>> diff --git a/tests/test-symlinks.t b/tests/test-symlinks.t
>>>> --- a/tests/test-symlinks.t
>>>> +++ b/tests/test-symlinks.t
>>>> @@ -33,7 +33,7 @@
>>>> $ hg commit -m 'is there a bug?'
>>>> $ cd ..
>>>> -
>>>> +#if unix-permissions
>>>> == fifo & ignore ==
>>>> $ hg init test; cd test;
>>>> @@ -66,7 +66,7 @@
>>>> a.c: unsupported file type (type is fifo)
>>>> ! a.c
>>>> $ cd ..
>>>> -
>>>> +#endif
>>>> == symlinks from outside the tree ==
>>>> diff --git a/tests/test-tools.t b/tests/test-tools.t
>>>> --- a/tests/test-tools.t
>>>> +++ b/tests/test-tools.t
>>>> @@ -38,7 +38,7 @@
>>>> $ f foo
>>>> foo:
>>>> -#if symlink
>>>> +#if unix-permissions
>>>> $ f foo --mode
>>>> foo: mode=644
>>>> #endif
>>>> @@ -88,7 +88,7 @@
>>>> $ cd ..
>>>> Yadda is a symlink
>>>> -#if symlink
>>>> +#if unix-permissions symlink
>>>> $ f -qr dir -HB 17
>>>> dir: directory with 3 files
>>>> dir/bar:
>>>> diff --git a/tests/test-transplant.t b/tests/test-transplant.t
>>>> --- a/tests/test-transplant.t
>>>> +++ b/tests/test-transplant.t
>>>> @@ -946,8 +946,13 @@
>>>> $ cat r1
>>>> Y1
>>>> +#if unix-permissions
>>>> $ hg debugstate | grep ' r1$'
>>>> n 644 3 unset r1
>>>> +#else
>>>> + $ hg debugstate | grep ' r1$'
>>>> + n 755 3 unset r1
>>>> +#endif
>>>> $ hg status -A r1
>>>> M r1
>>>> _______________________________________________
>>>> Mercurial-devel mailing list
>>>> Mercurial-devel at selenic.com
>>>> https://selenic.com/mailman/listinfo/mercurial-devel
>>>>
>>>
>>> _______________________________________________
>>> Mercurial-devel mailing list
>>> Mercurial-devel at selenic.com
>>> https://selenic.com/mailman/listinfo/mercurial-devel
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20160113/9d02ff1c/attachment.html>
More information about the Mercurial-devel
mailing list