Age | Commit message (Collapse) | Author |
|
In the case that the objects built but linking failed, module_builds.c
called score_file_error with a NULL ccan_file object and 0 for line
number.
score_file_error assumed that the ccan_file object it is passed was
not-NULL when appending file errors to the score's aggregate error
string. It attempted to dereference it to get "fullname".
score_error was factored out from score_file_error. It takes a
"source" parameter, which is the file's full name (and possibly line
number) in the score_file_error case, and the ccan module name in the
case of link failure.
|
|
We can use tal_count.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Slowly removing the talloc dependency.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
ccanlint would abort with 'Malformed line 53' if there was a bad header.
That's very poor, and deeply unhelpful.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
We let the get_deps() caller hand us the compiled _info filename, but what
about recursive dependencies? These we re-generate every time.
So fix this: hand a generator callback to get_deps(), expose the one
which simply compiles it, and add a ccanlint one which looks up the
manifest to see if we have one already.
Before:
$ ccanlint -vvvv ccan/failtest | grep -c 'Creating.*_info'
31
After:
$ ccanlint -vvvv ccan/failtest | grep -c 'Creating.*_info'
17
|
|
Move ccan_dir determination out to its own function, rather than implying it
by the first time we get the manifest of a module.
|
|
Other tools will soon want to use this, so make it independent.
(eg. ccantool).
|
|
We change from htable_new()/htable_free() to htable_init/htable_clear.
We also change HTABLE_DEFINE_TYPE() to be the full name, without automatically
prepending htable_.
|
|
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.
|
|
We don't correctly detect pure-comment lines in ccan/ttxml/ttxml.c
without this.
|
|
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.
|
|
tools/ccanlint/file_analysis.c needs to include config.h to set _GNU_SOURCE
before any other header file includes stdlib.h.
|
|
Just grab the tokens for the simple case: this allows the ccanlint
reduce_features test to work on eg. ccan/cast.
|
|
Enable CCAN_STR_DEBUG in the default flags, so our tools get checked,
and fix up the resulting errors.
|
|
We don't use it for the moment, but Brad Hards noted that assigning to
dest ten continuing was pointless, revealing this bug.
|
|
David Gibson reports (and I confirmed) that running ccanlint in /tmp
causes an very uninformative segv. Fix that, and add a more useful message,
as well as delaying recursing until we're confident there's code around.
|
|
You can use talloc_array_length() to get the length of a tallocated array.
|
|
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.
|
|
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.
|
|
As we start doing more building of dependencies, this saves us effort.
|
|
Now it will build copies of other ccan deps if it can't find them.
|
|
This allows tests (like in tdb2) to run the simpler tests first and build up,
making it easier to spot the root cause of errors.
|
|
|
|
Previously each check returned a void *, but in fact most of them fell into
similar patterns. So define 'struct score' and a helper to add files to it,
and use that.
Under these rules, you get 0/1 if you skip a test because a dependency failed
which in theory means your score (as a percentage) could drop if you fix
a test.
|
|
Comments of form "// [given x] outputs y" we can check the examples do as expected.
|
|
We had example names like "example-opt.h-opt_parse", which got trimmed to
"example-opt". By using a basename of example-opt.h-opt_parse.c, we only
strip the final ".c" not the middle ".h".
|
|
This is a precursor to doing something useful with them.
|
|
|
|
|
|
|
|
This means we should skip building if there are no C files in module: running tests requires building the module, but not necessarily that it has any C files.
|
|
More sophisticated skipping: skip dependencies when one fails as well.
Allow tests to change their total_score; only access it after running (other than to check it's non-zero).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
compile.
|
|
|
|
|
|
Requires minor fixups. "depends" now prefixes ccan/ (allows for
non-ccan deps later).
|