- struct compile_tests_result *res;
-
- list_head_init(list);
-
- compile_tests.total_score = 0;
- list_for_each(&m->compile_ok_tests, i, list) {
- compile_tests.total_score++;
- cmdout = compile(list, m, i, false, false);
- if (cmdout) {
- res = talloc(list, struct compile_tests_result);
- res->filename = i->name;
- res->description = "failed to compile";
- res->output = talloc_steal(res, cmdout);
- list_add_tail(list, &res->list);
- }
- }
-
- list_for_each(&m->run_tests, i, list) {
- compile_tests.total_score++;
- cmdout = compile(m, m, i, false, false);
- if (cmdout) {
- res = talloc(list, struct compile_tests_result);
- res->filename = i->name;
- res->description = "failed to compile";
- res->output = talloc_steal(res, cmdout);
- list_add_tail(list, &res->list);
+ struct list_head *list;
+ bool errors = false, warnings = false;
+
+ foreach_ptr(list, &m->compile_ok_tests, &m->run_tests, &m->api_tests) {
+ list_for_each(list, i, list) {
+ if (!compile(score, m, i, false, list == &m->api_tests,
+ keep, &cmdout)) {
+ score->error = "Failed to compile tests";
+ score_file_error(score, i, 0, cmdout);
+ errors = true;
+ } else if (!streq(cmdout, "")) {
+ score->error = "Test compiled with warnings";
+ score_file_error(score, i, 0, cmdout);
+ warnings = true;
+ }