]> git.ozlabs.org Git - ccan/commitdiff
ccanlint: rename structures to match keys
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 7 Jan 2011 11:50:04 +0000 (22:20 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 7 Jan 2011 11:50:04 +0000 (22:20 +1030)
19 files changed:
tools/ccanlint/compulsory_tests/build.c
tools/ccanlint/compulsory_tests/build_objs.c
tools/ccanlint/compulsory_tests/check_build.c
tools/ccanlint/compulsory_tests/check_depends_built.c
tools/ccanlint/compulsory_tests/check_includes_build.c
tools/ccanlint/compulsory_tests/has_info.c
tools/ccanlint/compulsory_tests/has_main_header.c
tools/ccanlint/tests/build-coverage.c
tools/ccanlint/tests/compile_test_helpers.c
tools/ccanlint/tests/compile_tests.c
tools/ccanlint/tests/has_examples.c
tools/ccanlint/tests/has_info_documentation.c
tools/ccanlint/tests/has_tests.c
tools/ccanlint/tests/idempotent.c
tools/ccanlint/tests/license.c
tools/ccanlint/tests/run-coverage.c
tools/ccanlint/tests/run_tests.c
tools/ccanlint/tests/run_tests_valgrind.c
tools/ccanlint/tests/trailing_whitespace.c

index cf128f6a7c3587e6dbaf1103efa3f00cb49b2285..9d697a303a57399a1754da32db7dfc0c20d1ffa0 100644 (file)
@@ -73,7 +73,7 @@ static void do_build(struct manifest *m,
        score->score = score->total;
 }
 
        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,
        .key = "module_builds",
        .name = "Module can be built from object files",
        .check = do_build,
@@ -81,4 +81,4 @@ struct ccanlint build = {
        .needs = "objects_build"
 };
 
        .needs = "objects_build"
 };
 
-REGISTER_TEST(build);
+REGISTER_TEST(module_builds);
index 7696b4641edf6fc649806a5af1e12c66b09d6d72..13d34a14e041fb90b2fcbba7df020c06805aec31 100644 (file)
@@ -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,
        .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"
 };
 
        .needs = "depends_exist"
 };
 
-REGISTER_TEST(build_objs);
+REGISTER_TEST(objects_build);
index db2e16d54a4f8cd89fdec478094ff0a279d3f592..83b1c780e067046cc715fc479f7e79c64e22cdda 100644 (file)
@@ -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,
        .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"
 };
 
        .needs = "module_builds depends_build"
 };
 
-REGISTER_TEST(check_build);
+REGISTER_TEST(module_links);
index c4c649dd9e2fe44d168c656fe54349dc360c7922..bb1f6ca358a821d8f14b9172f8bd737cdc107c5f 100644 (file)
@@ -100,7 +100,7 @@ static void check_depends_built(struct manifest *m,
        score->score = score->total;
 }
 
        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,
        .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"
 };
 
        .needs = "depends_exist"
 };
 
-REGISTER_TEST(depends_built);
+REGISTER_TEST(depends_build);
index 56930e3051b7f3a8c865d925611da6e18d497470..296b0a3961c10b93d2109ada855d21d2a570fddf 100644 (file)
@@ -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,
        .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"
 };
 
        .needs = "depends_exist main_header_exists"
 };
 
-REGISTER_TEST(includes_build);
+REGISTER_TEST(main_header_compiles);
index b61ee0aefb79670bfa913f68a5311d18e5e65b05..a9a6c1c993a77c532515fe5c92eef282cccafba9 100644 (file)
@@ -74,7 +74,7 @@ static void create_info_template(struct manifest *m, struct score *score)
        fclose(info);
 }
 
        fclose(info);
 }
 
-struct ccanlint has_info = {
+struct ccanlint info_exists = {
        .key = "info_exists",
        .name = "Module has _info file",
        .check = check_has_info,
        .key = "info_exists",
        .name = "Module has _info file",
        .check = check_has_info,
@@ -82,4 +82,4 @@ struct ccanlint has_info = {
        .needs = ""
 };
 
        .needs = ""
 };
 
-REGISTER_TEST(has_info);
+REGISTER_TEST(info_exists);
index 259aa347ccaff19122e243231697354c694c3a0f..68ea1359581d59dc0fd11e8db3202dc9dfe0d652 100644 (file)
@@ -33,11 +33,11 @@ static void check_has_main_header(struct manifest *m,
                                       m->basename, m->basename);
 }
 
                                       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 = ""
 };
 
        .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);
index 55eca373dc0ca44d63bd87c8cb3506c7d16fe29e..115ae94a15e50a7f4050f2b307e5bdb18295b944 100644 (file)
@@ -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,
        .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"
 };
 
        .needs = "tests_compile"
 };
 
-REGISTER_TEST(compile_coverage_tests);
+REGISTER_TEST(tests_compile_coverage);
index aa62e37a5fbb0aef71204648506c5eaec6182af2..0ad5a7e67cc7847fb9bbc9c568ef403b7752eb7d 100644 (file)
@@ -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,
        .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"
 };
 
        .needs = "depends_build tests_exist"
 };
 
-REGISTER_TEST(compile_test_helpers);
+REGISTER_TEST(tests_helpers_compile);
index c61a9e5a8aeee5a702ad171c7e81c81aa2e25952..4d8686798c0aa12040defb489cd28ebc4d7acd1b 100644 (file)
@@ -130,7 +130,7 @@ static void do_compile_tests(struct manifest *m,
        score->score = 1 + !warnings;
 }
 
        score->score = 1 + !warnings;
 }
 
-struct ccanlint compile_tests = {
+struct ccanlint tests_compile = {
        .key = "tests_compile",
        .name = "Module tests compile",
        .check = do_compile_tests,
        .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"
 };
 
        .needs = "tests_helpers_compile objects_build"
 };
 
-REGISTER_TEST(compile_tests);
+REGISTER_TEST(tests_compile);
index a1d54c480ffecdfcd80150df1bfff838ba39eb28..947d76a4a768751053e6830b4bb788cb2c56df77 100644 (file)
@@ -109,11 +109,11 @@ static void extract_examples(struct manifest *m,
        score->pass = score->score != 0;
 }
 
        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"
 };
 
        .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);
index b98177d8a783087fc8436a124b09744e45ff6276..a5316fe00d0ae3dba4a2a2287a51ce1dfeb17faa 100644 (file)
@@ -15,7 +15,7 @@
 #include <ccan/noerr/noerr.h>
 #include <ccan/grab_file/grab_file.h>
 
 #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 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)
                                         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";
                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"
        } 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",
        .key = "info_documentation_exists",
        .name = "Module has documentation in _info",
-       .check = check_has_info_documentation,
+       .check = check_info_documentation_exists,
        .needs = "info_exists"
 };
 
        .needs = "info_exists"
 };
 
-REGISTER_TEST(has_info_documentation);
+REGISTER_TEST(info_documentation_exists);
index 0e90d16ff737a717765727f27c7a8ddb68c6170e..bdfe49d56b8725389b279671052fd8356f499a06 100644 (file)
@@ -10,7 +10,7 @@
 #include <err.h>
 #include <ccan/talloc/talloc.h>
 
 #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)
 {
 
 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);
 }
 
        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)
 {
                            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);
                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;
        }
 
                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";
            && 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;
                } 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;
 }
 
        score->score = score->total;
 }
 
-struct ccanlint has_tests = {
+struct ccanlint tests_exist = {
        .key = "tests_exist",
        .name = "Module has test directory with tests in it",
        .key = "tests_exist",
        .name = "Module has test directory with tests in it",
-       .check = check_has_tests,
+       .check = check_tests_exist,
        .needs = ""
 };
 
        .needs = ""
 };
 
-REGISTER_TEST(has_tests);
+REGISTER_TEST(tests_exist);
index a5210e2fecf3235426474527a7127fe968bd3c92..340a0698ac6aecbcb8baf85d231ce4e4d8d978fc 100644 (file)
@@ -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,
        .key = "headers_idempotent",
        .name = "Module headers are #ifndef/#define wrapped",
        .check = check_idempotent,
@@ -201,4 +201,4 @@ struct ccanlint idempotent = {
        .needs = ""
 };
 
        .needs = ""
 };
 
-REGISTER_TEST(idempotent);
+REGISTER_TEST(headers_idempotent);
index 1ffee9e25d6719b269e675db8a8eaf856f3d3dab..965a159ff8fff53f15bea96d4675c052eedbd9f0 100644 (file)
@@ -149,11 +149,11 @@ static void check_has_license(struct manifest *m,
        score->score = score->total;
 }
 
        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"
 };
 
        .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);
index a3e83c1ca939fbc8454cadf9092dec32659c7e35..af8d6f21c845948fbbae3cd1413cbfc6ac8e2938 100644 (file)
@@ -162,11 +162,11 @@ static void do_run_coverage_tests(struct manifest *m,
        analyze_coverage(m, full_gcov, cmdout, score);
 }
 
        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"
 };
 
        .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);
index 35790ece120a926f2f92c814d97e267921b29c86..0edfad262c4ba02299052231691b23ce40784ff7 100644 (file)
@@ -65,7 +65,7 @@ static void run_under_debugger(struct manifest *m, struct score *score)
                doesnt_matter();
 }
 
                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,
        .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"
 };
 
        .needs = "tests_compile"
 };
 
-REGISTER_TEST(run_tests);
+REGISTER_TEST(tests_pass);
index d3cdb9c78c5929be4fa53300bdcc71eaaa2457a9..30a806eb934bd5cf9799a8b74ab5e88c348d1187 100644 (file)
@@ -179,7 +179,7 @@ static void run_under_debugger_vg(struct manifest *m, struct score *score)
                doesnt_matter();
 }
 
                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,
        .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"
 };
 
        .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"
 };
 
        .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);
index 2b430e8c308f2b1fa5aba609f7c731bbd505abd2..a66fd74c3c57a8fdd7f42f352975bbe681366665 100644 (file)
@@ -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,
        .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);