Patchwork [2,of,5] tests: add 'f' tool for cross platform file operations in the tests

login
register
mail settings
Submitter Matt Harbison
Date Jan. 15, 2015, 4:05 a.m.
Message ID <op.xshkb4iy9lwrgf@envy>
Download mbox | patch
Permalink /patch/7466/
State Accepted
Headers show

Comments

Matt Harbison - Jan. 15, 2015, 4:05 a.m.
On Wed, 14 Jan 2015 18:24:37 -0500, Mads Kiilerich <mads@kiilerich.com>  
wrote:

> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1421194526 -3600
> #      Wed Jan 14 01:15:26 2015 +0100
> # Node ID 2c32e9ed5aa5ee5a1091695d28e745ff1c2d868f
> # Parent  1b43d00b9a2551b3e70b09562e27c50c0cb6decd
> tests: add 'f' tool for cross platform file operations in the tests

I'm getting this test failure on Fedora 16, even without the patch I  
submitted for Windows fixes.  Any ideas?
Katsunori FUJIWARA - Jan. 15, 2015, 2:05 p.m.
At Wed, 14 Jan 2015 23:05:54 -0500,
Matt Harbison wrote:
> 
> On Wed, 14 Jan 2015 18:24:37 -0500, Mads Kiilerich <mads@kiilerich.com>  
> wrote:
> 
> > # HG changeset patch
> > # User Mads Kiilerich <madski@unity3d.com>
> > # Date 1421194526 -3600
> > #      Wed Jan 14 01:15:26 2015 +0100
> > # Node ID 2c32e9ed5aa5ee5a1091695d28e745ff1c2d868f
> > # Parent  1b43d00b9a2551b3e70b09562e27c50c0cb6decd
> > tests: add 'f' tool for cross platform file operations in the tests
> 
> I'm getting this test failure on Fedora 16, even without the patch I  
> submitted for Windows fixes.  Any ideas?

At least for tests of Mercurial, "stat.st_size" of directories seems
not to show valuable information, because:

  - it means not "how many blocks are USED(NEEDED)", but "how many
    blocks are ALLOCATED"

  - total size (blocksize * # of allocated blocks) of directories
    depends on underlying filesystems and devices

IMHO, "f" command can ignore "-s/--size" for directories.


> --- /home/matt/hg/tests/test-tools.t
> +++ /home/matt/hg/tests/test-tools.t.err
> @@ -60,7 +60,7 @@
> 
>     $ ln -s yadda l
>     $ f . --recurse -MStmsB4
> -  .: directory with 4 files, size=120, mode=755
> +  .: directory with 4 files, size=4096, mode=755
>     ./bar: file, size=21, mode=755, md5=3b03, sha1=612c
>     ./baz: file, size=21, mode=755, md5=3b03, sha1=612c
>     ./foo: file, size=4, mode=644, md5=d3b0, sha1=f1d2
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy@lares.dti.ne.jp
Mads Kiilerich - Jan. 15, 2015, 3:27 p.m.
On 01/15/2015 03:05 PM, FUJIWARA Katsunori wrote:
> At Wed, 14 Jan 2015 23:05:54 -0500,
> Matt Harbison wrote:
>> On Wed, 14 Jan 2015 18:24:37 -0500, Mads Kiilerich <mads@kiilerich.com>
>> wrote:
>>
>>> # HG changeset patch
>>> # User Mads Kiilerich <madski@unity3d.com>
>>> # Date 1421194526 -3600
>>> #      Wed Jan 14 01:15:26 2015 +0100
>>> # Node ID 2c32e9ed5aa5ee5a1091695d28e745ff1c2d868f
>>> # Parent  1b43d00b9a2551b3e70b09562e27c50c0cb6decd
>>> tests: add 'f' tool for cross platform file operations in the tests
>> I'm getting this test failure on Fedora 16, even without the patch I
>> submitted for Windows fixes.  Any ideas?
> At least for tests of Mercurial, "stat.st_size" of directories seems
> not to show valuable information, because:
>
>    - it means not "how many blocks are USED(NEEDED)", but "how many
>      blocks are ALLOCATED"
>
>    - total size (blocksize * # of allocated blocks) of directories
>      depends on underlying filesystems and devices
>
> IMHO, "f" command can ignore "-s/--size" for directories.

I agree - I will fix that.

/Mads

Patch

--- /home/matt/hg/tests/test-tools.t
+++ /home/matt/hg/tests/test-tools.t.err
@@ -60,7 +60,7 @@ 

    $ ln -s yadda l
    $ f . --recurse -MStmsB4
-  .: directory with 4 files, size=120, mode=755
+  .: directory with 4 files, size=4096, mode=755
    ./bar: file, size=21, mode=755, md5=3b03, sha1=612c
    ./baz: file, size=21, mode=755, md5=3b03, sha1=612c
    ./foo: file, size=4, mode=644, md5=d3b0, sha1=f1d2