summaryrefslogtreecommitdiff
path: root/tools/ccanlint/tests
AgeCommit message (Collapse)Author
2011-09-12ccanlint: compile tests with coverage in parallelRusty Russell
Measuring ccanlint -d ccan/tdb2 on my dual core hyperthread laptop gives: Before: 5:59 After: 5:30
2011-09-12ccanlint: compile tests in parallelRusty Russell
Measuring ccanlint -d ccan/tdb2 on my dual core hyperthread laptop gives: Before: 6:47 After: 5:59
2011-08-30ccanlint: clean up reduced feature handling.Rusty Russell
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.
2011-08-30ccanlint: show each test as we execute it with -vvRusty Russell
Tests can be slow to run, and this way we can monitor progress.
2011-08-30ccanlint: add coverage variant of files.Rusty Russell
Rather than a separate cov_compiled member, we can add to the compiled[] array, and we reduce duplication significantly.
2011-08-30ccanlint: keep separate array of compiled versions.Rusty Russell
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.
2011-08-30ccanlint: run tests under valgrind initially.Rusty Russell
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.
2011-08-30ccanlint: fix warning about bogus return value.Rusty Russell
2011-08-30ccanlint: rename obj_list in examples_compile.c to example_obj_list.Rusty Russell
Trivial cleanup, but differentiates from the general obj_list used elsewhere.
2011-08-24ccanlint: tests_pass_valgrind_noleaks: handle FAIL option on tests.Rusty Russell
Now we can mark test files as FAIL and not be bothered by them.
2011-08-24ccanlint: allow per-file restrictions, so we don't have to remove all tests.Rusty Russell
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.
2011-08-24ccanlint: make valgrind understand child output.Rusty Russell
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!
2011-08-22ccanlint: fix dependencies on tests_pass_without_features.Rusty Russell
We can only test the featureless tests, once we've built them!
2011-07-21ccanlint: license_depends_compat checks dependencies are compatible.Rusty Russell
We don't check external dependencies, but internal ccan deps are pretty easy.
2011-07-21ccanlint: move license tag matching into common code.Rusty Russell
Refactoring helps the next patch.
2011-07-21ccanlint: check for incompatible license boilerplates within subfiles.Rusty Russell
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.
2011-07-21ccanlint: add simple check for comment referring to LICENSE file.Rusty Russell
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.
2011-07-21ccanlint: tighten license check.Rusty Russell
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.
2011-07-19ccanlint: make a license enum, and parse the license string to set it.Rusty Russell
This improves on the current ad-hoc methods, and also fixes a bug where we mapped "GPLv2" to the GPLv3 symlink.
2011-04-27ccanlint: Add more C++ keywords.Andreas Schlick
2011-04-19ccanlint: test for C++ reserved words in headers.Rusty Russell
Don't check the whole source, but it's nice for headers to be C++-clean.
2011-03-22ccanlint: fix compilation of API tests with coverageRusty Russell
They expect to be linked against the module objects.
2011-03-22ccanlint: exit with non-zero exit status if a test fails.Rusty Russell
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.
2011-03-22tools: fix up warnings with -Wwrite-strings.Rusty Russell
Be a little more careful with const.
2011-03-17ccanlint: fix gdb line in tests_pass helper.Rusty Russell
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.
2011-03-17tools: fix ctype.h and string usage.Rusty Russell
Enable CCAN_STR_DEBUG in the default flags, so our tools get checked, and fix up the resulting errors.
2011-03-17ccanlint: objects_build_with_stringchecksRusty Russell
If we detect any mention of a problematic string function, try compiling the entire module with string debugging enabled.
2011-03-02ccanlint: give a point per compile_ok/compile_fail testRusty Russell
We get a point for every run or api test, rather than 1 point for all of them, so be consistent.
2011-03-02ccanlint: don't fail just because we don't have positive tests.Rusty Russell
cast package has all negative tests, plus testable examples.
2011-03-01ccanlint: prepend module headers before standard ones.Rusty Russell
Especially since they probably define _GNU_SOURCE.
2011-03-01ccanlint: check for #ifdefRusty Russell
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.
2011-03-01ccanlint: run tests with reduced-feature config.hRusty Russell
2011-03-01ccanlint: compile module with reduced-feature config.hRusty Russell
2011-03-01ccanlint: create reduce-feature config.hRusty Russell
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.
2011-03-01ccanlint: read config.h to get compilation flags at runtime.Rusty Russell
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.
2011-02-24ccanlint: fix more potential segvs when reporting ccanlint errors.Rusty Russell
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
2011-02-18ccanlint: print coverage amount when -vvRusty Russell
2011-02-18ccanlint: fix format error when test output contains %Rusty Russell
2011-02-22ccanlint: recognise new BSD 3-clause license.Rusty Russell
2011-01-28ccanlint: fix SEGV when example has format string.Rusty Russell
2011-01-22ccanlint: protect against the function element in the doc section being nullBrad Hards
This can happen if the documentation doesn't have a properly formatted summary line, and it causes the examples_relevant test to segfault.
2011-01-20ccanlint: don't collect results from test childrenRusty Russell
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.
2011-01-18ccanlint: fix _info option handlingRusty Russell
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.
2011-01-18strsplit: remove nump argumentRusty Russell
You can use talloc_array_length() to get the length of a tallocated array.
2011-01-09ccanlint: -k should not pollute module directory.Rusty Russell
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".
2011-01-17ccanlint: check examples actually mention thing they are demonstrating.Rusty Russell
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
2011-01-17ccanlint: score_file_error() takes printf-formatRusty Russell
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.
2011-01-17ccanlint: fix score for info_summary_single_lineRusty Russell
My refactoring introduced a bug: we need to set score=1 for the success case.
2011-01-17ccanlint: neaten info_summary_single_line with new doc_section info.Rusty Russell
2011-01-17ccanlint: add test case for metadata summary line on a single separate line.Brad Hards