diff options
63 files changed, 326 insertions, 45 deletions
diff --git a/Jamroot.jam b/Jamroot.jam index 2299a06..5e9bc15 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -36,6 +36,7 @@ project <toolset>tidy:<xcheckxx>hicpp-no-array-decay <toolset>tidy:<checkxx>performance-* <toolset>tidy:<define>ICE_IGNORE_VERSION + <toolset>tidy:<mapping>iwyu.json ; build-project libadhocutil ; diff --git a/iwyu.json b/iwyu.json new file mode 100644 index 0000000..3765a27 --- /dev/null +++ b/iwyu.json @@ -0,0 +1,117 @@ +[ + { + "include": [ + "<bits/types/stack_t.h>", + "private", + "<ucontext.h>", + "public" + ] + }, + { + "include": [ + "<boost/cstdint.hpp>", + "private", + "<cstdint>", + "public" + ] + }, + { + "include": [ + "<ext/alloc_traits.h>", + "private", + "<memory>", + "public" + ] + }, + { + "include": [ + "<bits/struct_stat.h>", + "private", + "<sys/stat.h>", + "public" + ] + }, + { + "include": [ + "<bits/exception.h>", + "private", + "<stdexcept>", + "public" + ] + }, + { + "include": [ + "@<boost/test/(unit_test_suite|framework).hpp>", + "private", + "<boost/test/unit_test.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/test/(utils|tools|tree)/.*>", + "private", + "<boost/test/unit_test.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/format/(format_(class|implementation)|alt_sstream).hpp>", + "private", + "<boost/format.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/test/data/.*>", + "private", + "<boost/test/data/test_case.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/mpl/.*>", + "private", + "<boost/mpl/list.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/iostreams/detail/.*>", + "private", + "<boost/iostreams/stream.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/preprocessor/.*>", + "private", + "<boost/test/unit_test.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/multi_index/detail/ord.*>", + "private", + "<boost/multi_index/ordered_index.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/multi_index/detail/bidir.*>", + "private", + "<boost/multi_index_container.hpp>", + "public" + ] + }, + { + "ref": "/usr/lib/llvm/11/share/include-what-you-use/boost-all-private.imp" + } +] diff --git a/libadhocutil/buffer.cpp b/libadhocutil/buffer.cpp index e089c35..bade74e 100644 --- a/libadhocutil/buffer.cpp +++ b/libadhocutil/buffer.cpp @@ -1,7 +1,10 @@ #include "buffer.h" #include <cstdio> +#include <cstdlib> #include <cstring> #include <numeric> +#include <ostream> +#include <utility> namespace AdHoc { diff --git a/libadhocutil/buffer.h b/libadhocutil/buffer.h index 373e799..bd9fc30 100644 --- a/libadhocutil/buffer.h +++ b/libadhocutil/buffer.h @@ -3,8 +3,12 @@ #include "c++11Helpers.h" #include "visibility.h" -#include <boost/format.hpp> +#include <boost/format.hpp> // IWYU pragma: keep +#include <boost/format/format_fwd.hpp> #include <cstdarg> +#include <cstddef> +#include <iosfwd> +#include <memory> #include <string> #include <vector> diff --git a/libadhocutil/cache.impl.h b/libadhocutil/cache.impl.h index d05824f..e26bf30 100644 --- a/libadhocutil/cache.impl.h +++ b/libadhocutil/cache.impl.h @@ -1,7 +1,7 @@ #ifndef ADHOCUTIL_CACHE_IMPL_H #define ADHOCUTIL_CACHE_IMPL_H -#include "cache.h" +#include "cache.h" // IWYU pragma: export #include "lockHelpers.h" #include <boost/lambda/lambda.hpp> #include <mutex> diff --git a/libadhocutil/compileTimeFormatter.h b/libadhocutil/compileTimeFormatter.h index b454863..fbbd7bc 100644 --- a/libadhocutil/compileTimeFormatter.h +++ b/libadhocutil/compileTimeFormatter.h @@ -6,7 +6,7 @@ #include <cstring> #include <iostream> #include <optional> -#include <sstream> +#include <sstream> // IWYU pragma: export namespace AdHoc { #ifdef __cpp_nontype_template_parameter_class diff --git a/libadhocutil/curlHandle.cpp b/libadhocutil/curlHandle.cpp index 3974f34..b37b725 100644 --- a/libadhocutil/curlHandle.cpp +++ b/libadhocutil/curlHandle.cpp @@ -1,5 +1,6 @@ #include "curlHandle.h" #include "compileTimeFormatter.h" +#include <Ice/Optional.h> #include <boost/numeric/conversion/cast.hpp> #include <net.h> diff --git a/libadhocutil/curlHandle.h b/libadhocutil/curlHandle.h index dd8e595..6169ec1 100644 --- a/libadhocutil/curlHandle.h +++ b/libadhocutil/curlHandle.h @@ -3,8 +3,9 @@ #include "c++11Helpers.h" #include "visibility.h" -#include <curl/curl.h> +#include <curl/curl.h> // IWYU pragma: export #include <memory> +#include <string> namespace AdHoc { namespace Net { diff --git a/libadhocutil/curlMultiHandle.cpp b/libadhocutil/curlMultiHandle.cpp index a4a3c0c..3f73ad7 100644 --- a/libadhocutil/curlMultiHandle.cpp +++ b/libadhocutil/curlMultiHandle.cpp @@ -1,8 +1,12 @@ #include "curlMultiHandle.h" #include "curlStream.h" -#include "runtimeContext.h" +#include <boost/core/ref.hpp> +#include <boost/core/typeinfo.hpp> #include <boost/iostreams/stream.hpp> #include <map> +#include <sys/select.h> +#include <sys/time.h> +#include <utility> namespace AdHoc::Net { diff --git a/libadhocutil/curlMultiHandle.h b/libadhocutil/curlMultiHandle.h index 2116565..56964dd 100644 --- a/libadhocutil/curlMultiHandle.h +++ b/libadhocutil/curlMultiHandle.h @@ -5,9 +5,11 @@ #include "curlHandle.h" #include "visibility.h" #include <functional> +#include <iosfwd> #include <map> #include <memory> #include <set> +#include <string> namespace AdHoc { namespace Net { diff --git a/libadhocutil/curlStream.cpp b/libadhocutil/curlStream.cpp index 8f129d7..3572136 100644 --- a/libadhocutil/curlStream.cpp +++ b/libadhocutil/curlStream.cpp @@ -1,4 +1,6 @@ #include "curlStream.h" +#include <algorithm> +#include <cstring> namespace AdHoc::Net { diff --git a/libadhocutil/curlStream.h b/libadhocutil/curlStream.h index 64fb38e..83b7d7a 100644 --- a/libadhocutil/curlStream.h +++ b/libadhocutil/curlStream.h @@ -5,9 +5,14 @@ #include "curlHandle.h" #include "runtimeContext.h" #include "visibility.h" +#include <boost/iostreams/concepts.hpp> #include <boost/iostreams/stream.hpp> -#include <curl/curl.h> +#include <cstddef> +#include <iosfwd> #include <string> +namespace boost { + template<class T> class reference_wrapper; +} namespace AdHoc { namespace Net { @@ -40,7 +45,6 @@ namespace AdHoc { }; using CurlStream = boost::iostreams::stream<boost::reference_wrapper<CurlStreamSource>>; - } } diff --git a/libadhocutil/exception.h b/libadhocutil/exception.h index e41796c..ed151b6 100644 --- a/libadhocutil/exception.h +++ b/libadhocutil/exception.h @@ -1,7 +1,7 @@ #ifndef ADHOCUTIL_EXCEPTION_H #define ADHOCUTIL_EXCEPTION_H -#include <exception> +#include <exception> // IWYU pragma: export #include <optional> #include <string> diff --git a/libadhocutil/factory.impl.h b/libadhocutil/factory.impl.h index 2010836..a630592 100644 --- a/libadhocutil/factory.impl.h +++ b/libadhocutil/factory.impl.h @@ -1,8 +1,8 @@ #ifndef ADHOCUTIL_FACTORY_IMPL_H #define ADHOCUTIL_FACTORY_IMPL_H -#include "factory.h" -#include "plugins.impl.h" +#include "factory.h" // IWYU pragma: export +#include "plugins.impl.h" // IWYU pragma: export namespace AdHoc { template<typename Base, typename... Params> diff --git a/libadhocutil/fileUtils.cpp b/libadhocutil/fileUtils.cpp index b648996..785fb38 100644 --- a/libadhocutil/fileUtils.cpp +++ b/libadhocutil/fileUtils.cpp @@ -1,6 +1,9 @@ #include "fileUtils.h" #include "compileTimeFormatter.h" #include <boost/assert.hpp> +#include <cerrno> +#include <cstring> +#include <memory> #include <sys.h> #include <sys/mman.h> #include <unistd.h> diff --git a/libadhocutil/fileUtils.h b/libadhocutil/fileUtils.h index c162677..fd6ddf2 100644 --- a/libadhocutil/fileUtils.h +++ b/libadhocutil/fileUtils.h @@ -3,10 +3,10 @@ #include "c++11Helpers.h" #include "visibility.h" -#include <fcntl.h> -#include <filesystem> +#include <fcntl.h> // IWYU pragma: export +#include <filesystem> // IWYU pragma: export #include <string_view> -#include <sys/stat.h> +#include <sys/stat.h> // IWYU pragma: export namespace AdHoc { namespace FileUtils { diff --git a/libadhocutil/fprintbf.cpp b/libadhocutil/fprintbf.cpp index db907bd..8bf1c57 100644 --- a/libadhocutil/fprintbf.cpp +++ b/libadhocutil/fprintbf.cpp @@ -1,4 +1,5 @@ #include "fprintbf.h" +#include <cerrno> #include <cstdio> #include <system_error> diff --git a/libadhocutil/fprintbf.h b/libadhocutil/fprintbf.h index 63cba62..8b15d56 100644 --- a/libadhocutil/fprintbf.h +++ b/libadhocutil/fprintbf.h @@ -3,8 +3,11 @@ #include "buffer.h" #include "visibility.h" -#include <boost/format.hpp> +#include <boost/format.hpp> // IWYU pragma: keep +#include <boost/format/format_fwd.hpp> +#include <cstdio> #include <filesystem> +#include <string> DLL_PUBLIC size_t fprintss(FILE *, const std::string &); diff --git a/libadhocutil/globalStatic.impl.h b/libadhocutil/globalStatic.impl.h index ba121d1..fd611c3 100644 --- a/libadhocutil/globalStatic.impl.h +++ b/libadhocutil/globalStatic.impl.h @@ -1,7 +1,7 @@ #ifndef ADHOCUTIL_GLOBALSTATIC_IMPL_H #define ADHOCUTIL_GLOBALSTATIC_IMPL_H -#include "globalStatic.h" +#include "globalStatic.h" // IWYU pragma: export namespace AdHoc { template<typename Object> diff --git a/libadhocutil/lexer-regex.cpp b/libadhocutil/lexer-regex.cpp index 7a490c5..239f953 100644 --- a/libadhocutil/lexer-regex.cpp +++ b/libadhocutil/lexer-regex.cpp @@ -1,4 +1,10 @@ #include "lexer-regex.h" +#include "c++11Helpers.h" +#include <cstddef> +#include <memory> +#include <optional> +#include <stdexcept> +#include <string> namespace AdHoc::LexerMatchers { class Regex : public Lexer::Pattern { diff --git a/libadhocutil/lexer-regex.h b/libadhocutil/lexer-regex.h index 8777418..2a087a3 100644 --- a/libadhocutil/lexer-regex.h +++ b/libadhocutil/lexer-regex.h @@ -1,7 +1,10 @@ #ifndef ADHOCUTIL_LEXER_REGEX_H #define ADHOCUTIL_LEXER_REGEX_H -#include "lexer.h" +#include "glibmm/ustring.h" +#include "lexer.h" // IWYU pragma: export +#include "visibility.h" +#include <glib.h> namespace AdHoc { namespace LexerMatchers { diff --git a/libadhocutil/lexer.cpp b/libadhocutil/lexer.cpp index 6d16a46..1303fd2 100644 --- a/libadhocutil/lexer.cpp +++ b/libadhocutil/lexer.cpp @@ -1,5 +1,7 @@ #include "lexer.h" #include "compileTimeFormatter.h" +#include <stdexcept> +#include <utility> namespace AdHoc { const Lexer::State Lexer::InitialState = ""; diff --git a/libadhocutil/lexer.h b/libadhocutil/lexer.h index 5545525..00c1d69 100644 --- a/libadhocutil/lexer.h +++ b/libadhocutil/lexer.h @@ -3,14 +3,20 @@ #include "c++11Helpers.h" #include "visibility.h" +#include <cstddef> #include <functional> -#include <glibmm/ustring.h> +#include <glib.h> #include <memory> #include <optional> #include <set> +#include <string> #include <tuple> #include <vector> +namespace Glib { + class ustring; +} + namespace AdHoc { /// An extensible lexer. class DLL_PUBLIC Lexer { diff --git a/libadhocutil/memstream.cpp b/libadhocutil/memstream.cpp index 282c5f7..66361cd 100644 --- a/libadhocutil/memstream.cpp +++ b/libadhocutil/memstream.cpp @@ -2,6 +2,7 @@ #include <cerrno> #include <cstdlib> #include <cstring> +#include <memory> #include <sys.h> namespace AdHoc { diff --git a/libadhocutil/nagios.cpp b/libadhocutil/nagios.cpp index 2007e7f..6c1b095 100644 --- a/libadhocutil/nagios.cpp +++ b/libadhocutil/nagios.cpp @@ -1,6 +1,8 @@ #include "nagios.h" -#include "ctf-impl/printf-compat.h" -#include <fstream> +#include "compileTimeFormatter.h" +#include "ctf-impl/printf-compat.h" // IWYU pragma: keep +#include <ctime> +#include <fstream> // IWYU pragma: keep #include <sys/utsname.h> namespace AdHoc { diff --git a/libadhocutil/nagios.h b/libadhocutil/nagios.h index b6b140b..3d51133 100644 --- a/libadhocutil/nagios.h +++ b/libadhocutil/nagios.h @@ -3,6 +3,7 @@ #include "visibility.h" #include <cstdint> +#include <iosfwd> #include <string_view> namespace AdHoc { diff --git a/libadhocutil/plugins.cpp b/libadhocutil/plugins.cpp index 8c8f1b5..000e86d 100644 --- a/libadhocutil/plugins.cpp +++ b/libadhocutil/plugins.cpp @@ -2,13 +2,19 @@ #include "compileTimeFormatter.h" #include "globalStatic.impl.h" #include <boost/multi_index/composite_key.hpp> +#include <boost/multi_index/indexed_by.hpp> #include <boost/multi_index/mem_fun.hpp> #include <boost/multi_index/member.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index_container.hpp> -#include <cstring> +#include <boost/operators.hpp> +#include <cstdlib> #include <cxxabi.h> #include <dlfcn.h> +#include <map> +#include <tuple> +#include <type_traits> +#include <utility> namespace std { bool diff --git a/libadhocutil/plugins.h b/libadhocutil/plugins.h index 3502051..c0f9cf2 100644 --- a/libadhocutil/plugins.h +++ b/libadhocutil/plugins.h @@ -4,13 +4,15 @@ #include "c++11Helpers.h" #include "unique.h" #include "visibility.h" -#include <algorithm> +#include <cstddef> #include <functional> -#include <map> +#include <iosfwd> #include <memory> #include <optional> #include <set> #include <stdexcept> +#include <string> +#include <string_view> #include <typeinfo> namespace std { @@ -160,18 +162,18 @@ namespace AdHoc { * Get a specific plugin. * @param n Name of plugin. */ - template<typename T>[[nodiscard]] std::shared_ptr<const PluginOf<T>> get(const std::string_view & n) const; + template<typename T> [[nodiscard]] std::shared_ptr<const PluginOf<T>> get(const std::string_view & n) const; /** * Get the implementation from specific plugin. * @param n Name of plugin. */ - template<typename T>[[nodiscard]] std::shared_ptr<T> getImplementation(const std::string_view & n) const; + template<typename T> [[nodiscard]] std::shared_ptr<T> getImplementation(const std::string_view & n) const; /** * Get all plugins of a given time. */ - template<typename T>[[nodiscard]] std::set<std::shared_ptr<const PluginOf<T>>> getAll() const; + template<typename T> [[nodiscard]] std::set<std::shared_ptr<const PluginOf<T>>> getAll() const; /** * The number of installed plugins. diff --git a/libadhocutil/plugins.impl.h b/libadhocutil/plugins.impl.h index 7757ea5..d3ce7a2 100644 --- a/libadhocutil/plugins.impl.h +++ b/libadhocutil/plugins.impl.h @@ -1,7 +1,7 @@ #ifndef ADHOCUTIL_PLUGINS_IMPL_H #define ADHOCUTIL_PLUGINS_IMPL_H -#include "plugins.h" +#include "plugins.h" // IWYU pragma: export namespace AdHoc { template<typename T> diff --git a/libadhocutil/processPipes.cpp b/libadhocutil/processPipes.cpp index 59253bc..cc0b017 100644 --- a/libadhocutil/processPipes.cpp +++ b/libadhocutil/processPipes.cpp @@ -1,5 +1,6 @@ #include "processPipes.h" -#include "c++11Helpers.h" +#include <cerrno> +#include <cstdlib> #include <cstring> #include <poll.h> #include <stdexcept> diff --git a/libadhocutil/processPipes.h b/libadhocutil/processPipes.h index 5ccc4c0..130f9a1 100644 --- a/libadhocutil/processPipes.h +++ b/libadhocutil/processPipes.h @@ -1,11 +1,12 @@ #ifndef ADHOCUTIL_PROCESSPIPES_H #define ADHOCUTIL_PROCESSPIPES_H -#include "c++11Helpers.h" #include "handle.h" #include "visibility.h" #include <optional> #include <string> +#include <sys/types.h> +#include <utility> #include <vector> namespace AdHoc { diff --git a/libadhocutil/resourcePool.h b/libadhocutil/resourcePool.h index 17694e8..0b9e0ab 100644 --- a/libadhocutil/resourcePool.h +++ b/libadhocutil/resourcePool.h @@ -5,10 +5,11 @@ #include "exception.h" #include "semaphore.h" #include "visibility.h" -#include <atomic> #include <list> #include <map> +#include <memory> #include <shared_mutex> +#include <string> #include <thread> #include <tuple> diff --git a/libadhocutil/resourcePool.impl.h b/libadhocutil/resourcePool.impl.h index 954a475..9fb9d3a 100644 --- a/libadhocutil/resourcePool.impl.h +++ b/libadhocutil/resourcePool.impl.h @@ -2,7 +2,7 @@ #define ADHOCUTIL_RESOURCEPOOL_IMPL_H #include "lockHelpers.h" -#include "resourcePool.h" +#include "resourcePool.h" // IWYU pragma: export #include "safeMapFind.h" #include <boost/assert.hpp> diff --git a/libadhocutil/scopeExit.cpp b/libadhocutil/scopeExit.cpp index 1eb3511..16e0d09 100644 --- a/libadhocutil/scopeExit.cpp +++ b/libadhocutil/scopeExit.cpp @@ -1,5 +1,5 @@ #include "scopeExit.h" -#include <stdexcept> +#include <exception> namespace AdHoc { diff --git a/libadhocutil/semaphore.cpp b/libadhocutil/semaphore.cpp index b2354c2..163a53b 100644 --- a/libadhocutil/semaphore.cpp +++ b/libadhocutil/semaphore.cpp @@ -1,4 +1,5 @@ #include "semaphore.h" +#include <chrono> namespace AdHoc { Semaphore::Semaphore(unsigned int initial) : count(initial) { } diff --git a/libadhocutil/unittests/testBuffer.cpp b/libadhocutil/unittests/testBuffer.cpp index 6e58120..1457cb3 100644 --- a/libadhocutil/unittests/testBuffer.cpp +++ b/libadhocutil/unittests/testBuffer.cpp @@ -2,6 +2,10 @@ #include <boost/test/unit_test.hpp> #include "buffer.h" +#include <boost/format.hpp> +#include <cstring> +#include <iosfwd> +#include <string> using namespace AdHoc; diff --git a/libadhocutil/unittests/testCache.cpp b/libadhocutil/unittests/testCache.cpp index 8fa384c..2b7f89a 100644 --- a/libadhocutil/unittests/testCache.cpp +++ b/libadhocutil/unittests/testCache.cpp @@ -1,10 +1,13 @@ #define BOOST_TEST_MODULE Cache #include <boost/test/unit_test.hpp> -#include "cache.h" #include "cache.impl.h" -#include <functional> -#include <mutex> +#include <ctime> +#include <memory> +#include <ostream> +#include <string> +#include <unistd.h> +#include <variant> // NOLINTNEXTLINE(hicpp-special-member-functions) class Obj { diff --git a/libadhocutil/unittests/testCaseLess.cpp b/libadhocutil/unittests/testCaseLess.cpp index 9c4dd0b..90d06de 100644 --- a/libadhocutil/unittests/testCaseLess.cpp +++ b/libadhocutil/unittests/testCaseLess.cpp @@ -2,6 +2,8 @@ #include <boost/test/unit_test.hpp> #include <case_less.h> +#include <string> +#include <string_view> BOOST_FIXTURE_TEST_SUITE(l, AdHoc::case_less); diff --git a/libadhocutil/unittests/testCompileTimeFormatter.cpp b/libadhocutil/unittests/testCompileTimeFormatter.cpp index 8dac170..885a961 100644 --- a/libadhocutil/unittests/testCompileTimeFormatter.cpp +++ b/libadhocutil/unittests/testCompileTimeFormatter.cpp @@ -2,11 +2,20 @@ #include <boost/test/unit_test.hpp> #include "memstream.h" +#include <boost/assert.hpp> #include <compileTimeFormatter.h> +#include <cstdint> +#include <cstdio> +#include <cstdlib> +#include <cxxabi.h> #include <definedDirs.h> #include <fileUtils.h> - -#include <filesystem> +#include <locale> +#include <memory> +#include <optional> +#include <string> +#include <string_view> +#include <type_traits> using namespace AdHoc; diff --git a/libadhocutil/unittests/testContext.cpp b/libadhocutil/unittests/testContext.cpp index edc5668..6333ca4 100644 --- a/libadhocutil/unittests/testContext.cpp +++ b/libadhocutil/unittests/testContext.cpp @@ -2,6 +2,7 @@ #include <boost/test/unit_test.hpp> #include "runtimeContext.h" +#include <string> using namespace AdHoc::System; diff --git a/libadhocutil/unittests/testCurl.cpp b/libadhocutil/unittests/testCurl.cpp index 5110c75..c60c242 100644 --- a/libadhocutil/unittests/testCurl.cpp +++ b/libadhocutil/unittests/testCurl.cpp @@ -6,9 +6,16 @@ #include "curlMultiHandle.h" #include "curlStream.h" #include "definedDirs.h" -#include "net.h" #include <boost/algorithm/string/predicate.hpp> +#include <boost/core/typeinfo.hpp> +#include <boost/iostreams/stream.hpp> +#include <cstddef> +#include <filesystem> #include <functional> +#include <map> +#include <net.h> // IWYU pragma: keep +#include <string> +#include <string_view> using namespace AdHoc::Net; diff --git a/libadhocutil/unittests/testException.cpp b/libadhocutil/unittests/testException.cpp index ade3617..bd68bc7 100644 --- a/libadhocutil/unittests/testException.cpp +++ b/libadhocutil/unittests/testException.cpp @@ -2,7 +2,10 @@ #include <boost/test/unit_test.hpp> #include <buffer.h> +#include <cstdlib> #include <exception.h> +#include <stdexcept> +#include <string> using namespace AdHoc; diff --git a/libadhocutil/unittests/testFactory.cpp b/libadhocutil/unittests/testFactory.cpp index d8bcb51..17b220e 100644 --- a/libadhocutil/unittests/testFactory.cpp +++ b/libadhocutil/unittests/testFactory.cpp @@ -1,10 +1,12 @@ #define BOOST_TEST_MODULE Factory #include <boost/test/unit_test.hpp> -#include "factory.h" #include "factory.impl.h" -#include "plugins.h" -#include "plugins.impl.h" +#include <map> +#include <memory> +#include <set> +#include <string> +#include <typeinfo> using namespace AdHoc; diff --git a/libadhocutil/unittests/testFileUtils.cpp b/libadhocutil/unittests/testFileUtils.cpp index d8cf46a..e672951 100644 --- a/libadhocutil/unittests/testFileUtils.cpp +++ b/libadhocutil/unittests/testFileUtils.cpp @@ -1,9 +1,15 @@ #define BOOST_TEST_MODULE FileUtils #include <boost/test/unit_test.hpp> +#include <cerrno> +#include <cstring> #include <definedDirs.h> #include <fileUtils.h> +#include <memory> +#include <string_view> #include <sys.h> +#include <unistd.h> +#include <utility> #define REQUIRE_INVALID_FH(fh) BOOST_REQUIRE_EQUAL(fcntl(fh, F_GETFD), -1) diff --git a/libadhocutil/unittests/testFprintbf.cpp b/libadhocutil/unittests/testFprintbf.cpp index 233a3f7..2cea4ca 100644 --- a/libadhocutil/unittests/testFprintbf.cpp +++ b/libadhocutil/unittests/testFprintbf.cpp @@ -3,6 +3,10 @@ #include "definedDirs.h" #include "fprintbf.h" +#include <boost/format.hpp> +#include <cstdio> +#include <filesystem> +#include <string> #include <system_error> BOOST_AUTO_TEST_CASE(writestring) diff --git a/libadhocutil/unittests/testHandle.cpp b/libadhocutil/unittests/testHandle.cpp index 6fccaa7..c17f7d5 100644 --- a/libadhocutil/unittests/testHandle.cpp +++ b/libadhocutil/unittests/testHandle.cpp @@ -2,8 +2,11 @@ #include <boost/test/unit_test.hpp> #include "handle.h" +#include <cerrno> #include <fcntl.h> #include <type_traits> +#include <unistd.h> +#include <utility> // Test case base on a file handle using T = decltype(STDIN_FILENO); diff --git a/libadhocutil/unittests/testLazyPointer.cpp b/libadhocutil/unittests/testLazyPointer.cpp index df9c257..48f0285 100644 --- a/libadhocutil/unittests/testLazyPointer.cpp +++ b/libadhocutil/unittests/testLazyPointer.cpp @@ -2,6 +2,8 @@ #include <boost/test/unit_test.hpp> #include "lazyPointer.h" +#include <memory> +#include <string> using namespace AdHoc; diff --git a/libadhocutil/unittests/testLexer.cpp b/libadhocutil/unittests/testLexer.cpp index 3484e78..28f98cb 100644 --- a/libadhocutil/unittests/testLexer.cpp +++ b/libadhocutil/unittests/testLexer.cpp @@ -1,8 +1,14 @@ #define BOOST_TEST_MODULE Lexer #include <boost/test/unit_test.hpp> +#include "glibmm/ustring.h" +#include <functional> +#include <glib.h> #include <lexer-regex.h> -#include <lexer.h> +#include <memory> +#include <optional> +#include <stdexcept> +#include <string> using namespace AdHoc; using namespace AdHoc::LexerMatchers; diff --git a/libadhocutil/unittests/testMapFinds.cpp b/libadhocutil/unittests/testMapFinds.cpp index bcbb69e..4b9f642 100644 --- a/libadhocutil/unittests/testMapFinds.cpp +++ b/libadhocutil/unittests/testMapFinds.cpp @@ -6,6 +6,7 @@ #include <map> #include <stdexcept> #include <string> +#include <utility> using namespace AdHoc; diff --git a/libadhocutil/unittests/testMemStream.cpp b/libadhocutil/unittests/testMemStream.cpp index 89e0bf8..0432067 100644 --- a/libadhocutil/unittests/testMemStream.cpp +++ b/libadhocutil/unittests/testMemStream.cpp @@ -3,6 +3,9 @@ #include <boost/test/unit_test.hpp> #include "memstream.h" +#include <cstdio> +#include <string_view> +#include <utility> using namespace AdHoc; diff --git a/libadhocutil/unittests/testNagios.cpp b/libadhocutil/unittests/testNagios.cpp index 0af6b25..ab0cdea 100644 --- a/libadhocutil/unittests/testNagios.cpp +++ b/libadhocutil/unittests/testNagios.cpp @@ -1,6 +1,7 @@ #define BOOST_TEST_MODULE Nagios #include <boost/test/unit_test.hpp> +#include <iosfwd> #include <nagios.h> /// LCOV_EXCL_START (calls real Nagios) diff --git a/libadhocutil/unittests/testNvpParse.cpp b/libadhocutil/unittests/testNvpParse.cpp index fa955e1..ef148f5 100644 --- a/libadhocutil/unittests/testNvpParse.cpp +++ b/libadhocutil/unittests/testNvpParse.cpp @@ -2,6 +2,11 @@ #include <boost/test/unit_test.hpp> #include "nvpParse.h" +#include <iosfwd> +#include <map> +#include <memory> +#include <stdexcept> +#include <string> using namespace AdHoc; diff --git a/libadhocutil/unittests/testOptionals.cpp b/libadhocutil/unittests/testOptionals.cpp index 600c972..6680558 100644 --- a/libadhocutil/unittests/testOptionals.cpp +++ b/libadhocutil/unittests/testOptionals.cpp @@ -1,10 +1,11 @@ #define BOOST_TEST_MODULE Buffer #include <boost/test/unit_test.hpp> -#include <Ice/Exception.h> #include <Ice/Optional.h> #include <optional> #include <optionalUtils.h> +#include <string> +#include <type_traits> using namespace AdHoc; diff --git a/libadhocutil/unittests/testPlugins.cpp b/libadhocutil/unittests/testPlugins.cpp index a05469e..a93b5fc 100644 --- a/libadhocutil/unittests/testPlugins.cpp +++ b/libadhocutil/unittests/testPlugins.cpp @@ -1,9 +1,10 @@ #define BOOST_TEST_MODULE Plugins #include <boost/test/unit_test.hpp> -#include "plugins.h" #include "plugins.impl.h" #include "utilTestClasses.h" +#include <memory> +#include <set> using namespace AdHoc; diff --git a/libadhocutil/unittests/testPluginsRuntime.cpp b/libadhocutil/unittests/testPluginsRuntime.cpp index 7836ed5..a558910 100644 --- a/libadhocutil/unittests/testPluginsRuntime.cpp +++ b/libadhocutil/unittests/testPluginsRuntime.cpp @@ -1,11 +1,16 @@ #define BOOST_TEST_MODULE Plugins #include <boost/test/unit_test.hpp> -#include "plugins.h" #include "plugins.impl.h" #include "utilTestClasses.h" -#include <definedDirs.h> #include <dlfcn.h> +#include <filesystem> +#include <memory> +#include <optional> +#include <set> +#include <string> +#include <string_view> +#include <typeinfo> using namespace AdHoc; diff --git a/libadhocutil/unittests/testProcessPipes.cpp b/libadhocutil/unittests/testProcessPipes.cpp index 6251022..0fd3a26 100644 --- a/libadhocutil/unittests/testProcessPipes.cpp +++ b/libadhocutil/unittests/testProcessPipes.cpp @@ -3,7 +3,13 @@ #include "definedDirs.h" #include "processPipes.h" +#include <cstdio> +#include <cstring> +#include <filesystem> +#include <stdexcept> +#include <string> #include <sys/wait.h> +#include <unistd.h> using namespace AdHoc::System; diff --git a/libadhocutil/unittests/testResourcePool.cpp b/libadhocutil/unittests/testResourcePool.cpp index d11c0d0..08f6caf 100644 --- a/libadhocutil/unittests/testResourcePool.cpp +++ b/libadhocutil/unittests/testResourcePool.cpp @@ -1,7 +1,20 @@ #define BOOST_TEST_MODULE ResourcePool #include <boost/test/unit_test.hpp> +#include "c++11Helpers.h" // for SPECIAL_MEMBERS_DELETE +#include "lockHelpers.h" // for ScopeLock +#include "semaphore.h" // for Semaphore +#include <atomic> // for atomic, __atomic_base +#include <list> // for list, operator==, _List_iterator +#include <map> // for operator== +#include <memory> // for make_shared, shared_ptr +#include <mutex> // for unique_lock, mutex #include <resourcePool.impl.h> +#include <stdexcept> // for exception +#include <thread> // for thread, get_id +#include <tuple> // for get +#include <unistd.h> // for usleep, sleep +#include <utility> // for move class MockResource { public: diff --git a/libadhocutil/unittests/testScopeExit.cpp b/libadhocutil/unittests/testScopeExit.cpp index edb8f99..97aac8a 100644 --- a/libadhocutil/unittests/testScopeExit.cpp +++ b/libadhocutil/unittests/testScopeExit.cpp @@ -2,6 +2,7 @@ #include <boost/test/unit_test.hpp> #include "scopeExit.h" +#include <stdexcept> #include <string> using namespace AdHoc; diff --git a/libadhocutil/unittests/testSemaphore.cpp b/libadhocutil/unittests/testSemaphore.cpp index e2cdb7a..fcc6578 100644 --- a/libadhocutil/unittests/testSemaphore.cpp +++ b/libadhocutil/unittests/testSemaphore.cpp @@ -3,6 +3,7 @@ #include <semaphore.h> #include <thread> +#include <unistd.h> BOOST_AUTO_TEST_CASE(addRemoveOne) { diff --git a/libadhocutil/unittests/testUriParse.cpp b/libadhocutil/unittests/testUriParse.cpp index 5e54e46..113df94 100644 --- a/libadhocutil/unittests/testUriParse.cpp +++ b/libadhocutil/unittests/testUriParse.cpp @@ -2,6 +2,12 @@ #include <boost/test/unit_test.hpp> #include "uriParse.h" +#include <iterator> +#include <map> +#include <optional> +#include <string> +#include <typeinfo> +#include <utility> BOOST_AUTO_TEST_CASE(simple) { diff --git a/libadhocutil/unittests/utilTestClasses.cpp b/libadhocutil/unittests/utilTestClasses.cpp index 4ae241c..d42b9aa 100644 --- a/libadhocutil/unittests/utilTestClasses.cpp +++ b/libadhocutil/unittests/utilTestClasses.cpp @@ -2,3 +2,4 @@ #include "plugins.impl.h" PLUGIN(ImplOfThing, BaseThing); +INSTANTIATEPLUGINOF(BaseThing); diff --git a/libadhocutil/uriParse.cpp b/libadhocutil/uriParse.cpp index df19abc..489747e 100644 --- a/libadhocutil/uriParse.cpp +++ b/libadhocutil/uriParse.cpp @@ -2,6 +2,9 @@ #include "compileTimeFormatter.h" #include <boost/algorithm/string/case_conv.hpp> #include <boost/lexical_cast.hpp> +#include <cctype> +#include <cstdint> +#include <cstring> #include <utility> namespace AdHoc { diff --git a/libadhocutil/uriParse.h b/libadhocutil/uriParse.h index 7c1ffb7..2ada3df 100644 --- a/libadhocutil/uriParse.h +++ b/libadhocutil/uriParse.h @@ -3,9 +3,11 @@ #include "exception.h" #include "visibility.h" +#include <cstdint> #include <filesystem> #include <map> #include <optional> +#include <stdexcept> #include <string> namespace AdHoc { |