8 ccanlint - Make CCAN code modules, and the brightness up.
13 *ccanlint* ['OPTIONS'] ['DIRECTORY'...]
18 No encoder? No need to *ccanlint*. You programmer? Excited to *ccanlint*!
20 CCAN module is small code of the song. *ccanlint* full CCAN testing
21 tool. Each test spray bit of wisdom. Also score. Good score good.
24 *ccanlint* expect the source code in this directory, or command line can be
25 more than one. Exit 0 happy if all modules all tests happy.
30 Make *ccanlint* talkative. "-vv" doing very talkative. "-vvvv" make stupid talker.
33 Do not compile anything. Could it be safer for the bad code, but *ccanlint*
37 Tests show *ccanlint* can do. Then die happy.
40 Chart of all parties *ccanlint* tests 'dot(1)' Graphviz, then die happy.
43 *ccanlint* normally make mess temporary directory, but now it later in
47 *ccanlint* just realized there is no message unless you die horrible.
49 *-x, --exclude*='TESTNAME'::
50 No test run. Can the use of time many, many do *ccanlint* very, very quickly.
51 Often hatred 'tests_run_valgrind' that the test slowed.
53 *--timeout*='MILLISECONDS'::
54 Stop the test and forget it if you take too long. Generally, the same works as
55 '-x tests_run_valgrind'.
57 *-t, --target*='TESTNAME'::
58 Do not run all tests. Run this test, and the proof you need. Used many times
61 *--compiler*='COMPILER'::
62 *ccanlint* read config.h about finding 'CCAN_COMPILER'. Otherwise use the default
63 when it was built. The change, to use this compiler.
66 Set compiler options to compile. Be sure to protect spaces shell hunger.
71 *ccanlint* many tests. Each test will score soon. Not total score for
72 each test unless stupid module or no life. Worry if little or low
73 score score after hacking.
75 If test break, but not repair, or maybe the dumb test, put the magic
76 lines '_info' file like this. *ccanlint* to score from 0 of 1 for
78 ---------------------------------------------------------------------
80 * // Test module foolish for me great!
81 * info_documentation_exists FAIL
82 * // Error for the file may be only
83 * tests_pass_valgrind_noleaks test/run-mytest.c:FAIL
84 ---------------------------------------------------------------------
87 CCAN module must have '_info' file describing. No this score is 0.
88 However, *ccanlint* question may help to write one.
91 '_info' file CCAN other module without saying, must find. It is not score 0.
94 All build purposes '.c' in the top dir. Not score 0.
97 Link to all objects in an object module. Not score 0.
100 Include other CCAN modules, we must say we need to '_info' depends.
101 Only one thing allows different, you can use 'ccan/tap' for testing anyway.
104 We try to generate the CCAN module you need.
107 Rather hope that the comments in the header, and '_info'. An
108 example of the section in each, please! Maybe more, *ccanlint* very
111 *examples_relevant*::
112 Example, do not cut and paste away! You say the name of the thing in
113 the example or *ccanlint* unhappy.
116 Module wants *ccanlint* 'config.h' "#define HAVE_FEATURE" for all
117 feature. Function test "#if HAVE_FEATURE" no "#ifdef HAVE_FEATURE"
118 because user might not know about the role at all. Intelligent GCC
119 flag '-Wundef' say HAVE_FEATURE not 0, not 1! but only if the
122 *info_documentation_exists*::
123 '_info' file format is pretty comments. Copying someone. It is not difficult
126 *info_summary_single_line*::
127 Comments from a top line often describe the function or macro. '_info' comment
128 top line describes complete module. Characteristics make you scream!
131 The lawyers eat me. '_info' have 'License:' in the observation and LICENSE
132 file there. In general, is the link: *ccanlint* offer create a link, if they
136 Attorney everywhere. Please put a comment saying something like "GPL
137 Version 4. Read LICENSE." in all source files in the directory.
139 *license_file_compat*::
140 Do not lie about the license! *ccanlint* search files, see the license
141 of another, angry here.
143 *license_depends_compat*::
144 Hostile to BSD license module, but requires another module of the GPL.
145 Perhaps poor encoder think all BSD code, unloading and damage
146 attorney stick! Ay ay!
148 *main_header_exists*::
149 *ccanlint* know the module name directory name. Expect the same name for
152 *headers_idempotent*::
153 Good header '#include' many time happy. Rap header around easy.
154 *ccanlint* say it can fix too. Always work.
156 *main_header_compiles*::
157 Simple program '#include' main header compile.
159 *avoids_cpp_reserved*::
160 C\++ programmer to include code. Not like them anyway, maybe, but wrong
161 end your program, do mourn. Only main header compile C\++ and if
162 trying to compile C\++ module stupid to pieces.
164 *no_trailing_whitespace*::
165 Linux kernel programmers more, solve the problem for the space of
166 the final ban the line. Now all lots of hackers working to fix
167 it. Want to famous and Linux? Leave extra space too!
170 *ccanlint* very smart! Take 'Example:' from a comment in the header and
171 '_info'. First try to compile anything. If not, add many
172 headers and maybe put inside the function. It does not work, adds
173 the latest example. If the last example has '...' try that maybe. Sometimes
174 too complicated! '-vv' or '--keep' to see why it broke. Or maybe
175 bad example *ccanlint* says wow!
178 If the example program that comments like '// given foo outputs bar'
179 *ccanlint* will run the food program 'foo' in the command line and
180 standard input. Happy if 'bar' are out. You can do ' or " about
181 the production or determined. You can also 'output contains' more
185 CCAN link to the program module simply no error.
187 *objects_build_with_stringchecks*::
188 Module 'ccan/str' is super difficult to detect errors debugging chain.
189 *ccanlint* use with the module and see break!
192 You have CCAN module directory called 'test'. You have proof
193 here. If there is no proof, *ccanlint* still offer make proof for
197 In 'test' which has four such tests, start with different
198 name. 'run' compile the test files, but no link to the module, you
199 '#include' to get the bits of the module. 'api' test compile and
200 link with the module. 'compile-ok' as 'run' but only build.
201 'compile-fail' compile, but when 'FAIL' set has to break or
202 alert. This good for module supposed to warn.
204 *test_helpers_compile*::
205 Other files 'test'? Compilation of links to all tests. Ask for help.
208 'run' and 'api' test happy departure. If not happy, offer debugger.
210 *tests_pass_valgrind*::
211 *valgrind* the tool of all 'run' and 'api' slow test. However, we
212 found many errors! If *valgrind* test rest, '_info' have *ccanlint* section,
213 make "tests_pass_valgrind test/TESTNAME:FAIL". If required
214 valgrind additional option, "tests_pass_valgrind test/TESTNAME:--option".
216 *tests_pass_valgrind_noleaks*::
217 *valgrind* complain if the memory leak test. '_info' can also be disabled.
219 *tests_compile_coverage*::
220 Compile 'run', 'api' test coverage. Fun if not here!
223 Run tests again, find lines that never try! Half of the lines 1
224 point 3/4 getting 2 points. Limit of 5 points, but the extra point
225 for all lines of evidence. Not win unless the module silly or use
226 gimmick 'ccan/failtest'.
229 Code use 'HAVE_FEATURE' make special config.h turned off. Not
230 stupid like HAVE_BIG_ENDIAN though!
232 *depends_build_without_features*::
233 Make modules CCAN need. config.h but not more features.
235 *objects_build_without_features*::
236 Make the module again, but not more features.
238 *tests_helpers_compile_without_features*::
239 Helpers do try again, but not more features.
241 *tests_compile_without_features*::
242 Collect the tests again, but not more features.
244 *tests_pass_without_features*:
245 Run tests again, but not more features.
249 *ccanlint* rapid change. The bad man, bad page.
253 Rusty Russell wrote *ccanlint*. Helping others, but most break Rusty.
258 Main web site: http://ccodearchive.net/
260 Wiki: https://github.com/rustyrussell/ccan/wiki/
264 This program is free software; you can redistribute it and/or modify it
265 under the terms of the GNU General Public License as published by the Free
266 Software Foundation; either version 2 of the License, or (at your option)