summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Vandiver <alexmv@dropbox.com>2018-01-02 19:04:54 -0800
committerJunio C Hamano <gitster@pobox.com>2018-01-04 15:06:42 -0800
commit6e1123ec5730cf1dc14b76fa726fe856fe001cbd (patch)
tree5a59b3eb8945f4e42cb57614ca673a3464a32b7c
parentc2e4484a87b0d6d15d421d6036429fc2ec1f2a61 (diff)
downloadgit-6e1123ec5730cf1dc14b76fa726fe856fe001cbd.tar.gz
fsmonitor: make output of test-dump-fsmonitor more concise
Rather than display one very long line, summarize the contents of that line. The tests do not currently rely on any content except the first line ("no fsmonitor" / "fsmonitor last update"). Signed-off-by: Alex Vandiver <alexmv@dropbox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/helper/test-dump-fsmonitor.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/t/helper/test-dump-fsmonitor.c b/t/helper/test-dump-fsmonitor.c
index 48c4bab0b3..5d61b0d621 100644
--- a/t/helper/test-dump-fsmonitor.c
+++ b/t/helper/test-dump-fsmonitor.c
@@ -4,7 +4,8 @@
int cmd_main(int ac, const char **av)
{
struct index_state *istate = &the_index;
- int i;
+ uint64_t now = getnanotime();
+ int i, valid = 0;
git_config_push_parameter("core.fsmonitor=keep");
setup_git_directory();
@@ -14,10 +15,17 @@ int cmd_main(int ac, const char **av)
printf("no fsmonitor\n");
return 0;
}
- printf("fsmonitor last update %"PRIuMAX"\n", (uintmax_t)istate->fsmonitor_last_update);
+
+ printf("fsmonitor last update %"PRIuMAX", (%.2f seconds ago)\n",
+ (uintmax_t)istate->fsmonitor_last_update,
+ (now - istate->fsmonitor_last_update)/1.0e9);
for (i = 0; i < istate->cache_nr; i++)
- printf((istate->cache[i]->ce_flags & CE_FSMONITOR_VALID) ? "+" : "-");
+ if (istate->cache[i]->ce_flags & CE_FSMONITOR_VALID)
+ valid++;
+
+ printf(" valid: %d\n", valid);
+ printf(" invalid: %d\n", istate->cache_nr - valid);
return 0;
}