SHA256
1
0
forked from pool/cppcheck

Accepting request 1089803 from home:manfred999

Test suite quirks. Patch could be optionally only be added for
the affected archs (arm, ppc, s390), but I think it is not worth it,
see also upstream bug report mentioned in the patch.
Running the test suite with "-j1" is no problem as it takes only a
few seconds.

OBS-URL: https://build.opensuse.org/request/show/1089803
OBS-URL: https://build.opensuse.org/package/show/devel:tools/cppcheck?expand=0&rev=111
This commit is contained in:
Marcus Meissner 2023-06-01 10:02:25 +00:00 committed by Git OBS Bridge
parent 331c3738d4
commit b4b55e5e82
3 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue May 30 10:57:47 UTC 2023 - Manfred Schwarb <manfred99@gmx.ch>
- test suite quirks:
* Add patch disable-some-tests-about-char-signedness.patch, taken
from Debian, to disable test "TestCondition::alwaysTrueContainer"
which fails on "unsigned char" archs (arm, ppc)
* Run test suite with "-j1", as TestProcessExecutor test is flaky otherwise
-------------------------------------------------------------------
Wed Mar 29 12:13:06 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@ -23,6 +23,7 @@ Summary: A tool for static C/C++ code analysis
License: GPL-3.0-or-later
URL: https://github.com/danmar/cppcheck
Source: https://github.com/danmar/cppcheck/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: disable-some-tests-about-char-signedness.patch
BuildRequires: cmake
BuildRequires: docbook-xsl-stylesheets
BuildRequires: fdupes
@ -103,6 +104,7 @@ sed -i "s|env python3|python3|g" htmlreport/cppcheck-htmlreport
%check
export CXXFLAGS="%{optflags}"
%define _smp_mflags -j1
%ctest
%install

View File

@ -0,0 +1,24 @@
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"