[PATCH 0/6] Test and linter fixups
Before starting to convert testcases to use tunbridge, I wanted to add linting for the Python test scripts. While doing that I discovered a new crop of cppcheck and clang-tidy false positives, and a Makefile bug. Here's a batch of fixes. I didn't manage to get through the whole testsuite with this. I keep getting hangs on rampstream_out, which I *think* are unrelated. David Gibson (6): test: Convince make not to accidentally delete exetool test: Add linting of Python test scripts clang-tidy: Suppress redundant expression warning cppcheck: Suppress the suppression of a suppression cppcheck: Suppress a buggy cppcheck warning cppcheck: Suppress variable scope warnings in dhcpv6() dhcpv6.c | 8 ++++++++ linux_dep.h | 2 +- tcp.c | 5 +++++ test/Makefile | 16 +++++++++++++++- test/build/build.py | 5 +++-- test/build/static_checkers.sh | 6 +++++- vhost_user.c | 1 + 7 files changed, 38 insertions(+), 5 deletions(-) -- 2.51.0
Our exeter tests make use of exetool, a tool that's part of the exeter
tree. Both Yumei and I have seen cases where exetool is missing, despite
it being from an external tree we shouldn't be touching.
I haven't pinned down the exact circumstances in which this happens, but I
think this is occurring because the way the Makefile refers to it can make
it look like an intermediate target that make may delete when interrupted.
Mark it as .PRECIOUS to prevent that.
Signed-off-by: David Gibson
Another cppcheck package in Fedora, another bogus false positive. This
one seems to not realise that a variable has been initialised by
getsockopt() under a complicated set of circumstances.
Signed-off-by: David Gibson
At least some cppcheck versions (2.18.3 for me) complain that the _storage
variables in dhcpv6() could be reduced in scope. That's not actually the
case, because although we don't reference the variables, we may touch
their memory via pointers after the blocks in question. There's no
reasonable way for cppcheck to determine that, though, so suppress its
warnings.
Signed-off-by: David Gibson
On Wed, Oct 01, 2025 at 07:51:57PM +1000, David Gibson wrote:
Our exeter tests make use of exetool, a tool that's part of the exeter tree. Both Yumei and I have seen cases where exetool is missing, despite it being from an external tree we shouldn't be touching.
I haven't pinned down the exact circumstances in which this happens, but I think this is occurring because the way the Makefile refers to it can make it look like an intermediate target that make may delete when interrupted. Mark it as .PRECIOUS to prevent that.
Signed-off-by: David Gibson
This doesn't seem to be working, I'll try a different approach.
--- test/Makefile | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/test/Makefile b/test/Makefile index 49388276..69987d0b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -81,6 +81,8 @@ pull-%: % exeter: git clone https://gitlab.com/dgibson/exeter.git
+# Don't delete this, make, even though it looks like an intermediate target +.PRECIOUS: exeter/exetool/exetool exeter/exetool/exetool: pull-exeter
mbuto: -- 2.51.0
-- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson
participants (1)
-
David Gibson