From: Rusty Russell Date: Fri, 7 Jan 2011 11:48:41 +0000 (+1030) Subject: ccanlint: rename test keys X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=f9423c171395571f9880286190d9cf63da147668 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 _ (eg "tests_exist" rather than "has-tests"). --- diff --git a/ccan/tdb/_info b/ccan/tdb/_info index f7cf273c..53ac6059 100644 --- a/ccan/tdb/_info +++ b/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[]) { diff --git a/ccan/tdb2/_info b/ccan/tdb2/_info index 53dd1ce2..49131d2e 100644 --- a/ccan/tdb2/_info +++ b/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[]) { diff --git a/tools/ccanlint/compulsory_tests/build.c b/tools/ccanlint/compulsory_tests/build.c index fee79b10..557b708b 100644 --- a/tools/ccanlint/compulsory_tests/build.c +++ b/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, diff --git a/tools/ccanlint/compulsory_tests/build_objs.c b/tools/ccanlint/compulsory_tests/build_objs.c index d2684494..9393f62f 100644 --- a/tools/ccanlint/compulsory_tests/build_objs.c +++ b/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, diff --git a/tools/ccanlint/compulsory_tests/check_build.c b/tools/ccanlint/compulsory_tests/check_build.c index b7935f01..39f16c2e 100644 --- a/tools/ccanlint/compulsory_tests/check_build.c +++ b/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, diff --git a/tools/ccanlint/compulsory_tests/check_depends_built.c b/tools/ccanlint/compulsory_tests/check_depends_built.c index b1ba40cb..41b9a8ca 100644 --- a/tools/ccanlint/compulsory_tests/check_depends_built.c +++ b/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, diff --git a/tools/ccanlint/compulsory_tests/check_depends_exist.c b/tools/ccanlint/compulsory_tests/check_depends_exist.c index 1423b40f..ffbf4539 100644 --- a/tools/ccanlint/compulsory_tests/check_depends_exist.c +++ b/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, }; diff --git a/tools/ccanlint/compulsory_tests/check_includes_build.c b/tools/ccanlint/compulsory_tests/check_includes_build.c index 4e2badda..017194e6 100644 --- a/tools/ccanlint/compulsory_tests/check_includes_build.c +++ b/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, diff --git a/tools/ccanlint/compulsory_tests/has_info.c b/tools/ccanlint/compulsory_tests/has_info.c index ce131f85..5b71efa4 100644 --- a/tools/ccanlint/compulsory_tests/has_info.c +++ b/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, diff --git a/tools/ccanlint/compulsory_tests/has_main_header.c b/tools/ccanlint/compulsory_tests/has_main_header.c index bce6ef48..338f7af7 100644 --- a/tools/ccanlint/compulsory_tests/has_main_header.c +++ b/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, }; diff --git a/tools/ccanlint/tests/build-coverage.c b/tools/ccanlint/tests/build-coverage.c index 31bb7882..927cd8b0 100644 --- a/tools/ccanlint/tests/build-coverage.c +++ b/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, }; diff --git a/tools/ccanlint/tests/compile_test_helpers.c b/tools/ccanlint/tests/compile_test_helpers.c index 5763463a..0169f602 100644 --- a/tools/ccanlint/tests/compile_test_helpers.c +++ b/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, diff --git a/tools/ccanlint/tests/compile_tests.c b/tools/ccanlint/tests/compile_tests.c index 80ebe913..e1e8f820 100644 --- a/tools/ccanlint/tests/compile_tests.c +++ b/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, diff --git a/tools/ccanlint/tests/depends_accurate.c b/tools/ccanlint/tests/depends_accurate.c index 943fa350..85301772 100644 --- a/tools/ccanlint/tests/depends_accurate.c +++ b/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, }; diff --git a/tools/ccanlint/tests/examples_compile.c b/tools/ccanlint/tests/examples_compile.c index 5b0195d6..ff9e529b 100644 --- a/tools/ccanlint/tests/examples_compile.c +++ b/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, diff --git a/tools/ccanlint/tests/examples_run.c b/tools/ccanlint/tests/examples_run.c index 103e1798..7fe41654 100644 --- a/tools/ccanlint/tests/examples_run.c +++ b/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, diff --git a/tools/ccanlint/tests/has_examples.c b/tools/ccanlint/tests/has_examples.c index 31afaecf..1e4f65c3 100644 --- a/tools/ccanlint/tests/has_examples.c +++ b/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, }; diff --git a/tools/ccanlint/tests/has_info_documentation.c b/tools/ccanlint/tests/has_info_documentation.c index 0a1788fd..a6aafc66 100644 --- a/tools/ccanlint/tests/has_info_documentation.c +++ b/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, }; diff --git a/tools/ccanlint/tests/has_tests.c b/tools/ccanlint/tests/has_tests.c index 0a510a03..36adee60 100644 --- a/tools/ccanlint/tests/has_tests.c +++ b/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, }; diff --git a/tools/ccanlint/tests/idempotent.c b/tools/ccanlint/tests/idempotent.c index e39cc2ac..944fd248 100644 --- a/tools/ccanlint/tests/idempotent.c +++ b/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, diff --git a/tools/ccanlint/tests/license.c b/tools/ccanlint/tests/license.c index 35a4d393..bc0ee454 100644 --- a/tools/ccanlint/tests/license.c +++ b/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, }; diff --git a/tools/ccanlint/tests/run-coverage.c b/tools/ccanlint/tests/run-coverage.c index 7f2b3c24..1e340398 100644 --- a/tools/ccanlint/tests/run-coverage.c +++ b/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, }; diff --git a/tools/ccanlint/tests/run_tests.c b/tools/ccanlint/tests/run_tests.c index f32e0534..3821b36a 100644 --- a/tools/ccanlint/tests/run_tests.c +++ b/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, diff --git a/tools/ccanlint/tests/run_tests_valgrind.c b/tools/ccanlint/tests/run_tests_valgrind.c index ec3a3198..6e18338d 100644 --- a/tools/ccanlint/tests/run_tests_valgrind.c +++ b/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, }; diff --git a/tools/ccanlint/tests/trailing_whitespace.c b/tools/ccanlint/tests/trailing_whitespace.c index ea8b5787..2a301ea8 100644 --- a/tools/ccanlint/tests/trailing_whitespace.c +++ b/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, };