gnu: cppcheck: Skip failing test.

* gnu/packages/patches/check.scm (cppcheck)[source]: Add patch.
* gnu/packages/patches/cppcheck-disable-char-signedness-test.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Register it.
This commit is contained in:
Efraim Flashner 2023-04-26 09:30:07 +03:00
parent ff4e463ddc
commit 8720e22fd0
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351
3 changed files with 31 additions and 2 deletions

View file

@ -10,7 +10,7 @@
# Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
# Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
# Copyright © 2016, 2017, 2018, 2019 Alex Vong <alexvong1995@gmail.com>
# Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
# Copyright © 2016-2023 Efraim Flashner <efraim@flashner.co.il>
# Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
# Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
@ -1016,6 +1016,7 @@ dist_patch_DATA = \
%D%/packages/patches/cool-retro-term-wctype.patch \
%D%/packages/patches/coreutils-gnulib-tests.patch \
%D%/packages/patches/coq-fix-envvars.patch \
%D%/packages/patches/cppcheck-disable-char-signedness-test.patch \
%D%/packages/patches/cpuinfo-system-libraries.patch \
%D%/packages/patches/cpulimit-with-glib-2.32.patch \
%D%/packages/patches/crawl-upgrade-saves.patch \

View file

@ -745,7 +745,8 @@ (define-public cppcheck
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32 "0riq7jlv21v2p77r01i36ll3klbgnkpsfk1wx4q8p1v5h5zgkkaa"))))
(base32 "0riq7jlv21v2p77r01i36ll3klbgnkpsfk1wx4q8p1v5h5zgkkaa"))
(patches (search-patches "cppcheck-disable-char-signedness-test.patch"))))
(build-system cmake-build-system)
(arguments
'(#:configure-flags '("-DBUILD_TESTS=ON")))

View file

@ -0,0 +1,27 @@
https://sources.debian.org/data/main/c/cppcheck/2.10-2/debian/patches/disable-some-tests-about-char-signedness
https://trac.cppcheck.net/ticket/11537
Description: Disable some tests affected by char signedness.
Author: Joachim Reichel <reichel@debian.org>
Bug: https://trac.cppcheck.net/ticket/11537
Index: cppcheck/test/testcondition.cpp
===================================================================
--- cppcheck.orig/test/testcondition.cpp
+++ cppcheck/test/testcondition.cpp
@@ -4939,6 +4939,7 @@ private:
"}\n");
ASSERT_EQUALS("[test.cpp:4]: (style) Condition 'it!=vector.end()' is always true\n", errout.str());
+#if 0
// #11303
check("void f(int n) {\n"
" std::vector<char> buffer(n);\n"
@@ -4947,6 +4948,7 @@ private:
" buffer.back() == '\\0') {}\n"
"}\n");
ASSERT_EQUALS("[test.cpp:5]: (style) Condition 'buffer.back()=='\\0'' is always false\n", errout.str());
+#endif
// #9353
check("typedef struct { std::string s; } X;\n"