1 #include <tools/ccanlint/ccanlint.h>
2 #include <tools/tools.h>
3 #include <ccan/talloc/talloc.h>
4 #include <ccan/str/str.h>
17 static const char *can_run(struct manifest *m)
20 return "Safe mode enabled";
24 static bool compile(struct manifest *m,
26 struct ccan_file *cfile,
29 cfile->compiled = maybe_temp_file(m, ".o", keep, cfile->fullname);
30 return compile_object(m, cfile->fullname, ccan_dir, "",
31 cfile->compiled, output);
34 static void do_compile_test_helpers(struct manifest *m,
36 unsigned int *timeleft,
40 bool errors = false, warnings = false;
42 if (list_empty(&m->other_test_c_files))
47 list_for_each(&m->other_test_c_files, i, list) {
50 if (!compile(m, keep, i, &cmdout)) {
52 score->error = "Failed to compile helper C files";
53 score_file_error(score, i, 0, cmdout);
54 } else if (!streq(cmdout, "")) {
56 score->error = "Helper C files gave warnings";
57 score_file_error(score, i, 0, cmdout);
63 score->score = score->total - warnings;
67 struct ccanlint compile_test_helpers = {
68 .key = "compile-helpers",
69 .name = "Module test helper objects compile",
70 .check = do_compile_test_helpers,
74 REGISTER_TEST(compile_test_helpers, &depends_built, &has_tests, NULL);