From 45de338f1bace4273b0607fc60a5b1c93823d467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Wed, 2 Aug 2023 10:36:17 +0200 Subject: [PATCH] cleaned up includes based on include-what-you-use / iwyu.yml: updated to yet another distro to get the latest version and updated the Chaotic-AUR key (#5267) This is a mess. The version is AUR is still outdated and also doesn't install anymore. Fedora 38 carries the latest version of it so use that now. Keep the old steps in case we need to switch again in the future. --- .github/workflows/iwyu.yml | 14 +++++++++++--- Makefile | 4 ++-- cli/cmdlineparser.cpp | 5 ----- cli/cmdlineparser.h | 1 + gui/compliancereportdialog.cpp | 19 +++++++++++++++++++ gui/compliancereportdialog.h | 18 ++++++++++++++++++ gui/librarydialog.cpp | 2 -- gui/projectfile.cpp | 1 - gui/projectfiledialog.cpp | 3 --- gui/resultstree.cpp | 2 -- lib/checkclass.cpp | 1 - lib/checkmemoryleak.cpp | 1 - lib/checksizeof.cpp | 1 + lib/checkunusedfunctions.cpp | 1 - lib/clangimport.cpp | 1 - lib/errorlogger.cpp | 1 - lib/library.cpp | 2 +- lib/settings.cpp | 1 - lib/suppressions.cpp | 1 - lib/symboldatabase.cpp | 1 + lib/token.cpp | 1 - lib/token.h | 1 + lib/tokenize.cpp | 1 + lib/valueflow.cpp | 2 -- test/fixture.cpp | 2 +- test/fixture.h | 7 +++++-- test/helpers.cpp | 4 +++- test/testassert.cpp | 1 - test/testautovariables.cpp | 2 -- test/testbool.cpp | 1 - test/testboost.cpp | 1 - test/testbufferoverrun.cpp | 1 - test/testclass.cpp | 4 +++- test/testcondition.cpp | 1 - test/testerrorlogger.cpp | 1 - test/testexceptionsafety.cpp | 1 - test/testfunctions.cpp | 2 -- test/testinternal.cpp | 1 - test/testio.cpp | 1 - test/testleakautovar.cpp | 1 - test/testlibrary.cpp | 1 + test/testmemleak.cpp | 1 - test/testoptions.cpp | 33 ++++++++++++++++++--------------- test/testother.cpp | 1 - test/testsingleexecutor.cpp | 3 ++- test/testsizeof.cpp | 1 - test/teststl.cpp | 1 - test/teststring.cpp | 1 - test/testtype.cpp | 1 - test/testuninitvar.cpp | 1 - test/testunusedfunctions.cpp | 1 - test/testutils.cpp | 3 +-- test/testvaarg.cpp | 1 - 53 files changed, 90 insertions(+), 75 deletions(-) diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index a6773e993..f920b0ece 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-22.04 container: - image: "archlinux:latest" + image: "fedora:latest" steps: - uses: actions/checkout@v3 @@ -34,8 +34,8 @@ jobs: pacman -Sy pacman -S cmake make gcc qt5-base qt5-tools qt5-charts pcre wget --noconfirm pacman-key --init - pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com - pacman-key --lsign-key FBA220DFC880C036 + pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com + pacman-key --lsign-key 3056513887B78AEB pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm echo "[chaotic-aur]" >> /etc/pacman.conf echo "Include = /etc/pacman.d/chaotic-mirrorlist" >> /etc/pacman.conf @@ -43,6 +43,14 @@ jobs: pacman -S include-what-you-use --noconfirm ln -s iwyu-tool /usr/sbin/iwyu_tool + # TODO: the necessary packages are excessive - mostly because of Qt - use a pre-built image + - name: Install missing software on Fedora + run: | + dnf install -y cmake gcc-c++ qt5-qtbase-devel qt5-linguist qt5-qttools-devel qt5-qtcharts-devel pcre-devel + dnf install -y wget iwyu + ln -s iwyu_tool.py /usr/bin/iwyu_tool + ln -s qt5 /usr/include/qt + - name: Prepare CMake run: | cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off diff --git a/Makefile b/Makefile index 81e18beca..fe2665a77 100644 --- a/Makefile +++ b/Makefile @@ -667,7 +667,7 @@ cli/stacktrace.o: cli/stacktrace.cpp cli/stacktrace.h lib/config.h lib/utils.h cli/threadexecutor.o: cli/threadexecutor.cpp cli/cppcheckexecutor.h cli/executor.h cli/threadexecutor.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h $(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/threadexecutor.cpp -test/fixture.o: test/fixture.cpp externals/tinyxml2/tinyxml2.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h test/options.h test/redirect.h +test/fixture.o: test/fixture.cpp externals/tinyxml2/tinyxml2.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h test/options.h test/redirect.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/fixture.cpp test/helpers.o: test/helpers.cpp externals/simplecpp/simplecpp.h lib/config.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/helpers.h @@ -862,7 +862,7 @@ test/testunusedprivfunc.o: test/testunusedprivfunc.cpp externals/simplecpp/simpl test/testunusedvar.o: test/testunusedvar.cpp externals/simplecpp/simplecpp.h lib/check.h lib/checkunusedvar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedvar.cpp -test/testutils.o: test/testutils.cpp lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h +test/testutils.o: test/testutils.cpp lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testutils.cpp test/testvaarg.o: test/testvaarg.cpp lib/check.h lib/checkvaarg.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 0848f483c..4f6b12e2e 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -44,7 +44,6 @@ #include #include #include // IWYU pragma: keep -#include #include #include @@ -53,10 +52,6 @@ #include #endif -#ifdef __linux__ -#include -#endif - static bool addFilesToList(const std::string& fileList, std::vector& pathNames) { std::istream *files; diff --git a/cli/cmdlineparser.h b/cli/cmdlineparser.h index d12a5247b..e84e68352 100644 --- a/cli/cmdlineparser.h +++ b/cli/cmdlineparser.h @@ -19,6 +19,7 @@ #ifndef CMDLINE_PARSER_H #define CMDLINE_PARSER_H +#include #include #include diff --git a/gui/compliancereportdialog.cpp b/gui/compliancereportdialog.cpp index 43a1ef0f7..10ab0b424 100644 --- a/gui/compliancereportdialog.cpp +++ b/gui/compliancereportdialog.cpp @@ -1,3 +1,21 @@ +/* + * Cppcheck - A tool for static C/C++ code analysis + * Copyright (C) 2007-2023 Cppcheck team. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include "compliancereportdialog.h" #include "ui_compliancereportdialog.h" @@ -16,6 +34,7 @@ #include #include +#include #include #include #include diff --git a/gui/compliancereportdialog.h b/gui/compliancereportdialog.h index 99bf18489..ad3b79c5c 100644 --- a/gui/compliancereportdialog.h +++ b/gui/compliancereportdialog.h @@ -1,3 +1,21 @@ +/* + * Cppcheck - A tool for static C/C++ code analysis + * Copyright (C) 2007-2023 Cppcheck team. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef COMPLIANCEREPORTDIALOG_H #define COMPLIANCEREPORTDIALOG_H diff --git a/gui/librarydialog.cpp b/gui/librarydialog.cpp index d258e59c0..e077a6b76 100644 --- a/gui/librarydialog.cpp +++ b/gui/librarydialog.cpp @@ -25,8 +25,6 @@ #include "ui_librarydialog.h" -#include - #include #include #include diff --git a/gui/projectfile.cpp b/gui/projectfile.cpp index e60e54a61..349c91ebe 100644 --- a/gui/projectfile.cpp +++ b/gui/projectfile.cpp @@ -23,7 +23,6 @@ #include "importproject.h" #include "settings.h" -#include #include #include diff --git a/gui/projectfiledialog.cpp b/gui/projectfiledialog.cpp index 523641d27..6aa5e0cd3 100644 --- a/gui/projectfiledialog.cpp +++ b/gui/projectfiledialog.cpp @@ -34,16 +34,13 @@ #include #include -#include #include #include #include #include #include -#include #include #include -#include #include #include #include diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 792f777fe..33f36102a 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -31,8 +31,6 @@ #include "threadhandler.h" #include "xmlreportv2.h" -#include - #include #include #include diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 934d237b7..781b04e2c 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -34,7 +34,6 @@ #include #include -#include #include #include #include diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 06d7b779f..b6f4dde5b 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -28,7 +28,6 @@ #include "tokenize.h" #include -#include #include #include diff --git a/lib/checksizeof.cpp b/lib/checksizeof.cpp index 220195401..281f02a6a 100644 --- a/lib/checksizeof.cpp +++ b/lib/checksizeof.cpp @@ -21,6 +21,7 @@ #include "checksizeof.h" #include "errortypes.h" +#include "library.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" diff --git a/lib/checkunusedfunctions.cpp b/lib/checkunusedfunctions.cpp index d9ca653be..c0fa12c2f 100644 --- a/lib/checkunusedfunctions.cpp +++ b/lib/checkunusedfunctions.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include // IWYU pragma: keep #include diff --git a/lib/clangimport.cpp b/lib/clangimport.cpp index 0c10aba71..328d65275 100644 --- a/lib/clangimport.cpp +++ b/lib/clangimport.cpp @@ -30,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/lib/errorlogger.cpp b/lib/errorlogger.cpp index 614802283..08ac7fbae 100644 --- a/lib/errorlogger.cpp +++ b/lib/errorlogger.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include // IWYU pragma: keep diff --git a/lib/library.cpp b/lib/library.cpp index 53608226c..3744f4552 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -31,12 +31,12 @@ #include #include #include -#include #include #include #include #include // IWYU pragma: keep #include +#include #include #include diff --git a/lib/settings.cpp b/lib/settings.cpp index c49ca2356..3e40ef7c7 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -23,7 +23,6 @@ #include "vfvalue.h" #include -#include #define PICOJSON_USE_INT64 #include diff --git a/lib/suppressions.cpp b/lib/suppressions.cpp index 7403a3ec4..8b0095edc 100644 --- a/lib/suppressions.cpp +++ b/lib/suppressions.cpp @@ -28,7 +28,6 @@ #include #include // std::isdigit, std::isalnum, etc -#include #include #include // std::bind, std::placeholders #include // IWYU pragma: keep diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 99e3f4815..13347f00b 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include // IWYU pragma: keep #include diff --git a/lib/token.cpp b/lib/token.cpp index f24dc6f27..390490e86 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/token.h b/lib/token.h index 5864a0db9..66016f33b 100644 --- a/lib/token.h +++ b/lib/token.h @@ -27,6 +27,7 @@ #include "utils.h" #include "vfvalue.h" +#include #include #include #include diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 302c20231..1197430fc 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -34,6 +34,7 @@ #include "token.h" #include "utils.h" #include "valueflow.h" +#include "vfvalue.h" #include #include diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index a6ea2761a..128caef0e 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -109,10 +109,8 @@ #include #include #include -#include #include #include -#include #include #include #include diff --git a/test/fixture.cpp b/test/fixture.cpp index 81db5b4d7..0f7c99bf3 100644 --- a/test/fixture.cpp +++ b/test/fixture.cpp @@ -20,13 +20,13 @@ #include "errortypes.h" #include "options.h" -#include "path.h" #include "redirect.h" #include #include #include #include +#include #include #include diff --git a/test/fixture.h b/test/fixture.h index 5004f1608..dd8264c8c 100644 --- a/test/fixture.h +++ b/test/fixture.h @@ -24,17 +24,20 @@ #include "color.h" #include "config.h" #include "errorlogger.h" +#include "errortypes.h" +#include "library.h" +#include "platform.h" #include "settings.h" +#include "standards.h" #include #include -#include #include #include #include +#include class options; -class Settings; class Tokenizer; class TestFixture : public ErrorLogger { diff --git a/test/helpers.cpp b/test/helpers.cpp index 9c86d7320..0d33758cc 100644 --- a/test/helpers.cpp +++ b/test/helpers.cpp @@ -21,9 +21,11 @@ #include "path.h" #include "preprocessor.h" +#include #include #include -#include +#include // IWYU pragma: keep +#include #include #include #include diff --git a/test/testassert.cpp b/test/testassert.cpp index 8c18720ed..491d9a183 100644 --- a/test/testassert.cpp +++ b/test/testassert.cpp @@ -23,7 +23,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include // IWYU pragma: keep diff --git a/test/testautovariables.cpp b/test/testautovariables.cpp index 5fbe371f6..0ee1d8413 100644 --- a/test/testautovariables.cpp +++ b/test/testautovariables.cpp @@ -23,9 +23,7 @@ #include "fixture.h" #include "tokenize.h" -#include #include // IWYU pragma: keep -#include class TestAutoVariables : public TestFixture { public: diff --git a/test/testbool.cpp b/test/testbool.cpp index 2e3b21067..3f311183d 100644 --- a/test/testbool.cpp +++ b/test/testbool.cpp @@ -23,7 +23,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include // IWYU pragma: keep class TestBool : public TestFixture { diff --git a/test/testboost.cpp b/test/testboost.cpp index e82feb4f6..39dfeff41 100644 --- a/test/testboost.cpp +++ b/test/testboost.cpp @@ -23,7 +23,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include // IWYU pragma: keep class TestBoost : public TestFixture { diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index c12bb4467..97841f45a 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -22,7 +22,6 @@ #include "ctu.h" #include "errortypes.h" #include "standards.h" -#include "library.h" #include "platform.h" #include "settings.h" #include "fixture.h" diff --git a/test/testclass.cpp b/test/testclass.cpp index f79744666..430fb6c09 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -19,17 +19,19 @@ #include "check.h" #include "checkclass.h" #include "errortypes.h" -#include "library.h" #include "preprocessor.h" #include "settings.h" #include "fixture.h" #include "tokenize.h" #include +#include #include // IWYU pragma: keep #include +#include #include +#include class TestClass : public TestFixture { public: diff --git a/test/testcondition.cpp b/test/testcondition.cpp index c9e33172d..b9a7d6e5c 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -25,7 +25,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include #include // IWYU pragma: keep #include diff --git a/test/testerrorlogger.cpp b/test/testerrorlogger.cpp index 1f48090e8..481f67bb7 100644 --- a/test/testerrorlogger.cpp +++ b/test/testerrorlogger.cpp @@ -23,7 +23,6 @@ #include "suppressions.h" #include "fixture.h" -#include #include #include diff --git a/test/testexceptionsafety.cpp b/test/testexceptionsafety.cpp index 997c672ee..274a895a6 100644 --- a/test/testexceptionsafety.cpp +++ b/test/testexceptionsafety.cpp @@ -23,7 +23,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include // IWYU pragma: keep class TestExceptionSafety : public TestFixture { diff --git a/test/testfunctions.cpp b/test/testfunctions.cpp index 2d82961d9..418f36130 100644 --- a/test/testfunctions.cpp +++ b/test/testfunctions.cpp @@ -18,13 +18,11 @@ #include "checkfunctions.h" #include "errortypes.h" -#include "library.h" #include "settings.h" #include "standards.h" #include "fixture.h" #include "tokenize.h" -#include #include // IWYU pragma: keep #include diff --git a/test/testinternal.cpp b/test/testinternal.cpp index 0904b62e0..4092e45e9 100644 --- a/test/testinternal.cpp +++ b/test/testinternal.cpp @@ -23,7 +23,6 @@ #include "fixture.h" #include "settings.h" -#include #include class TestInternal : public TestFixture { diff --git a/test/testio.cpp b/test/testio.cpp index 81fb37076..4db7e72e4 100644 --- a/test/testio.cpp +++ b/test/testio.cpp @@ -25,7 +25,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include // IWYU pragma: keep #include diff --git a/test/testleakautovar.cpp b/test/testleakautovar.cpp index 243693239..11eca62d3 100644 --- a/test/testleakautovar.cpp +++ b/test/testleakautovar.cpp @@ -24,7 +24,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include #include // IWYU pragma: keep #include diff --git a/test/testlibrary.cpp b/test/testlibrary.cpp index fe3bd036c..16caaa4f6 100644 --- a/test/testlibrary.cpp +++ b/test/testlibrary.cpp @@ -26,6 +26,7 @@ #include "tokenize.h" #include "tokenlist.h" +#include #include #include // IWYU pragma: keep #include diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 2684e5b04..beedd57b2 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -26,7 +26,6 @@ #include #include // IWYU pragma: keep -#include class TestMemleakInClass; class TestMemleakNoVar; diff --git a/test/testoptions.cpp b/test/testoptions.cpp index c97d59402..f03f183db 100644 --- a/test/testoptions.cpp +++ b/test/testoptions.cpp @@ -1,22 +1,25 @@ -// Cppcheck - A tool for static C/C++ code analysis -// Copyright (C) 2007-2023 Cppcheck team. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . +/* + * Cppcheck - A tool for static C/C++ code analysis + * Copyright (C) 2007-2023 Cppcheck team. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "options.h" #include "fixture.h" +#include #include #include diff --git a/test/testother.cpp b/test/testother.cpp index 2024a031f..8c54d541f 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -26,7 +26,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include #include // IWYU pragma: keep #include diff --git a/test/testsingleexecutor.cpp b/test/testsingleexecutor.cpp index 1ebf9a83c..2bdf94c86 100644 --- a/test/testsingleexecutor.cpp +++ b/test/testsingleexecutor.cpp @@ -19,6 +19,7 @@ #include "cppcheck.h" #include "fixture.h" #include "helpers.h" +#include "importproject.h" #include "redirect.h" #include "library.h" #include "settings.h" @@ -28,10 +29,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/test/testsizeof.cpp b/test/testsizeof.cpp index fafc84526..e16e4db6c 100644 --- a/test/testsizeof.cpp +++ b/test/testsizeof.cpp @@ -22,7 +22,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include #include // IWYU pragma: keep #include diff --git a/test/teststl.cpp b/test/teststl.cpp index b58ea3072..b25a44431 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -25,7 +25,6 @@ #include "utils.h" #include -#include #include // IWYU pragma: keep #include diff --git a/test/teststring.cpp b/test/teststring.cpp index 61bc1e5f0..24a4f1c3a 100644 --- a/test/teststring.cpp +++ b/test/teststring.cpp @@ -23,7 +23,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include // IWYU pragma: keep diff --git a/test/testtype.cpp b/test/testtype.cpp index b8a60e4c8..b6ce65867 100644 --- a/test/testtype.cpp +++ b/test/testtype.cpp @@ -24,7 +24,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include // IWYU pragma: keep #include diff --git a/test/testuninitvar.cpp b/test/testuninitvar.cpp index e063a2a28..924ebcaa6 100644 --- a/test/testuninitvar.cpp +++ b/test/testuninitvar.cpp @@ -20,7 +20,6 @@ #include "checkuninitvar.h" #include "ctu.h" #include "errortypes.h" -#include "library.h" #include "settings.h" #include "fixture.h" #include "tokenize.h" diff --git a/test/testunusedfunctions.cpp b/test/testunusedfunctions.cpp index 0eed7a68f..0cccc44cc 100644 --- a/test/testunusedfunctions.cpp +++ b/test/testunusedfunctions.cpp @@ -24,7 +24,6 @@ #include "tokenize.h" #include -#include class TestUnusedFunctions : public TestFixture { public: diff --git a/test/testutils.cpp b/test/testutils.cpp index 6b6163482..09f92d381 100644 --- a/test/testutils.cpp +++ b/test/testutils.cpp @@ -16,14 +16,13 @@ * along with this program. If not, see . */ -#include "helpers.h" #include "fixture.h" -#include "settings.h" #include "utils.h" #include #include #include +#include #include class TestUtils : public TestFixture { diff --git a/test/testvaarg.cpp b/test/testvaarg.cpp index b4307c32d..d160336f3 100644 --- a/test/testvaarg.cpp +++ b/test/testvaarg.cpp @@ -23,7 +23,6 @@ #include "fixture.h" #include "tokenize.h" -#include #include // IWYU pragma: keep class TestVaarg : public TestFixture {