summaryrefslogtreecommitdiff
path: root/tools/ccanlint/tests
AgeCommit message (Collapse)Author
2015-09-10ccanlint: Add cflags support to _infoAndrew Jeffery
2015-06-18ccanlint: handle circular test-depends.Rusty Russell
eg. asort depends on order, but order testdepends on asort. Probably not the greatest thing to do, but don't barf because of it. Reported-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-05-28tal: rename tal_dup to tal_dup_arr, make tal_dup simpler.Rusty Russell
It's a bit too powerful, if you just want to memdup one thing, it's hard to remember what the extra args are for. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-04-10ccanlint: avoid segfault when module_builds' linking failsPeter Barker
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.
2015-03-30tools/ccanlint: slight neatening of license logic.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-03-30ccanlint - avoid e.g. GPL vs LGPL mismatch in license checkingPeter Barker
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-11-10ccanlint: offer to insert license comments where they're missing.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-11-10ccanlint: check all headers for examples.Rusty Russell
pushpull module doesn't have examples in pushpull.h. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-08-01tools/ccanlint: add global .valgrind_suppressions file.Rusty Russell
Seems like my local Ubuntu install is giving bogus warnings. Allow local valgrind overrides. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-06-16ccan: Correct some poor conventions in _info includesDavid Gibson
There are a couple of small problems with the includes used in most of ccan's _info files. * _info routinely uses printf(), and so should include <stdio.h>, but only some of them do. We get away with it, because they do include <string.h>, which apparently includes <stdio.h> indirectly, but we should be explicit about it. * Most _info files were including config.h after the system headers. That _seems_ sensible, but actually causes problems. Because config.h defines _GNU_SOURCE it can change the behaviour of the system headers. More specifically it can make them behave differently to how the individual module headers (which have included config.h) expects them to behave. This patch adjusts all the existing _info files and, more importantly, the template constructed by ccanlint. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-06-10tools: use tal/grab_fileRusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-05-27tools/ccanlint: detect more unmentioned dependencies.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-04-01ccanlint: --deps-fail-ignore.Rusty Russell
Useful for bulk testing modules, where some might not have required external (non-CCAN) dependencies. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-01-12ccanlint: handle when _info doesn't compile.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-01-03ccanlint: ignore "unused" non-ccan dependencies.Rusty Russell
We can't really tell if non-ccan dependencies are used, so don't try. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03tools: manifest.c should use path_canon.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03ccanlint: remove redundant num_lines in struct ccan_file.Rusty Russell
We can use tal_count. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03tools: use tal/path instead of opencoding most paths.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03tools: use tal/path instead of writing own path handlers.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03tools: use tal instead of talloc.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03tools: use rbuf instead of grab_file.Rusty Russell
Slowly removing the talloc dependency. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03ccanlint: handle nested modules when mentioned in examples.Rusty Russell
If we see an ccan include line in an example, we add that to the dependencies to try to build the example, but we didn't handle nested modules. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-11-22tools: don't assume modules are immediately below ccan/ dir.Rusty Russell
Removing this assumption should allow nested modules. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-11-22ccanlint: fix _info documentation addition.Rusty Russell
Firstly, we should always ask before altering files. Secondly, we are not in the module directory: we need to use m->info_file->fullname. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-11-12ccanlint: detect unused dependencies, too.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-11-12ccanlint: add testdepends support.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-11-12tools: enhance get_libs to get libraries for tests, too.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-11-12tools: add testdepends handling in _info.Rusty Russell
This allows us to separate dependencies only needed for testing. This matters: they don't have the same impact on licensing, nor necessarily on end-users. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-31ccanlint: add #line directives to examples.Rusty Russell
This means error messages come out in the right place. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-31ccanlint: Understand Creative Commons Zero license.Rusty Russell
Public domain for those who don't have it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-05ccanlint: fix coverage display for gcov 4.7Rusty Russell
David Gibson reports a new format, meaning we didn't show the gcov files with -vv.
2012-09-10ccanlint: don't remove HAVE_STRUCT_TIMESPEC when testing without features.Rusty Russell
If we do have it, and we redefine it, compilation breaks.
2012-09-10ccanlint: make sure examples get correct -l options.Rusty Russell
We intuit the dependencies of embedded examples by looking for #include. But these extra dependencies may require extra libraries, so we need to add those, too.
2012-09-10ccanlint: recurse to get -l options.Rusty Russell
If a dependent module needs -l options, we don't notice. Fix that, now we have one.
2012-09-10tools: more intelligent caching for compile _info.Rusty Russell
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
2012-07-18ccanlint: make depends_accurate test more accurate.Rusty Russell
In particular, don't complain on conditional lines. That's less thorough, but removes false negatives we have now.
2012-03-27ccanlint: module_links test must link with module.Rusty Russell
Gcc doesn't include unused inline functions, even without -O, but Solaris CC does, so fails to link block_pool where one inline function refers to a non-inline function.
2012-03-27ccanlint: tests_compile_coverage needs GCC.Rusty Russell
We only support gcc/gcov so far.
2011-12-05ccanlint: use ccan/autodataRusty Russell
Gets rid of generated file.
2011-12-02ccanlint: remove argument to -k/--keepRusty Russell
It's much easier to simply say "keep all", and it simplifies the code quite a bit.
2011-12-02ccanlint: remove wart from info options.Rusty Russell
Make info_exists() call add_info_options() directly, rather than detecting that we've found _info inside the loop of tests. It means targeting is now a global, which is a bit sucky.
2011-12-01ccanlint: get rid of separate class of compulsory tests.Rusty Russell
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.
2011-11-30ccanlint: fix depends_build_without_featuresRusty Russell
This depends on reduce_features; currently it tends to run before that, so it doesn't think there are any features to reduce and doesn't build or run the tests with reduced features.
2011-11-15ccanlint: make fewer tests compulsory.Rusty Russell
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
2011-11-02ccanlint: fix uninitialized variables in tests_pass_valgrind.Rusty Russell
We weren't initializing the leak_info field when the test was marked FAIL in _info (as in tdb2).
2011-10-25ccanlint: fix creation of example test/run.cRusty Russell
Hasn't worked for a while now. Oops.
2011-10-05ccanlint: drop -d, interpret any arguments as directories, and allow multiple.Rusty Russell
This gets us closer to 'ccanlint *' rather than relying on Makefiles to test all modules. Unfortunately, because of limited parallelism, it's currently slower than make -j.
2011-09-27htable: clean up interface, document htable_type better.Rusty Russell
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_.
2011-09-26ccanlint: more tweaks to example mangling.Rusty Russell
Note where previous analysis said the code was outside a function, and fix double new-line. Also, treat end of comment as end of statement.
2011-09-12ccanlint: run tests in parallelRusty Russell
Measuring ccanlint -d ccan/tdb2 on my dual core hyperthread laptop gives: Before: 5:30 After: 3:31