#include <stdbool.h>
#include "../doc_extract.h"
-#define REGISTER_TEST(name, ...)
+#define REGISTER_TEST(name, ...) extern struct ccanlint name
/* 0 == Describe failed tests.
1 == Describe results for partial failures.
#include <ccan/noerr/noerr.h>
#include <ccan/grab_file/grab_file.h>
-extern struct ccanlint info_documentation_exists;
+REGISTER_TEST(info_documentation_exists);
static void create_info_template_doc(struct manifest *m, struct score *score)
{
.needs = "info_exists"
};
-REGISTER_TEST(info_documentation_exists);
#include <ccan/talloc/talloc.h>
#include <ccan/str/str.h>
-struct ccanlint has_license;
+REGISTER_TEST(license_exists);
static struct doc_section *find_license(const struct manifest *m)
{
score->error = talloc_strdup(score,
"LICENSE does not exist");
if (expected)
- has_license.handle = handle_license_link;
+ license_exists.handle = handle_license_link;
return;
}
err(1, "readlink on %s", license);
.check = check_has_license,
.needs = "info_exists"
};
-
-REGISTER_TEST(license_exists);
#include <err.h>
#include <ccan/talloc/talloc.h>
-extern struct ccanlint tests_exist;
+REGISTER_TEST(tests_exist);
static void handle_no_tests(struct manifest *m, struct score *score)
{
.needs = ""
};
-REGISTER_TEST(tests_exist);
#include <string.h>
#include <ctype.h>
-struct ccanlint run_tests_vg;
+REGISTER_TEST(tests_pass_valgrind);
/* Note: we already test safe_mode in run_tests.c */
static const char *can_run_vg(struct manifest *m)
" --leak-check=full"
" --log-fd=3 %s %s"
" 3> valgrind.log",
- run_tests_vg.options ?
- run_tests_vg.options : "",
+ tests_pass_valgrind.options ?
+ tests_pass_valgrind.options : "",
i->compiled);
output = grab_file(i, "valgrind.log", NULL);
if (!output || output[0] == '\0') {
first = list_top(&score->per_file_errors, struct file_error, list);
command = talloc_asprintf(m, "valgrind --db-attach=yes%s %s",
- run_tests_vg.options ?
- run_tests_vg.options : "",
+ tests_pass_valgrind.options ?
+ tests_pass_valgrind.options : "",
first->file->compiled);
if (system(command))
doesnt_matter();
.needs = "tests_pass"
};
-REGISTER_TEST(tests_pass_valgrind);
-
struct ccanlint tests_pass_valgrind_noleaks = {
.key = "tests_pass_valgrind_noleaks",
.name = "Module's run and api tests have no memory leaks",