1 #include <tools/ccanlint/ccanlint.h>
2 #include <tools/tools.h>
3 #include <ccan/talloc/talloc.h>
4 #include <ccan/str/str.h>
5 #include <ccan/foreach/foreach.h>
18 /* We don't do these under valgrind: too slow! */
19 static void do_run_tests_no_features(struct manifest *m,
21 unsigned int *timeleft,
24 struct list_head *list;
29 foreach_ptr(list, &m->run_tests, &m->api_tests) {
30 list_for_each(list, i, list) {
33 printf(" %s\n", i->name);
34 if (run_command(m, timeleft, &cmdout, "%s",
35 i->compiled[COMPILE_NOFEAT]))
38 score_file_error(score, i, 0, "%s", cmdout);
42 if (score->score == score->total)
46 /* Gcc's warn_unused_result is fascist bullshit. */
47 #define doesnt_matter()
49 static void run_under_debugger(struct manifest *m, struct score *score)
52 struct file_error *first;
54 first = list_top(&score->per_file_errors, struct file_error, list);
56 if (!ask("Should I run the first failing test under the debugger?"))
59 command = talloc_asprintf(m, "gdb -ex 'break tap.c:139' -ex 'run' %s",
66 struct ccanlint tests_pass_without_features = {
67 .key = "tests_pass_without_features",
68 .name = "Module's run and api tests pass (without features)",
69 .check = do_run_tests_no_features,
70 .handle = run_under_debugger,
71 .needs = "tests_compile_without_features"
74 REGISTER_TEST(tests_pass_without_features);