rbuf, tools: clean up rbuf usage. We should use rbuf primitives not reach inside to membuf. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: fix compile after rbuf rewrite. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccanlint: Allow path to gcov to be overriden Currently ccanlint always assumes that the coverage tool can be invoked under the command "gcov". However, the coverage tool generally needs to be closely matched to the compiler version. So, the current behaviour won't work with compilers other than gcc, like clang. It won't even work for a gcc version which isn't the standard system one matching gcov. To address this, allow the command for the coverage tool to be overridden on the ccanlint command line with a new --gcov option. We also allow it to be overridden for make check with a GCOV make variable. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
tools: Consolidate gcov handling At the moment, invocation of the 'gcov' tool for coverage analysis from ccanlint is put directly into the tests_compile_coverage.c and tests_coverage.c files. This makes it awkard to extend. So, this patch moves the invocation of gcov into a new tools/gcov.v file, analagous to tools/compile.c. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccanlint: Move ccanlint test options from _info comments to code Currently, _info files can specify options, or note expected failures, for ccanlint checks in the _info file with specially structured comments. That differs from most other things ccanlint gets from _info, where it instead executes the info file with certain parameters. This changes ccanlint and existing _info files to use the normal method for the ccanlint test options as well. This also has the advantage that an info file can alter its test options based on things from config.h - in some cases whether a test can work or not might depend on various things. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
configurator: Add output cflag option and macro Unfortunately, not all compilers support -o as a command-line option for specifying the output file. Visual Studio cl.exe issues warning D9035 when -o is given, which is detected as a compile warning by the configurator. To support such compilers, add the command-line option -O to configurator which can be used to specify the cflag for setting the output executable file name. Additionally define the macro CCAN_OUTPUT_EXE_CFLAG in config.h and use it when invoking the compiler (e.g. from ccanlint). For reference, the name CCAN_OUTPUT_EXE_CFLAG was chosen to avoid potential name conflicts in the future due to cl.exe requiring different flags for different types of output[1] (e.g. object files are /Fo:). 1. https://msdn.microsoft.com/en-us/library/f1cb223a.aspx Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccanlint: make _info ported an empty string on success. Otherwise it describes what we need. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: commit missing support for _info ported flag. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccanlint: Add cflags support to _info
tools: use tal/grab_file Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccanlint: fix --compiler and --cflags options to apply to _info files as well. We weren't using the compiler and cflags options in tools/compile. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: use tal/path instead of writing own path handlers. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: use tal instead of talloc. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: use rbuf instead of grab_file. Slowly removing the talloc dependency. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: enhance get_libs to get libraries for tests, too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: add testdepends handling in _info. 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>
ccanlint: recurse to get -l options. If a dependent module needs -l options, we don't notice. Fix that, now we have one.
tools: more intelligent caching for compile _info. 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
tools: explicit find_ccan_dir() Move ccan_dir determination out to its own function, rather than implying it by the first time we get the manifest of a module.
ccanlint: remove argument to -k/--keep It's much easier to simply say "keep all", and it simplifies the code quite a bit.