Commit 2926cafb authored by Rusty Russell's avatar Rusty Russell

ccanlint: rename structures to match keys

parent 016a19d2
......@@ -73,7 +73,7 @@ static void do_build(struct manifest *m,
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,
......@@ -81,4 +81,4 @@ struct ccanlint build = {
.needs = "objects_build"
};
REGISTER_TEST(build);
REGISTER_TEST(module_builds);
......@@ -57,7 +57,7 @@ static void check_objs_build(struct manifest *m,
}
}
struct ccanlint build_objs = {
struct ccanlint objects_build = {
.key = "objects_build",
.name = "Module object files can be built",
.check = check_objs_build,
......@@ -65,4 +65,4 @@ struct ccanlint build_objs = {
.needs = "depends_exist"
};
REGISTER_TEST(build_objs);
REGISTER_TEST(objects_build);
......@@ -83,7 +83,7 @@ static void check_use_build(struct manifest *m,
}
}
struct ccanlint check_build = {
struct ccanlint module_links = {
.key = "module_links",
.name = "Module can be linked against trivial program",
.check = check_use_build,
......@@ -91,4 +91,4 @@ struct ccanlint check_build = {
.needs = "module_builds depends_build"
};
REGISTER_TEST(check_build);
REGISTER_TEST(module_links);
......@@ -100,7 +100,7 @@ static void check_depends_built(struct manifest *m,
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,
......@@ -108,4 +108,4 @@ struct ccanlint depends_built = {
.needs = "depends_exist"
};
REGISTER_TEST(depends_built);
REGISTER_TEST(depends_build);
......@@ -67,7 +67,7 @@ static void check_includes_build(struct manifest *m,
}
}
struct ccanlint includes_build = {
struct ccanlint main_header_compiles = {
.key = "main_header_compiles",
.name = "Modules main header compiles",
.check = check_includes_build,
......@@ -75,4 +75,4 @@ struct ccanlint includes_build = {
.needs = "depends_exist main_header_exists"
};
REGISTER_TEST(includes_build);
REGISTER_TEST(main_header_compiles);
......@@ -74,7 +74,7 @@ static void create_info_template(struct manifest *m, struct score *score)
fclose(info);
}
struct ccanlint has_info = {
struct ccanlint info_exists = {
.key = "info_exists",
.name = "Module has _info file",
.check = check_has_info,
......@@ -82,4 +82,4 @@ struct ccanlint has_info = {
.needs = ""
};
REGISTER_TEST(has_info);
REGISTER_TEST(info_exists);
......@@ -33,11 +33,11 @@ static void check_has_main_header(struct manifest *m,
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);
......@@ -142,7 +142,7 @@ static void do_compile_coverage_tests(struct manifest *m,
}
}
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,
......@@ -150,4 +150,4 @@ struct ccanlint compile_coverage_tests = {
.needs = "tests_compile"
};
REGISTER_TEST(compile_coverage_tests);
REGISTER_TEST(tests_compile_coverage);
......@@ -64,7 +64,7 @@ static void do_compile_test_helpers(struct manifest *m,
}
}
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,
......@@ -72,4 +72,4 @@ struct ccanlint compile_test_helpers = {
.needs = "depends_build tests_exist"
};
REGISTER_TEST(compile_test_helpers);
REGISTER_TEST(tests_helpers_compile);
......@@ -130,7 +130,7 @@ static void do_compile_tests(struct manifest *m,
score->score = 1 + !warnings;
}
struct ccanlint compile_tests = {
struct ccanlint tests_compile = {
.key = "tests_compile",
.name = "Module tests compile",
.check = do_compile_tests,
......@@ -138,4 +138,4 @@ struct ccanlint compile_tests = {
.needs = "tests_helpers_compile objects_build"
};
REGISTER_TEST(compile_tests);
REGISTER_TEST(tests_compile);
......@@ -109,11 +109,11 @@ static void extract_examples(struct manifest *m,
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);
......@@ -15,7 +15,7 @@
#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)
{
......@@ -58,7 +58,7 @@ 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)
......@@ -83,7 +83,7 @@ static void check_has_info_documentation(struct manifest *m,
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"
......@@ -92,11 +92,11 @@ static void check_has_info_documentation(struct manifest *m,
}
}
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);
......@@ -10,7 +10,7 @@
#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)
{
......@@ -92,7 +92,7 @@ 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)
{
......@@ -103,7 +103,7 @@ static void check_has_tests(struct manifest *m,
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;
}
......@@ -117,7 +117,7 @@ static void check_has_tests(struct manifest *m,
&& 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;
......@@ -126,11 +126,11 @@ static void check_has_tests(struct manifest *m,
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);
......@@ -193,7 +193,7 @@ static void check_idempotent(struct manifest *m,
}
}
struct ccanlint idempotent = {
struct ccanlint headers_idempotent = {
.key = "headers_idempotent",
.name = "Module headers are #ifndef/#define wrapped",
.check = check_idempotent,
......@@ -201,4 +201,4 @@ struct ccanlint idempotent = {
.needs = ""
};
REGISTER_TEST(idempotent);
REGISTER_TEST(headers_idempotent);
......@@ -149,11 +149,11 @@ static void check_has_license(struct manifest *m,
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);
......@@ -162,11 +162,11 @@ static void do_run_coverage_tests(struct manifest *m,
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);
......@@ -65,7 +65,7 @@ static void run_under_debugger(struct manifest *m, struct score *score)
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,
......@@ -74,4 +74,4 @@ struct ccanlint run_tests = {
.needs = "tests_compile"
};
REGISTER_TEST(run_tests);
REGISTER_TEST(tests_pass);
......@@ -179,7 +179,7 @@ static void run_under_debugger_vg(struct manifest *m, struct score *score)
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,
......@@ -189,13 +189,13 @@ struct ccanlint run_tests_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);
......@@ -49,7 +49,7 @@ static void check_trailing_whitespace(struct manifest *m,
}
}
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,
......@@ -57,4 +57,4 @@ struct ccanlint trailing_whitespace = {
};
REGISTER_TEST(trailing_whitespace);
REGISTER_TEST(no_trailing_whitespace);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment