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_file_error(score, i, 0, "Compile failed:\n%s",
54 } else if (!streq(cmdout, "")) {
56 score_file_error(score, i, 0,
57 "Compile gave warnings:\n%s", cmdout);
63 score->score = score->total - warnings;
67 struct ccanlint tests_helpers_compile = {
68 .key = "tests_helpers_compile",
69 .name = "Module test helper objects compile",
70 .check = do_compile_test_helpers,
72 .needs = "depends_build tests_exist"
75 REGISTER_TEST(tests_helpers_compile);