Skip to content

Commit

Permalink
fscache: add GIT_TEST_FSCACHE support
Browse files Browse the repository at this point in the history
Add support to fscache to enable running the entire test suite with the
fscache enabled.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
  • Loading branch information
benpeart authored and dscho committed Sep 16, 2022
1 parent d1a82a9 commit 98c2e04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compat/win32/fscache.c
Expand Up @@ -3,6 +3,7 @@
#include "../win32.h"
#include "fscache.h"
#include "../../dir.h"
#include "config.h"

static int initialized;
static volatile long enabled;
Expand Down Expand Up @@ -399,7 +400,11 @@ int fscache_enable(int enable)
int result;

if (!initialized) {
int fscache = git_env_bool("GIT_TEST_FSCACHE", -1);

/* allow the cache to be disabled entirely */
if (fscache != -1)
core_fscache = fscache;
if (!core_fscache)
return 0;

Expand Down
3 changes: 3 additions & 0 deletions t/README
Expand Up @@ -507,6 +507,9 @@ a test and then fails then the whole test run will abort. This can help to make
sure the expected tests are executed and not silently skipped when their
dependency breaks or is simply not present in a new environment.

GIT_TEST_FSCACHE=<boolean> exercises the uncommon fscache code path
which adds a cache below mingw's lstat and dirent implementations.

Naming Tests
------------

Expand Down

0 comments on commit 98c2e04

Please sign in to comment.