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,
20 unsigned int *timeleft,
23 struct list_head *list;
28 foreach_ptr(list, &m->run_tests, &m->api_tests) {
29 list_for_each(list, i, list) {
32 printf(" %s\n", i->name);
33 if (run_command(m, timeleft, &cmdout, "%s",
34 i->compiled[COMPILE_NOFEAT]))
37 score_file_error(score, i, 0, "%s", cmdout);
41 if (score->score == score->total)
45 /* Gcc's warn_unused_result is fascist bullshit. */
46 #define doesnt_matter()
48 static void run_under_debugger(struct manifest *m, struct score *score)
51 struct file_error *first;
53 first = list_top(&score->per_file_errors, struct file_error, list);
55 if (!ask("Should I run the first failing test under the debugger?"))
58 command = talloc_asprintf(m, "gdb -ex 'break tap.c:139' -ex 'run' %s",
65 struct ccanlint tests_pass_without_features = {
66 .key = "tests_pass_without_features",
67 .name = "Module's run and api tests pass (without features)",
68 .check = do_run_tests_no_features,
69 .handle = run_under_debugger,
70 .needs = "tests_compile_without_features"
73 REGISTER_TEST(tests_pass_without_features);