1 #include <tools/ccanlint/ccanlint.h>
2 #include <tools/tools.h>
3 #include <ccan/str/str.h>
4 #include <ccan/foreach/foreach.h>
17 /* We don't do these under valgrind: too slow! */
18 static void do_run_tests_no_features(struct manifest *m,
19 unsigned int *timeleft,
22 struct list_head *list;
27 foreach_ptr(list, &m->run_tests, &m->api_tests) {
28 list_for_each(list, i, list) {
31 printf(" %s\n", i->name);
32 if (run_command(m, timeleft, &cmdout, "%s",
33 i->compiled[COMPILE_NOFEAT]))
36 score_file_error(score, i, 0, "%s", cmdout);
40 if (score->score == score->total)
44 /* Gcc's warn_unused_result is fascist bullshit. */
45 #define doesnt_matter()
47 static void run_under_debugger(struct manifest *m, struct score *score)
50 struct file_error *first;
52 first = list_top(&score->per_file_errors, struct file_error, list);
54 if (!ask("Should I run the first failing test under the debugger?"))
57 command = tal_fmt(m, "gdb -ex 'break tap.c:139' -ex 'run' %s",
58 first->file->compiled[COMPILE_NOFEAT]);
59 if (system(command)) {
64 struct ccanlint tests_pass_without_features = {
65 .key = "tests_pass_without_features",
66 .name = "Module's run and api tests pass (without features)",
67 .check = do_run_tests_no_features,
68 .handle = run_under_debugger,
69 .needs = "tests_compile_without_features"
72 REGISTER_TEST(tests_pass_without_features);