Age | Commit message (Collapse) | Author |
|
Measuring ccanlint -d ccan/tdb2 on my dual core hyperthread laptop gives:
Before: 5:59
After: 5:30
|
|
Measuring ccanlint -d ccan/tdb2 on my dual core hyperthread laptop gives:
Before: 6:47
After: 5:59
|
|
Putting the reduced config.h in the current directory means that it's
actually being picked up by other tests, such as the string checks.
So move it to a sub-directory where we need an explicit -I.
We also fix the dependencies, so that "--target
tests_pass_without_features" works.
|
|
Tests can be slow to run, and this way we can monitor progress.
|
|
Rather than a separate cov_compiled member, we can add to the
compiled[] array, and we reduce duplication significantly.
|
|
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.
|
|
Unless it's not available or suppressed, we might as well run it under
valgrind the first time, which speeds things a little.
We save the valgrind output file for tests_pass_valgrind's use later.
|
|
|
|
Trivial cleanup, but differentiates from the general obj_list used
elsewhere.
|
|
Now we can mark test files as FAIL and not be bothered by them.
|
|
For example, valgrind can't handle some things, so we may need to
switch it off, but we don't want to do that for every test.
So, start a standard format for per-file restrictions, eg:
Ccanlint: tests_pass_valgrind test/foo.c:FAIL
For the moment, only tests_pass_valgrind takes options, so it has to
change: we now have a helper which returns the array of options
applicable to a given file.
|
|
We turned on --child-silent-after-fork=yes, because the output
confused our dumb parser. Now we split output by prefix ("==<pid>==")
and then we can sort out the leaks from the errors.
This means we find more errors.... next patch!
|
|
We can only test the featureless tests, once we've built them!
|
|
We don't check external dependencies, but internal ccan deps are
pretty easy.
|
|
Refactoring helps the next patch.
|
|
This checks to make sure you're not accidentally relicensing code;
eg. it's OK (though a bit impolite) to turn a BSD-licensed file into a
GPL module, but not the other way around.
|
|
After discussion with various developers (particularly the Samba
team), there's a consensus that a reference to the license in each
source file is useful. Since CCAN modules are designed to be cut and
paste, this helps avoid any confusion should the LICENSE file go
missing.
We also detect standard boilerplates, in which case a one-line summary
isn't necessary.
|
|
Now we've made GPL wording uniform, use it everywhere. There's no
point allowing variants which might be unclear.
We still have some non-conformant licenses in the tree (eg. just "BSD"),
so we only warn on unknown license strings for now.
|
|
This improves on the current ad-hoc methods, and also fixes a bug where
we mapped "GPLv2" to the GPLv3 symlink.
|
|
|
|
Don't check the whole source, but it's nice for headers to be C++-clean.
|
|
They expect to be linked against the module objects.
|
|
This means we change some minor tests to "never fail", eg. whitespace
or documentation tests. Note that pass/fail is independent of the
score for a test.
|
|
Be a little more careful with const.
|
|
Recent changes shifted line numbers in tap.c, so the break is now in
the wrong place. We should probably have an explicit function we can
breakpoint instead.
|
|
Enable CCAN_STR_DEBUG in the default flags, so our tools get checked,
and fix up the resulting errors.
|
|
If we detect any mention of a problematic string function, try compiling
the entire module with string debugging enabled.
|
|
We get a point for every run or api test, rather than 1 point for all of them,
so be consistent.
|
|
cast package has all negative tests, plus testable examples.
|
|
Especially since they probably define _GNU_SOURCE.
|
|
Old habits die hard; it's better to use #if <FEATURE> than #ifdef <FEATURE>;
they're similar, because undefined identifiers evaluate to zero, but with
GCC's -Wundef flag you can detect mis-spelled or missing features with
#if.
autoconf-style config.h leave unset features undefined, so this works for
those config.h too.
|
|
|
|
|
|
A common mistake is not to try compiling with features disabled in
config.h. The ideal case would determine how features interact and
test all combinations of them: this simply disables any features
mentioned in the code which were previously enabled.
|
|
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.
|
|
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
|
|
|
|
|
|
|
|
|
|
This can happen if the documentation doesn't have a properly formatted summary line,
and it causes the examples_relevant test to segfault.
|
|
This confuses the output, and makes us sometimes see spurious
failure. At least we will still catch valgrind errors in
children of failtest, thanks to --error-exitcode=101.
|
|
Two places were using a bogus ccanlint struct: the side-effect was
that valgrind options didn't work, nor did license fixups.
Make REGISTER_TEST do the extern declaration, and remove the bogus
ones.
|
|
You can use talloc_array_length() to get the length of a tallocated array.
|
|
It leads to numerous problems, such as the next ccanlint getting confused
trying to compile examples, and "-k examples_compile -k examples_exist"
giving bogus errors.
So instead we leave the temporary dir lying around and delete
individual files which aren't marked "keep".
|
|
Brad suggested this after finding one such cut & paste in str:
rusty@vivaldi:~/devel/cvs/ccan/ccan/str$ ../../tools/ccanlint/ccanlint
Example: sections demonstrate appropriate function (examples_relevant): FAIL
/home/rusty/devel/cvs/ccan/ccan/str/str.h:64:Example for strcount doesn't mention it
Total score: 37/38
|
|
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.
|
|
My refactoring introduced a bug: we need to set score=1 for the success case.
|
|
|
|
|