3 .\" Author: [see the "AUTHOR" section]
4 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
10 .TH "CCANLINT" "1" "09/28/2015" "\ \&" "\ \&"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 ccanlint \- Make CCAN code modules, and the brightness up\&.
34 \fBccanlint\fR [\fIOPTIONS\fR] [\fIDIRECTORY\fR\&...]
37 No encoder? No need to \fBccanlint\fR\&. You programmer? Excited to \fBccanlint\fR!
39 CCAN module is small code of the song\&. \fBccanlint\fR full CCAN testing tool\&. Each test spray bit of wisdom\&. Also score\&. Good score good\&. Bad score bad\&.
41 \fBccanlint\fR expect the source code in this directory, or command line can be more than one\&. Exit 0 happy if all modules all tests happy\&.
44 \fB\-v, \-\-verbose\fR
48 talkative\&. "\-vv" doing very talkative\&. "\-vvvv" make stupid talker\&.
51 \fB\-n, \-\-safe\-mode\fR
53 Do not compile anything\&. Could it be safer for the bad code, but
58 \fB\-l, \-\-list\-tests\fR
62 can do\&. Then die happy\&.
65 \fB\-\-test\-dep\-graph\fR
71 Graphviz, then die happy\&.
77 normally make mess temporary directory, but now it later in forensic\&.
80 \fB\-s, \-\-summary\fR
83 just realized there is no message unless you die horrible\&.
86 \fB\-x, \-\-exclude\fR=\fITESTNAME\fR
88 No test run\&. Can the use of time many, many do
90 very, very quickly\&. Often hatred
91 \fItests_run_valgrind\fR
92 that the test slowed\&.
95 \fB\-\-timeout\fR=\fIMILLISECONDS\fR
97 Stop the test and forget it if you take too long\&. Generally, the same works as
98 \fI\-x tests_run_valgrind\fR\&.
101 \fB\-t, \-\-target\fR=\fITESTNAME\fR
103 Do not run all tests\&. Run this test, and the proof you need\&. Used many times for many tests\&.
106 \fB\-\-compiler\fR=\fICOMPILER\fR
109 read config\&.h about finding
110 \fICCAN_COMPILER\fR\&. Otherwise use the default when it was built\&. The change, to use this compiler\&.
113 \fB\-\-cflags\fR=\fICFLAGS\fR
115 Set compiler options to compile\&. Be sure to protect spaces shell hunger\&.
119 \fBccanlint\fR many tests\&. Each test will score soon\&. Not total score for each test unless stupid module or no life\&. Worry if little or low score score after hacking\&.
121 If test break, but not repair, or maybe the dumb test, put the magic lines \fI_info\fR file like this\&. \fBccanlint\fR to score from 0 of 1 for test, but happy:
128 * // Test module foolish for me great!
129 * info_documentation_exists FAIL
130 * // Error for the file may be only
131 * tests_pass_valgrind_noleaks test/run\-mytest\&.c:FAIL
139 CCAN module must have
141 file describing\&. No this score is 0\&. However,
143 question may help to write one\&.
149 file CCAN other module without saying, must find\&. It is not score 0\&.
156 in the top dir\&. Not score 0\&.
161 Link to all objects in an object module\&. Not score 0\&.
164 \fBdepends_accurate\fR
166 Include other CCAN modules, we must say we need to
168 depends\&. Only one thing allows different, you can use
170 for testing anyway\&.
175 We try to generate the CCAN module you need\&.
180 Rather hope that the comments in the header, and
181 \fI_info\fR\&. An example of the section in each, please! Maybe more,
183 very happy morning\&.
186 \fBexamples_relevant\fR
188 Example, do not cut and paste away! You say the name of the thing in the example or
196 \fBccanlint\fR\fIconfig\&.h\fR
197 "#define HAVE_FEATURE" for all feature\&. Function test "#if HAVE_FEATURE" no "#ifdef HAVE_FEATURE" because user might not know about the role at all\&. Intelligent GCC flag
199 say HAVE_FEATURE not 0, not 1! but only if the use of
203 \fBinfo_documentation_exists\fR
206 file format is pretty comments\&. Copying someone\&. It is not difficult write documentation!
209 \fBinfo_summary_single_line\fR
211 Comments from a top line often describe the function or macro\&.
213 comment top line describes complete module\&. Characteristics make you scream!
218 The lawyers eat me\&.
222 in the observation and LICENSE file there\&. In general, is the link:
224 offer create a link, if they know
228 \fBlicense_comment\fR
230 Attorney everywhere\&. Please put a comment saying something like "GPL Version 4\&. Read LICENSE\&." in all source files in the directory\&.
233 \fBlicense_file_compat\fR
235 Do not lie about the license!
237 search files, see the license of another, angry here\&.
240 \fBlicense_depends_compat\fR
242 Hostile to BSD license module, but requires another module of the GPL\&. Perhaps poor encoder think all BSD code, unloading and damage attorney stick! Ay ay!
245 \fBmain_header_exists\fR
248 know the module name directory name\&. Expect the same name for header\&.
251 \fBheaders_idempotent\fR
255 many time happy\&. Rap header around easy\&.
257 say it can fix too\&. Always work\&.
260 \fBmain_header_compiles\fR
264 main header compile\&.
267 \fBavoids_cpp_reserved\fR
269 C++ programmer to include code\&. Not like them anyway, maybe, but wrong end your program, do mourn\&. Only main header compile C++ and if trying to compile C\e++ module stupid to pieces\&.
272 \fBno_trailing_whitespace\fR
274 Linux kernel programmers more, solve the problem for the space of the final ban the line\&. Now all lots of hackers working to fix it\&. Want to famous and Linux? Leave extra space too!
277 \fBexamples_compile\fR
282 from a comment in the header and
283 \fI_info\fR\&. First try to compile anything\&. If not, add many headers and maybe put inside the function\&. It does not work, adds the latest example\&. If the last example has
285 try that maybe\&. Sometimes too complicated!
289 to see why it broke\&. Or maybe bad example
296 If the example program that comments like
297 \fI// Given "foo" outputs "bar"\fR\fBccanlint\fR
298 will run the program with
300 in the command line and standard input\&. Happy if
302 are out\&. If quotes around
304 exact match needed; without quotes whitespace matches any other space and trailing ignored\&. \en is also supported for matching\&. You can also
305 \fI"output contains"\fR
306 to pass if the output contains the string\&.
311 CCAN link to the program module simply no error\&.
314 \fBobjects_build_with_stringchecks\fR
318 is super difficult to detect errors debugging chain\&.
320 use with the module and see break!
325 You have CCAN module directory called
326 \fItest\fR\&. You have proof here\&. If there is no proof,
328 still offer make proof for you\&.
335 which has four such tests, start with different name\&.
337 compile the test files, but no link to the module, you
339 to get the bits of the module\&.
341 test compile and link with the module\&.
349 set has to break or alert\&. This good for module supposed to warn\&.
352 \fBtest_helpers_compile\fR
355 \fItest\fR? Compilation of links to all tests\&. Ask for help\&.
363 test happy departure\&. If not happy, offer debugger\&.
366 \fBtests_pass_valgrind\fR
373 slow test\&. However, we found many errors! If
379 section, make "tests_pass_valgrind test/TESTNAME:FAIL"\&. If required valgrind additional option, "tests_pass_valgrind test/TESTNAME:\-\-option"\&.
382 \fBtests_pass_valgrind_noleaks\fR
385 complain if the memory leak test\&.
387 can also be disabled\&.
390 \fBtests_compile_coverage\fR
395 test coverage\&. Fun if not here!
400 Run tests again, find lines that never try! Half of the lines 1 point 3/4 getting 2 points\&. Limit of 5 points, but the extra point for all lines of evidence\&. Not win unless the module silly or use gimmick
401 \fIccan/failtest\fR\&.
404 \fBreduce_features\fR
408 make special config\&.h turned off\&. Not stupid like HAVE_BIG_ENDIAN though!
411 \fBdepends_build_without_features\fR
413 Make modules CCAN need\&. config\&.h but not more features\&.
416 \fBobjects_build_without_features\fR
418 Make the module again, but not more features\&.
421 \fBtests_helpers_compile_without_features\fR
423 Helpers do try again, but not more features\&.
426 \fBtests_compile_without_features\fR
428 Collect the tests again, but not more features\&.
431 \fBtests_pass_without_features\fR: Run tests again, but not more features\&.
434 \fBccanlint\fR rapid change\&. The bad man, bad page\&.
437 Rusty Russell wrote \fBccanlint\fR\&. Helping others, but most break Rusty\&.
440 Main web site: http://ccodearchive\&.net/
442 Wiki: https://github\&.com/rustyrussell/ccan/wiki/
445 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version\&.