Commit 43ea8915 authored by Rusty Russell's avatar Rusty Russell

ccanlint: use dgraph module.

Instead of a linked list of tests, we use dgraph and strmap.
parent 64bd9ff9
...@@ -4,6 +4,7 @@ TEST_OBJS := $(TEST_CFILES:.c=.o) ...@@ -4,6 +4,7 @@ TEST_OBJS := $(TEST_CFILES:.c=.o)
CORE_OBJS := \ CORE_OBJS := \
ccan/asort/asort.o \ ccan/asort/asort.o \
ccan/btree/btree.o \ ccan/btree/btree.o \
ccan/dgraph/dgraph.o \
ccan/foreach/foreach.o \ ccan/foreach/foreach.o \
ccan/grab_file/grab_file.o \ ccan/grab_file/grab_file.o \
ccan/hash/hash.o \ ccan/hash/hash.o \
...@@ -17,6 +18,7 @@ CORE_OBJS := \ ...@@ -17,6 +18,7 @@ CORE_OBJS := \
ccan/read_write_all/read_write_all.o \ ccan/read_write_all/read_write_all.o \
ccan/str/str.o ccan/str/debug.o \ ccan/str/str.o ccan/str/debug.o \
ccan/str_talloc/str_talloc.o \ ccan/str_talloc/str_talloc.o \
ccan/strmap/strmap.o \
ccan/talloc/talloc.o \ ccan/talloc/talloc.o \
ccan/talloc_link/talloc_link.o \ ccan/talloc_link/talloc_link.o \
ccan/time/time.o \ ccan/time/time.o \
......
This diff is collapsed.
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define CCAN_LINT_H #define CCAN_LINT_H
#include "config.h" #include "config.h"
#include <ccan/list/list.h> #include <ccan/list/list.h>
#include <ccan/dgraph/dgraph.h>
#include <stdbool.h> #include <stdbool.h>
#include "../doc_extract.h" #include "../doc_extract.h"
#include "licenses.h" #include "licenses.h"
...@@ -80,8 +81,6 @@ struct score { ...@@ -80,8 +81,6 @@ struct score {
}; };
struct ccanlint { struct ccanlint {
struct list_node list;
/* More concise unique name of test. */ /* More concise unique name of test. */
const char *key; const char *key;
...@@ -113,10 +112,10 @@ struct ccanlint { ...@@ -113,10 +112,10 @@ struct ccanlint {
const char *needs; const char *needs;
/* Internal use fields: */ /* Internal use fields: */
/* Who depends on us? */ /* We are a node in a dependency graph. */
struct list_head dependencies; struct dgraph_node node;
/* How many things do we (still) depend on? */ /* Are we targeted? */
unsigned int num_depends; bool should_run;
/* Did we skip a dependency? If so, must skip this, too. */ /* Did we skip a dependency? If so, must skip this, too. */
const char *skip; const char *skip;
/* Did we fail a dependency? If so, skip and mark as fail. */ /* Did we fail a dependency? If so, skip and mark as fail. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment