- const struct ccanlint *i;
- struct btree *keys, *names;
-
-#undef REGISTER_TEST
-#define REGISTER_TEST(name, ...) register_test(&normal_tests, &name, __VA_ARGS__, NULL)
-#include "generated-normal-tests"
-#undef REGISTER_TEST
-#define REGISTER_TEST(name, ...) register_test(&compulsory_tests, &name, __VA_ARGS__, NULL)
-#include "generated-compulsory-tests"
-
- /* Self-consistency check: make sure no two tests
- have the same key or name. */
- keys = btree_new(btree_strcmp);
- names = btree_new(btree_strcmp);
- list_for_each(&compulsory_tests, i, list) {
- if (!btree_insert(keys, i->key))
- errx(1, "BUG: Duplicate test key '%s'", i->key);
- if (!btree_insert(keys, i->name))
- errx(1, "BUG: Duplicate test name '%s'", i->name);
- }
- list_for_each(&normal_tests, i, list) {
- if (!btree_insert(keys, i->key))
- errx(1, "BUG: Duplicate test key '%s'", i->key);
- if (!btree_insert(keys, i->name))
- errx(1, "BUG: Duplicate test name '%s'", i->name);
- }
- btree_delete(keys);
- btree_delete(names);
-
- if (!verbose)
- return;
-
- printf("\nCompulsory Tests\n");
- list_for_each(&compulsory_tests, i, list) {
- printf("%s depends on %u others\n", i->name, i->num_depends);
- if (!list_empty(&i->dependencies)) {
- const struct dependent *d;
- printf("These depend on us:\n");
- list_for_each(&i->dependencies, d, node)
- printf("\t%s\n", d->dependent->name);
- }
+ return strmap_get(&tests, key);
+}
+
+bool is_excluded(const char *name)
+{
+ return find_test(name)->skip != NULL;
+}
+
+static bool init_deps(const char *member, struct ccanlint *c, void *unused)
+{
+ char **deps = tal_strsplit(NULL, c->needs, " ", STR_EMPTY_OK);
+ unsigned int i;
+
+ for (i = 0; deps[i]; i++) {
+ struct ccanlint *dep;
+
+ dep = find_test(deps[i]);
+ if (!dep)
+ errx(1, "BUG: unknown dep '%s' for %s",
+ deps[i], c->key);
+ dgraph_add_edge(&dep->node, &c->node);