Update to 2.7

- Add the following patch:
  cppcheck-2.7-tinyxml2.patch
- Remove patch:
  cppcheck-2.5-disable-test-testexprengine-array7.patch
This commit is contained in:
Wolfgang Stöggl 2022-02-10 22:12:07 +01:00
parent 6b94cc6ccc
commit 2998b0780d
5 changed files with 90 additions and 19 deletions

1
.gitignore vendored
View File

@ -47,3 +47,4 @@ cppcheck-1.44.tar.bz2
/cppcheck-2.3.tar.gz
/cppcheck-2.5.tar.gz
/cppcheck-2.6.tar.gz
/cppcheck-2.7.tar.gz

View File

@ -1,13 +0,0 @@
diff --git a/test/testexprengine.cpp b/test/testexprengine.cpp
index f23671a3d..c6069b49c 100644
--- a/test/testexprengine.cpp
+++ b/test/testexprengine.cpp
@@ -92,7 +92,7 @@ private:
TEST_CASE(array4);
TEST_CASE(array5);
TEST_CASE(array6);
- TEST_CASE(array7);
+ // TEST_CASE(array7);
TEST_CASE(arrayInit1);
TEST_CASE(arrayInit2);
TEST_CASE(arrayInit3);

View File

@ -0,0 +1,80 @@
diff --git a/gui/test/benchmark/simple/CMakeLists.txt b/gui/test/benchmark/simple/CMakeLists.txt
index 78cf81270..25e787819 100644
--- a/gui/test/benchmark/simple/CMakeLists.txt
+++ b/gui/test/benchmark/simple/CMakeLists.txt
@@ -1,11 +1,13 @@
qt5_wrap_cpp(test-benchmark-simple_SRC benchmarksimple.h)
add_custom_target(build-testbenchmark-simple-deps SOURCES ${test-benchmark-simple_SRC})
add_dependencies(gui-build-deps build-testbenchmark-simple-deps)
+if(USE_BUNDLED_TINYXML2)
+ list(APPEND test-benchmark-simple_SRC $<TARGET_OBJECTS:tinyxml2_objs>)
+endif()
add_executable(benchmark-simple
${test-benchmark-simple_SRC}
benchmarksimple.cpp
$<TARGET_OBJECTS:lib_objs>
- $<TARGET_OBJECTS:tinyxml2_objs>
$<TARGET_OBJECTS:simplecpp_objs>
)
target_include_directories(benchmark-simple PRIVATE ${CMAKE_SOURCE_DIR}/lib)
@@ -16,4 +18,7 @@ if (HAVE_RULES)
endif()
if (USE_Z3)
target_link_libraries(benchmark-simple ${Z3_LIBRARIES})
-endif()
\ No newline at end of file
+endif()
+if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
+ target_link_libraries(benchmark-simple tinyxml2)
+endif()
diff --git a/gui/test/xmlreportv2/CMakeLists.txt b/gui/test/xmlreportv2/CMakeLists.txt
index a244ea722..5dd39465c 100644
--- a/gui/test/xmlreportv2/CMakeLists.txt
+++ b/gui/test/xmlreportv2/CMakeLists.txt
@@ -22,4 +22,7 @@ if (HAVE_RULES)
endif()
if (USE_Z3)
target_link_libraries(test-xmlreportv2 ${Z3_LIBRARIES})
-endif()
\ No newline at end of file
+endif()
+if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
+ target_link_libraries(test-xmlreportv2 tinyxml2)
+endif()
diff --git a/oss-fuzz/CMakeLists.txt b/oss-fuzz/CMakeLists.txt
index c0fbd4d1c..5b2c5e059 100644
--- a/oss-fuzz/CMakeLists.txt
+++ b/oss-fuzz/CMakeLists.txt
@@ -1,11 +1,19 @@
if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- add_executable(fuzz-client EXCLUDE_FROM_ALL
+ set(fuzz-client_SRC
main.cpp
type2.cpp
+ )
+ if(USE_BUNDLED_TINYXML2)
+ list(APPEND fuzz-client_SRC $<TARGET_OBJECTS:tinyxml2_objs>)
+ endif()
+ add_executable(fuzz-client EXCLUDE_FROM_ALL
+ ${fuzz-client_SRC}
$<TARGET_OBJECTS:simplecpp_objs>
- $<TARGET_OBJECTS:tinyxml2_objs>
$<TARGET_OBJECTS:lib_objs>)
- target_include_directories(fuzz-client PRIVATE ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/externals/simplecpp ${CMAKE_SOURCE_DIR}/externals/tinyxml2 ${CMAKE_SOURCE_DIR}/externals)
+ target_include_directories(fuzz-client PRIVATE ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/externals/simplecpp ${CMAKE_SOURCE_DIR}/externals)
+ if(USE_BUNDLED_TINYXML2)
+ target_include_directories(fuzz-client PRIVATE ${CMAKE_SOURCE_DIR}/externals/tinyxml2/)
+ endif()
target_compile_options(fuzz-client PRIVATE -fsanitize=fuzzer)
# TODO: target_link_options() requires CMake >= 3.13
#target_link_options(fuzz-client PRIVATE -fsanitize=fuzzer)
@@ -16,6 +24,9 @@ if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if (USE_Z3)
target_link_libraries(fuzz-client PRIVATE ${Z3_LIBRARIES})
endif()
+ if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
+ target_link_libraries(fuzz-client PRIVATE tinyxml2)
+ endif()
add_executable(translate EXCLUDE_FROM_ALL
translate.cpp

View File

@ -1,7 +1,7 @@
%undefine __cmake_in_source_build
Name: cppcheck
Version: 2.6
Version: 2.7
Release: 1%{?dist}
Summary: Tool for static C/C++ code analysis
License: GPLv3+
@ -12,9 +12,8 @@ Source0: https://github.com/danmar/%{name}/archive/%{version}.tar.gz#/%{n
Patch0: cppcheck-2.2-translations.patch
# Select python3 explicitly
Patch1: cppcheck-1.88-htmlreport-python3.patch
# Disable one test, which fails under 32-bit archs i686 and armv7hl
# https://trac.cppcheck.net/ticket/10282
Patch2: cppcheck-2.5-disable-test-testexprengine-array7.patch
# https://github.com/danmar/cppcheck/commit/974dd5d
Patch2: cppcheck-2.7-tinyxml2.patch
BuildRequires: gcc-c++
BuildRequires: pcre-devel
@ -26,6 +25,7 @@ BuildRequires: desktop-file-utils
BuildRequires: tinyxml2-devel >= 2.1.0
BuildRequires: zlib-devel
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: z3-devel >= 4.7.1
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qttools-devel
@ -60,7 +60,7 @@ from xml files first generated using cppcheck.
%setup -q
%patch0 -p1 -b .translations
%patch1 -p1 -b .python3
%patch2 -p1 -b .array7
%patch2 -p1 -b .tinyxml2
# Make sure bundled tinyxml2 is not used
rm -r externals/tinyxml2
# Generate the Qt online-help file
@ -116,6 +116,9 @@ cd %{_vpath_builddir}/bin
%{_bindir}/cppcheck-htmlreport
%changelog
* Tue Feb 08 2022 Wolfgang Stöggl <c72578@yahoo.de> - 2.7-1
- Update to 2.7.
* Sat Oct 02 2021 Wolfgang Stöggl <c72578@yahoo.de> - 2.6-1
- Update to 2.6.

View File

@ -1 +1 @@
SHA512 (cppcheck-2.6.tar.gz) = 6abe518cb9d80c4d0fcc5d47a317f45f177a30372846008f5c65352db91e7de74e6ec6d500d1d18b8cd29a91e3974df125efb35c14c7814c9640741b3827fc2a
SHA512 (cppcheck-2.7.tar.gz) = 22da64126ec76fa2b3c533fe4c82d8c3a46a274bce78aa2495bffed5491c604891ba46684499a28a4a22ab928979e9388e52df36ad0e2b001b81619c26791aad