Re: [PATCH v5 4/7] fsmonitor: add test cases for fsmonitor extension
- From
Ben Peart <peartben@gmail.com>
- Date
- Jul 7, 2017, 18:50 UTC
- Message-ID
- <19e50acb-d4f0-b8f0-2966-0a33770296b1@gmail.com>
- In-Reply-To
- <CAP8UFD3FtddFuaVY9qEyxbm6hiYhFR2TrZ32Cubp4GAEf9+vaQ@mail.gmail.com>
On 6/27/2017 12:20 PM, Christian Couder wrote:
Show 18 quoted lines
> On Sat, Jun 10, 2017 at 3:40 PM, Ben Peart <peartben@gmail.com> wrote:
>
>> +# fsmonitor works correctly with or without the untracked cache
>> +# but if it is available, we'll turn it on to ensure we test that
>> +# codepath as well.
>> +
>> +test_lazy_prereq UNTRACKED_CACHE '
>> + { git update-index --test-untracked-cache; ret=$?; } &&
>> + test $ret -ne 1
>> +'
>> +
>> +if test_have_prereq UNTRACKED_CACHE; then
>> + git config core.untrackedcache true
>> +else
>> + git config core.untrackedcache false
>> +fi
>
> I wonder if it would be better to just do something like:That is a good idea; I'll add that around the tests that aren't explicitly testing interop with and without the untracked cache.
Thanks!
Show 31 quoted lines
> > ===================== > > test_expect_success 'setup' ' > .... > ' > > uc_values="false" > test_have_prereq UNTRACKED_CACHE && uc_values="false true" > > for uc_val in $uc_values > do > > test_expect_success "setup untracked cache to $uc_val" ' > git config core.untrackedcache $uc_val > ' > > test_expect_success 'refresh_index() invalidates fsmonitor cache' ' > ... > ' > > test_expect_success "status doesn't detect unreported modifications" ' > ... > ' > > ... > > done > > ===================== >