Age | Commit message (Collapse) | Author |
|
|
|
Looks like the example was copy-n-pasted from the previous entry.
|
|
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
|
|
Before:
$ tools/ccanlint/ccanlint -d ccan/talloc/
Module's source code has no trailing whitespace (no_trailing_whitespace): FAIL
: Total score: 0/1
After:
$ tools/ccanlint/ccanlint -d ccan/talloc/
Module's source code has no trailing whitespace (no_trailing_whitespace): FAIL
talloc: Total score: 0/1
|
|
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.
|
|
|
|
With the original layout, we got:
Summary:
An efficient allocator for blocks that don't need to be
....
Description:
resized or freed.
|
|
|
|
Makes reporting of documentation easier.
|
|
|
|
It in fact takes an object and a key to compare, not two keys.
The test case had the key as first element of the object, so it worked,
but ccanlint lost track of module dependencies due to this bug, and thus
would build submodules multiple times.
|
|
|
|
It leads to a memory leak if the allocation fails (as we reparent onto NULL).
Also, the extra allocation in the failure path increases test time for
failtest (under valgrind) by a factor of 2.
|
|
Unfortunately this means we have to reduce run-many from 1000 nodes to 100
(as forking under valgrind is really slow: test takes about 2 minutes with
100 nodes).
|
|
The data is not made a child of the tree: the nodes are made children of the
data. So we must explicitly free the data objects.
|
|
This covers more code than simply doing an ordered delete/insert.
|
|
This allows us to both allocators which handle failure themselves, and
allocators which insert failures.
|
|
(Import from SAMBA commit 6f51a1f45bf4de062cce7a562477e8140630a53d):
this is the minimal fix for the problem Rusty found. I previously
thought that the best fix would be to change tc->parent to be valid
for all pointers, but that is expensive for realloc with large numbers
of child pointers, which is much more commmon than I expected it to
be.
|
|
|
|
A module designed to help test "never fails" functions like malloc.
|
|
This is useful for failtest, so we can abort on first failure.
|
|
|
|
Don't count examples which didn't compile (expected, as we mangle them in
various different ways).
|
|
|
|
Makes it simpler and clearer.
|
|
Good for testing ccanlint changes.
|
|
Useful wrapper for extended POSIX regular expressions.
|
|
Useful routine to count number of matches in a string.
|
|
|
|
A bit more awkward, but more consistent with everything else.
|
|
Since test keys are used for --target=, this is useful.
|
|
|
|
|
|
Joey Adams also pointed out that we should use strings for the dependency
lists. Moving them into the structure also somewhat simplifies it.
|
|
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").
|
|
|
|
This option prints the dependency graph of ccanlint's tests
in Graphviz .dot format.
Sample usage:
ccanlint --test-dep-graph | dot -Tpng > out.png && eog out.png
|
|
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.
|
|
&*ptr is used in some other macros, but at a glance, they look like
cases where the pointer shouldn't be NULL . Didn't change those,
and if we get more warnings, we'll cross that bridge when we get to it.
For now, I suppose they are just free NULL checks.
|
|
|
|
|
|
The parenthesized thing is confusing and ccanlint dislikes it.
|
|
There are a large number of BSD variants out there, be explicit.
|
|
header.
|
|
The upcoming failtest module can only tell that a child failed when it
exits with a non-zero error. So we need this, although it means for ccanlint
it still needs to look at output to distinguish a memory leak from a real
error.
|
|
If an example #includes <ccan/foo/...> we assume it needs module foo,
but we would fail instead of building it if it isn't built.
|
|
As we start doing more building of dependencies, this saves us effort.
|
|
|
|
I chose not to do the "macro creates set of routines" approach, as
we can be almost as safe with a struct containing a pointer to the member
type.
|