ccanlint: get rid of separate class of compulsory tests. It's reduced to a flag which means we stop processing the module. We have to enhance our dependencies a bit, but they've always been quite good. This simplifies things quite a bit.
ccanlint: make fewer tests compulsory. Compulsory means "malformed", we might get rid of it altogether, since any test can mark "fail" and make ccanlint exit with non-zero status. Now we only have four compulsory tests: info_exists Module has _info file depends_exist Module's CCAN dependencies can be found objects_build Module object files can be built module_builds Module can be built from object files
ccanlint: keep separate array of compiled versions. Rather than mug the old ->compiled version when we reduce features, keep both in the structure. This makes it clear that we are using the right version (we weren't in all cases, in particular we weren't recompiling the test helpers correctly.
ccanlint: don't ever used pre-built modules as dependencies. They're often out-of-date, and we're about to do special things to the str module compile flags, so we don't *ever* want the default. It doesn't add much to build times, and it eliminates a nasty source of weird errors.
ccanlint: read config.h to get compilation flags at runtime. This means you don't have to recompile ccanlint to get the new flags; it's a small step towards making ccanlint useful outside the ccan repo.
ccanlint: fix more potential segvs when reporting ccanlint errors. When I changed score_file_error() to printf-style, I didn't audit all the callers who were handing string literals. I've finally done that; I should have broken the compile by renaming it. Rusty fails refactoring 101. Reported-by: Andreas Schlick
ccanlint: score_file_error() takes printf-format We simply build up the error string in score_file_error; a bit different but simpler than current behaviour. We keep around struct file_error because some tests need it.
ccanlint: rename files to match keys
ccanlint: rename structures to match keys
ccanlint: list dependencies by key Joey Adams also pointed out that we should use strings for the dependency lists. Moving them into the structure also somewhat simplifies it.
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").
ccanlint: fix segfault caused by tests not depending on the "info" test. These tests: "depends-exist" (compulsory_tests/check_depends_exist.c) "info-documentation" (tests/has_info_documentation.c) used m->info_file without checking if it was NULL, leading to a segfault when no _info file was present. Some other tests also used m->info_file without depending on "info", but are taken care of indirectly by this patch.
ccanlint: build depends if necessary Now it will build copies of other ccan deps if it can't find them.