- foreach_ptr(list, &m->c_files, &m->h_files,
- &m->run_tests, &m->api_tests,
+ core_deps = tal_count(deps) - 1;
+ test_deps = tal_count(tdeps) - 1;
+
+ used = tal_arrz(m, bool, core_deps + test_deps + 1);
+
+ foreach_ptr(list, &m->c_files, &m->h_files) {
+ struct ccan_file *f;
+
+ list_for_each(list, f, list)
+ ok &= check_dep_includes(m, deps, used, score, f);
+ }
+
+ for (i = 0; i < core_deps; i++) {
+ if (!used[i] && strstarts(deps[i], "ccan/"))
+ score_file_error(score, m->info_file, 0,
+ "%s is an unused dependency",
+ deps[i]);
+ }
+
+ /* Now remove NUL and append test dependencies to deps. */
+ deps = tal_dup_arr(m, char *, take(deps), core_deps, test_deps + 2);
+ memcpy(deps + core_deps, tdeps, sizeof(tdeps[0]) * test_deps);
+ /* ccan/tap is given a free pass. */
+ deps[core_deps + test_deps] = (char *)"ccan/tap";
+ deps[core_deps + test_deps + 1] = NULL;
+
+ foreach_ptr(list, &m->run_tests, &m->api_tests,