Browse Source

ccanlint: rename test keys

Joey Adams rightly points out that the current keys are a mess: ideally the
filenames, test keys and structure names in ccanlint should be the same.

First step is to make the test names all regular, of basic form <noun>_<verb>
(eg "tests_exist" rather than "has-tests").
Rusty Russell 15 years ago
parent
commit
f9423c1713

+ 1 - 1
ccan/tdb/_info

@@ -67,7 +67,7 @@
  *
  * Ccanlint:
  *	// valgrind breaks fcntl locks.
- *	valgrind-tests FAIL
+ *	tests_pass_valgrind FAIL
  */
 int main(int argc, char *argv[])
 {

+ 1 - 1
ccan/tdb2/_info

@@ -66,7 +66,7 @@
  *
  * Ccanlint:
  *	// hash fails because it accesses data in 4 byte quantities for speed.
- *	valgrind-tests --partial-loads-ok=yes
+ *	tests_pass_valgrind --partial-loads-ok=yes
  */
 int main(int argc, char *argv[])
 {

+ 1 - 1
tools/ccanlint/compulsory_tests/build.c

@@ -74,7 +74,7 @@ static void do_build(struct manifest *m,
 }
 
 struct ccanlint build = {
-	.key = "build",
+	.key = "module_builds",
 	.name = "Module can be built from object files",
 	.check = do_build,
 	.can_run = can_build,

+ 1 - 1
tools/ccanlint/compulsory_tests/build_objs.c

@@ -58,7 +58,7 @@ static void check_objs_build(struct manifest *m,
 }
 
 struct ccanlint build_objs = {
-	.key = "build-objects",
+	.key = "objects_build",
 	.name = "Module object files can be built",
 	.check = check_objs_build,
 	.can_run = can_build,

+ 1 - 1
tools/ccanlint/compulsory_tests/check_build.c

@@ -84,7 +84,7 @@ static void check_use_build(struct manifest *m,
 }
 
 struct ccanlint check_build = {
-	.key = "check-link",
+	.key = "module_links",
 	.name = "Module can be linked against trivial program",
 	.check = check_use_build,
 	.can_run = can_build,

+ 1 - 1
tools/ccanlint/compulsory_tests/check_depends_built.c

@@ -101,7 +101,7 @@ static void check_depends_built(struct manifest *m,
 }
 
 struct ccanlint depends_built = {
-	.key = "depends-built",
+	.key = "depends_build",
 	.name = "Module's CCAN dependencies can be found or built",
 	.check = check_depends_built,
 	.can_run = can_build,

+ 2 - 2
tools/ccanlint/compulsory_tests/check_depends_exist.c

@@ -69,8 +69,8 @@ static void check_depends_exist(struct manifest *m,
 }
 
 struct ccanlint depends_exist = {
-	.key = "depends-exist",
-	.name = "Module's CCAN dependencies are present",
+	.key = "depends_exist",
+	.name = "Module's CCAN dependencies can be found",
 	.check = check_depends_exist,
 };
 

+ 1 - 1
tools/ccanlint/compulsory_tests/check_includes_build.c

@@ -68,7 +68,7 @@ static void check_includes_build(struct manifest *m,
 }
 
 struct ccanlint includes_build = {
-	.key = "include-main",
+	.key = "main_header_compiles",
 	.name = "Modules main header compiles",
 	.check = check_includes_build,
 	.can_run = can_build,

+ 1 - 1
tools/ccanlint/compulsory_tests/has_info.c

@@ -75,7 +75,7 @@ static void create_info_template(struct manifest *m, struct score *score)
 }
 
 struct ccanlint has_info = {
-	.key = "info",
+	.key = "info_exists",
 	.name = "Module has _info file",
 	.check = check_has_info,
 	.handle = create_info_template,

+ 1 - 1
tools/ccanlint/compulsory_tests/has_main_header.c

@@ -34,7 +34,7 @@ static void check_has_main_header(struct manifest *m,
 }
 
 struct ccanlint has_main_header = {
-	.key = "has-main-header",
+	.key = "main_header_exists",
 	.name = "Module has main header file",
 	.check = check_has_main_header,
 };

+ 2 - 2
tools/ccanlint/tests/build-coverage.c

@@ -143,8 +143,8 @@ static void do_compile_coverage_tests(struct manifest *m,
 }
 
 struct ccanlint compile_coverage_tests = {
-	.key = "compile-coverage-tests",
-	.name = "Module tests compile with profiling",
+	.key = "tests_compile_coverage",
+	.name = "Module tests compile with " COVERAGE_CFLAGS,
 	.check = do_compile_coverage_tests,
 	.can_run = can_run_coverage,
 };

+ 1 - 1
tools/ccanlint/tests/compile_test_helpers.c

@@ -65,7 +65,7 @@ static void do_compile_test_helpers(struct manifest *m,
 }
 
 struct ccanlint compile_test_helpers = {
-	.key = "compile-helpers",
+	.key = "tests_helpers_compile",
 	.name = "Module test helper objects compile",
 	.check = do_compile_test_helpers,
 	.can_run = can_run,

+ 1 - 1
tools/ccanlint/tests/compile_tests.c

@@ -131,7 +131,7 @@ static void do_compile_tests(struct manifest *m,
 }
 
 struct ccanlint compile_tests = {
-	.key = "compile-tests",
+	.key = "tests_compile",
 	.name = "Module tests compile",
 	.check = do_compile_tests,
 	.can_run = can_build,

+ 2 - 2
tools/ccanlint/tests/depends_accurate.c

@@ -87,8 +87,8 @@ static void check_depends_accurate(struct manifest *m,
 }
 
 struct ccanlint depends_accurate = {
-	.key = "depends-accurate",
-	.name = "Module's CCAN dependencies are the only ccan files #included",
+	.key = "depends_accurate",
+	.name = "Module's CCAN dependencies are the only CCAN files #included",
 	.check = check_depends_accurate,
 };
 

+ 1 - 1
tools/ccanlint/tests/examples_compile.c

@@ -615,7 +615,7 @@ static void build_examples(struct manifest *m, bool keep,
 }
 
 struct ccanlint examples_compile = {
-	.key = "examples-compile",
+	.key = "examples_compile",
 	.name = "Module examples compile",
 	.check = build_examples,
 	.can_run = can_run,

+ 1 - 1
tools/ccanlint/tests/examples_run.c

@@ -272,7 +272,7 @@ static void run_examples(struct manifest *m, bool keep,
 }
 
 struct ccanlint examples_run = {
-	.key = "examples-run",
+	.key = "examples_run",
 	.name = "Module examples with expected output give that output",
 	.check = run_examples,
 	.can_run = can_run,

+ 2 - 2
tools/ccanlint/tests/has_examples.c

@@ -110,8 +110,8 @@ static void extract_examples(struct manifest *m,
 }
 
 struct ccanlint has_examples = {
-	.key = "has-examples",
-	.name = "_info and header files have examples",
+	.key = "examples_exist",
+	.name = "_info and main header file have Example: sections",
 	.check = extract_examples,
 };
 

+ 1 - 1
tools/ccanlint/tests/has_info_documentation.c

@@ -91,7 +91,7 @@ static void check_has_info_documentation(struct manifest *m,
 }
 
 struct ccanlint has_info_documentation = {
-	.key = "info-documentation",
+	.key = "info_documentation_exists",
 	.name = "Module has documentation in _info",
 	.check = check_has_info_documentation,
 };

+ 2 - 2
tools/ccanlint/tests/has_tests.c

@@ -125,8 +125,8 @@ static void check_has_tests(struct manifest *m,
 }
 
 struct ccanlint has_tests = {
-	.key = "has-tests",
-	.name = "Module has tests",
+	.key = "tests_exist",
+	.name = "Module has test directory with tests in it",
 	.check = check_has_tests,
 };
 

+ 1 - 1
tools/ccanlint/tests/idempotent.c

@@ -194,7 +194,7 @@ static void check_idempotent(struct manifest *m,
 }
 
 struct ccanlint idempotent = {
-	.key = "idempotent",
+	.key = "headers_idempotent",
 	.name = "Module headers are #ifndef/#define wrapped",
 	.check = check_idempotent,
 	.handle = handle_idem,

+ 2 - 2
tools/ccanlint/tests/license.c

@@ -148,8 +148,8 @@ static void check_has_license(struct manifest *m,
 }
 
 struct ccanlint has_license = {
-	.key = "has-license",
-	.name = "Module has license",
+	.key = "license_exists",
+	.name = "Module has License: entry in _info, and LICENSE symlink/file",
 	.check = check_has_license,
 };
 

+ 2 - 2
tools/ccanlint/tests/run-coverage.c

@@ -163,8 +163,8 @@ static void do_run_coverage_tests(struct manifest *m,
 }
 
 struct ccanlint run_coverage_tests = {
-	.key = "test-coverage",
-	.name = "Code coverage of module tests",
+	.key = "tests_coverage",
+	.name = "Module's tests cover all the code",
 	.check = do_run_coverage_tests,
 };
 

+ 1 - 1
tools/ccanlint/tests/run_tests.c

@@ -66,7 +66,7 @@ static void run_under_debugger(struct manifest *m, struct score *score)
 }
 
 struct ccanlint run_tests = {
-	.key = "run",
+	.key = "tests_pass",
 	.name = "Module's run and api tests pass",
 	.check = do_run_tests,
 	.handle = run_under_debugger,

+ 2 - 2
tools/ccanlint/tests/run_tests_valgrind.c

@@ -178,7 +178,7 @@ static void run_under_debugger_vg(struct manifest *m, struct score *score)
 }
 
 struct ccanlint run_tests_vg = {
-	.key = "valgrind-tests",
+	.key = "tests_pass_valgrind",
 	.name = "Module's run and api tests succeed under valgrind",
 	.can_run = can_run_vg,
 	.check = do_run_tests_vg,
@@ -189,7 +189,7 @@ struct ccanlint run_tests_vg = {
 REGISTER_TEST(run_tests_vg, &run_tests, NULL);
 
 struct ccanlint run_tests_vg_leak = {
-	.key = "valgrind-leaks",
+	.key = "tests_pass_valgrind_noleaks",
 	.name = "Module's run and api tests leak memory",
 	.check = do_leakcheck_vg,
 };

+ 1 - 1
tools/ccanlint/tests/trailing_whitespace.c

@@ -50,7 +50,7 @@ static void check_trailing_whitespace(struct manifest *m,
 }
 
 struct ccanlint trailing_whitespace = {
-	.key = "trailing-whitespace",
+	.key = "no_trailing_whitespace",
 	.name = "Module's source code has no trailing whitespace",
 	.check = check_trailing_whitespace,
 };