From b4b55e5e82916552ab4455e9af4a8dfe7898fb9fa425e8371c80fcf6d8e35f5b Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 1 Jun 2023 10:02:25 +0000 Subject: [PATCH] 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 --- cppcheck.changes | 9 +++++++ cppcheck.spec | 2 ++ ...ble-some-tests-about-char-signedness.patch | 24 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 disable-some-tests-about-char-signedness.patch diff --git a/cppcheck.changes b/cppcheck.changes index b45e994..788775c 100644 --- a/cppcheck.changes +++ b/cppcheck.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue May 30 10:57:47 UTC 2023 - Manfred Schwarb + +- 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 diff --git a/cppcheck.spec b/cppcheck.spec index 457f4e8..6ad4a61 100644 --- a/cppcheck.spec +++ b/cppcheck.spec @@ -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 diff --git a/disable-some-tests-about-char-signedness.patch b/disable-some-tests-about-char-signedness.patch new file mode 100644 index 0000000..e8f09e3 --- /dev/null +++ b/disable-some-tests-about-char-signedness.patch @@ -0,0 +1,24 @@ +Description: Disable some tests affected by char signedness. +Author: Joachim Reichel +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 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"