summaryrefslogtreecommitdiff
path: root/tools/ccanlint/tests
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-09-10 14:33:01 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-09-10 14:33:01 +0930
commite2a53df3e1f5912c872f1906912053354d0d0c63 (patch)
treeb3216c4533a4f993994915c062e0aed6af7dfffb /tools/ccanlint/tests
parent4c5f970e9e233c766699b1958a350ac3d3cb3f33 (diff)
tools: more intelligent caching for compile _info.
We let the get_deps() caller hand us the compiled _info filename, but what about recursive dependencies? These we re-generate every time. So fix this: hand a generator callback to get_deps(), expose the one which simply compiles it, and add a ccanlint one which looks up the manifest to see if we have one already. Before: $ ccanlint -vvvv ccan/failtest | grep -c 'Creating.*_info' 31 After: $ ccanlint -vvvv ccan/failtest | grep -c 'Creating.*_info' 17
Diffstat (limited to 'tools/ccanlint/tests')
-rw-r--r--tools/ccanlint/tests/depends_exist.c3
-rw-r--r--tools/ccanlint/tests/examples_compile.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/tools/ccanlint/tests/depends_exist.c b/tools/ccanlint/tests/depends_exist.c
index 27bbfc4e..7712c48d 100644
--- a/tools/ccanlint/tests/depends_exist.c
+++ b/tools/ccanlint/tests/depends_exist.c
@@ -57,8 +57,7 @@ static void check_depends_exist(struct manifest *m,
if (safe_mode)
deps = get_safe_ccan_deps(m, m->dir, true);
else
- deps = get_deps(m, m->dir, true,
- &m->info_file->compiled[COMPILE_NORMAL]);
+ deps = get_deps(m, m->dir, true, get_or_compile_info);
for (i = 0; deps[i]; i++) {
if (!strstarts(deps[i], "ccan/"))
diff --git a/tools/ccanlint/tests/examples_compile.c b/tools/ccanlint/tests/examples_compile.c
index 6602c546..7fb60845 100644
--- a/tools/ccanlint/tests/examples_compile.c
+++ b/tools/ccanlint/tests/examples_compile.c
@@ -62,8 +62,7 @@ static void add_dep(struct manifest ***deps, const char *basename)
if (m->info_file) {
char **infodeps;
- infodeps = get_deps(m, m->dir, false,
- &m->info_file->compiled[COMPILE_NORMAL]);
+ infodeps = get_deps(m, m->dir, false, get_or_compile_info);
for (i = 0; infodeps[i]; i++) {
if (strstarts(infodeps[i], "ccan/"))