Pádraig Brady wrote:
> On 02/09/10 12:39, Jim Meyering wrote:
>> Regarding your proposed new test, there is a slightly
>> more efficient way to do it:
>>
>>   $ git grep df.--local tests
>>   tests/du/basic:if df --local . >/dev/null 2>&1; then
>>   tests/du/slink:if df --local . >/dev/null 2>&1; then
>>   ...
>>
>> I.e., you can examine merely the exit status.
>> If you do that, please encapsulate the test in a function
>> to be defined in tests/init.cfg, I suppose.
>
> OK cool,
> I'll apply something like the following untested patch later.
...
>     tests: exclude some tests when running on NFS
>
>     * tests/init.cfg (is_local_dir_): A new function
>     returning if the current directory is on a local file system.
>     (require_local_dir_): A new function to skip tests
>     if not on a local dir.
>     * tests/cp/existing-perm-race: Skip if non local.
>     * tests/cp/file-perm-race: Likewise.
>     * tests/cp/parent-perm: Likewise.
>     * tests/cp/parent-perm-race: Likewise.
>     * tests/cp/preserve-2: Likewise.
>     * tests/mv/part-symlink: Likewise.
>     * tests/du/basic: Use refactored function.
>     * tests/du/slink: Likewise.

Thanks!  That looks right.
However at least 3 more tests can use one of the new functions
in place of existing df --local uses:
(yeah, depending on your font size, "..." without the quotes,
can be almost invisible)

  $ git grep -l df.--local tests
  tests/du/basic
  tests/du/slink
  tests/install/basic-1
  tests/ls/readdir-mountpoint-inode
  tests/mkdir/p-3



Reply via email to