score->score = score->total;
}
-struct ccanlint build = {
+struct ccanlint module_builds = {
.key = "module_builds",
.name = "Module can be built from object files",
.check = do_build,
.needs = "objects_build"
};
-REGISTER_TEST(build);
+REGISTER_TEST(module_builds);
}
}
-struct ccanlint build_objs = {
+struct ccanlint objects_build = {
.key = "objects_build",
.name = "Module object files can be built",
.check = check_objs_build,
.needs = "depends_exist"
};
-REGISTER_TEST(build_objs);
+REGISTER_TEST(objects_build);
}
}
-struct ccanlint check_build = {
+struct ccanlint module_links = {
.key = "module_links",
.name = "Module can be linked against trivial program",
.check = check_use_build,
.needs = "module_builds depends_build"
};
-REGISTER_TEST(check_build);
+REGISTER_TEST(module_links);
score->score = score->total;
}
-struct ccanlint depends_built = {
+struct ccanlint depends_build = {
.key = "depends_build",
.name = "Module's CCAN dependencies can be found or built",
.check = check_depends_built,
.needs = "depends_exist"
};
-REGISTER_TEST(depends_built);
+REGISTER_TEST(depends_build);
}
}
-struct ccanlint includes_build = {
+struct ccanlint main_header_compiles = {
.key = "main_header_compiles",
.name = "Modules main header compiles",
.check = check_includes_build,
.needs = "depends_exist main_header_exists"
};
-REGISTER_TEST(includes_build);
+REGISTER_TEST(main_header_compiles);
fclose(info);
}
-struct ccanlint has_info = {
+struct ccanlint info_exists = {
.key = "info_exists",
.name = "Module has _info file",
.check = check_has_info,
.needs = ""
};
-REGISTER_TEST(has_info);
+REGISTER_TEST(info_exists);
m->basename, m->basename);
}
-struct ccanlint has_main_header = {
+struct ccanlint main_header_exists = {
.key = "main_header_exists",
.name = "Module has main header file",
.check = check_has_main_header,
.needs = ""
};
-REGISTER_TEST(has_main_header);
+REGISTER_TEST(main_header_exists);
}
}
-struct ccanlint compile_coverage_tests = {
+struct ccanlint tests_compile_coverage = {
.key = "tests_compile_coverage",
.name = "Module tests compile with " COVERAGE_CFLAGS,
.check = do_compile_coverage_tests,
.needs = "tests_compile"
};
-REGISTER_TEST(compile_coverage_tests);
+REGISTER_TEST(tests_compile_coverage);
}
}
-struct ccanlint compile_test_helpers = {
+struct ccanlint tests_helpers_compile = {
.key = "tests_helpers_compile",
.name = "Module test helper objects compile",
.check = do_compile_test_helpers,
.needs = "depends_build tests_exist"
};
-REGISTER_TEST(compile_test_helpers);
+REGISTER_TEST(tests_helpers_compile);
score->score = 1 + !warnings;
}
-struct ccanlint compile_tests = {
+struct ccanlint tests_compile = {
.key = "tests_compile",
.name = "Module tests compile",
.check = do_compile_tests,
.needs = "tests_helpers_compile objects_build"
};
-REGISTER_TEST(compile_tests);
+REGISTER_TEST(tests_compile);
score->pass = score->score != 0;
}
-struct ccanlint has_examples = {
+struct ccanlint examples_exist = {
.key = "examples_exist",
.name = "_info and main header file have Example: sections",
.check = extract_examples,
.needs = "info_exists"
};
-REGISTER_TEST(has_examples);
+REGISTER_TEST(examples_exist);
#include <ccan/noerr/noerr.h>
#include <ccan/grab_file/grab_file.h>
-extern struct ccanlint has_info_documentation;
+extern struct ccanlint info_documentation_exists;
static void create_info_template_doc(struct manifest *m, struct score *score)
{
}
}
-static void check_has_info_documentation(struct manifest *m,
+static void check_info_documentation_exists(struct manifest *m,
bool keep,
unsigned int *timeleft,
struct score *score)
score->error = "_info file has no module documentation.\n\n"
"CCAN modules use /**-style comments for documentation: the\n"
"overall documentation belongs in the _info metafile.\n";
- has_info_documentation.handle = create_info_template_doc;
+ info_documentation_exists.handle = create_info_template_doc;
} else if (!description) {
score->error = "_info file has no module description.\n\n"
"The lines after the first summary line in the _info file\n"
}
}
-struct ccanlint has_info_documentation = {
+struct ccanlint info_documentation_exists = {
.key = "info_documentation_exists",
.name = "Module has documentation in _info",
- .check = check_has_info_documentation,
+ .check = check_info_documentation_exists,
.needs = "info_exists"
};
-REGISTER_TEST(has_info_documentation);
+REGISTER_TEST(info_documentation_exists);
#include <err.h>
#include <ccan/talloc/talloc.h>
-extern struct ccanlint has_tests;
+extern struct ccanlint tests_exist;
static void handle_no_tests(struct manifest *m, struct score *score)
{
fclose(run);
}
-static void check_has_tests(struct manifest *m,
+static void check_tests_exist(struct manifest *m,
bool keep,
unsigned int *timeleft, struct score *score)
{
score->error = "No test directory";
if (errno != ENOENT)
err(1, "statting %s", test_dir);
- has_tests.handle = handle_no_tests;
+ tests_exist.handle = handle_no_tests;
return;
}
&& list_empty(&m->compile_ok_tests)) {
if (list_empty(&m->compile_fail_tests)) {
score->error = "No tests in test directory";
- has_tests.handle = handle_no_tests;
+ tests_exist.handle = handle_no_tests;
} else
score->error = "No positive tests in test directory";
return;
score->score = score->total;
}
-struct ccanlint has_tests = {
+struct ccanlint tests_exist = {
.key = "tests_exist",
.name = "Module has test directory with tests in it",
- .check = check_has_tests,
+ .check = check_tests_exist,
.needs = ""
};
-REGISTER_TEST(has_tests);
+REGISTER_TEST(tests_exist);
}
}
-struct ccanlint idempotent = {
+struct ccanlint headers_idempotent = {
.key = "headers_idempotent",
.name = "Module headers are #ifndef/#define wrapped",
.check = check_idempotent,
.needs = ""
};
-REGISTER_TEST(idempotent);
+REGISTER_TEST(headers_idempotent);
score->score = score->total;
}
-struct ccanlint has_license = {
+struct ccanlint license_exists = {
.key = "license_exists",
.name = "Module has License: entry in _info, and LICENSE symlink/file",
.check = check_has_license,
.needs = "info_exists"
};
-REGISTER_TEST(has_license);
+REGISTER_TEST(license_exists);
analyze_coverage(m, full_gcov, cmdout, score);
}
-struct ccanlint run_coverage_tests = {
+struct ccanlint tests_coverage = {
.key = "tests_coverage",
.name = "Module's tests cover all the code",
.check = do_run_coverage_tests,
.needs = "tests_compile_coverage tests_pass"
};
-REGISTER_TEST(run_coverage_tests);
+REGISTER_TEST(tests_coverage);
doesnt_matter();
}
-struct ccanlint run_tests = {
+struct ccanlint tests_pass = {
.key = "tests_pass",
.name = "Module's run and api tests pass",
.check = do_run_tests,
.needs = "tests_compile"
};
-REGISTER_TEST(run_tests);
+REGISTER_TEST(tests_pass);
doesnt_matter();
}
-struct ccanlint run_tests_vg = {
+struct ccanlint tests_pass_valgrind = {
.key = "tests_pass_valgrind",
.name = "Module's run and api tests succeed under valgrind",
.can_run = can_run_vg,
.needs = "tests_pass"
};
-REGISTER_TEST(run_tests_vg);
+REGISTER_TEST(tests_pass_valgrind);
-struct ccanlint run_tests_vg_leak = {
+struct ccanlint tests_pass_valgrind_noleaks = {
.key = "tests_pass_valgrind_noleaks",
.name = "Module's run and api tests leak memory",
.check = do_leakcheck_vg,
.needs = "tests_pass_valgrind"
};
-REGISTER_TEST(run_tests_vg_leak);
+REGISTER_TEST(tests_pass_valgrind_noleaks);
}
}
-struct ccanlint trailing_whitespace = {
+struct ccanlint no_trailing_whitespace = {
.key = "no_trailing_whitespace",
.name = "Module's source code has no trailing whitespace",
.check = check_trailing_whitespace,
};
-REGISTER_TEST(trailing_whitespace);
+REGISTER_TEST(no_trailing_whitespace);