return "dependency couldn't run";
}
-static bool cannot_run(struct dgraph_node *node, void *unused)
+static bool cannot_run(struct dgraph_node *node, void *all)
{
struct ccanlint *c = container_of(node, struct ccanlint, node);
c->can_run = dep_failed;
+
return true;
}
unsigned int i;
const char *prefix = "";
char *cwd = path_cwd(NULL), *dir;
- struct dgraph_node all;
+ struct ccanlint top; /* cannot_run may try to set ->can_run */
const char *override_compiler = NULL, *override_cflags = NULL;
/* Empty graph node to which we attach everything else. */
- dgraph_init_node(&all);
+ dgraph_init_node(&top.node);
opt_register_early_noarg("--verbose|-v", opt_inc_intval, &verbose,
"verbose mode (up to -vvvv)");
opt_register_arg("--timeout <milleseconds>", opt_set_uintval,
NULL, &timeout,
"ignore (terminate) tests that are slower than this");
- opt_register_arg("-t|--target <testname>", opt_set_target, NULL, &all,
+ opt_register_arg("-t|--target <testname>", opt_set_target, NULL,
+ &top.node,
"only run one test (and its prerequisites)");
opt_register_arg("--compiler <compiler>", opt_set_const_charp,
NULL, &override_compiler, "set the compiler");
opt_parse(&argc, argv, opt_log_stderr_exit);
if (!targeting)
- strmap_iterate(&tests, add_to_all, &all);
+ strmap_iterate(&tests, add_to_all, &top.node);
if (argc == 1)
dir = cwd;
compiler = override_compiler;
if (argc == 1)
- pass = test_module(&all, cwd, "", summary);
+ pass = test_module(&top.node, cwd, "", summary);
else {
for (i = 1; i < argc; i++) {
dir = path_canon(NULL,
prefix = path_rel(NULL, take(prefix), dir);
prefix = tal_strcat(NULL, take(prefix), ": ");
- pass &= test_module(&all, dir, prefix, summary);
- reset_tests(&all);
+ pass &= test_module(&top.node, dir, prefix, summary);
+ reset_tests(&top.node);
}
}
return pass ? 0 : 1;