Add `tools/check-include-guard.py`, whose task is to verify that the
include guards in a given file is formatted as we want. Example:
$ ./tools/check-include-guard.py ./src/plugins/ctf/fs-sink/fs-sink-trace.hpp
In `#ifndef BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_TRACE_H` include guard line: expecting `#ifndef BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_TRACE_HPP`
`tools/check-include-guard.py` supports the `--fix` option, which makes
it try to fix the include guards in-place (mostly useful for that
initial pass where we have a lot of stuff to fix).
Add `tools/check-include-guards.sh`, whose task is to find all the
files we want to check include guards for, and call
`tools/check-include-guard.py` on them.
Limitations:
- Only tested on GNU/Linux
Change-Id: I7a376fdcf50f92bda20ab50e529d73bcd2faeb03
Signed-off-by: Simon Marchi <email address hidden>
Signed-off-by: Philippe Proulx <email address hidden>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12632
tests/utils/utils.sh: bt_diff(): validate that both files exist
Otherwise bt_diff() returns 0 (happy) with a nonexistent file.
This change reveals that `tests/plugins/src.ctf.fs/field/test-field.sh`
passes, but for the wrong reason: run_python() doesn't exist (I replaced
it with bt_run_in_py_env() a while ago), therefore that line doesn't
create any expectation file and bt_diff() returns 0. Change it to
use bt_run_in_py_env().
The use of `GString` is unnecessary for these fields. In fact, I think
it just makes things more complicated for nothing. Change to use
`gchar *`, allocated with `g_strdup()` and freed with `g_free()`.