Skip to content

Commit 2ae798f

Browse files
benpeartdscho
authored andcommitted
fscache: add GIT_TEST_FSCACHE support
Add support to fscache to enable running the entire test suite with the fscache enabled. Signed-off-by: Ben Peart <[email protected]>
1 parent 56dc79a commit 2ae798f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

compat/win32/fscache.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "../../hashmap.h"
33
#include "../win32.h"
44
#include "fscache.h"
5+
#include "config.h"
56

67
static int initialized;
78
static volatile long enabled;
@@ -398,7 +399,11 @@ int fscache_enable(int enable)
398399
int result;
399400

400401
if (!initialized) {
402+
int fscache = git_env_bool("GIT_TEST_FSCACHE", -1);
403+
401404
/* allow the cache to be disabled entirely */
405+
if (fscache != -1)
406+
core_fscache = fscache;
402407
if (!core_fscache)
403408
return 0;
404409

t/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@ a test and then fails then the whole test run will abort. This can help to make
472472
sure the expected tests are executed and not silently skipped when their
473473
dependency breaks or is simply not present in a new environment.
474474

475+
GIT_TEST_FSCACHE=<boolean> exercises the uncommon fscache code path
476+
which adds a cache below mingw's lstat and dirent implementations.
477+
475478
Naming Tests
476479
------------
477480

0 commit comments

Comments
 (0)