summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2024-03-20 23:38:04 +0300
committerEd Tanous <ed@tanous.net>2024-03-28 06:35:52 +0300
commitf0b59af46a6aa84890d2181b08d4e1af5ce5002f (patch)
tree446e1ed998ede11cbad0faa93a65c727eb6bb3df /test
parent5a8b641229ad1b1c14ae10b7772e5361503675c7 (diff)
downloadbmcweb-f0b59af46a6aa84890d2181b08d4e1af5ce5002f.tar.xz
Add misc-include-cleaner
And fix the includes that are wrong. Note, there is a very large ignore list included in the .clang-tidy configcfile. These are things that clang-tidy doesn't yet handle well, like knowing about a details include. Change-Id: Ie3744f2c8cba68a8700b406449d6c2018a736952 Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'test')
-rw-r--r--test/http/crow_getroutes_test.cpp5
-rw-r--r--test/http/http2_connection_test.cpp12
-rw-r--r--test/http/http_body_test.cpp4
-rw-r--r--test/http/http_connection_test.cpp9
-rw-r--r--test/http/http_response_test.cpp11
-rw-r--r--test/http/mutual_tls.cpp12
-rw-r--r--test/http/mutual_tls_meta.cpp4
-rw-r--r--test/http/server_sent_event_test.cpp8
-rw-r--r--test/http/utility_test.cpp10
-rw-r--r--test/include/async_resolve_test.cpp2
-rw-r--r--test/include/credential_pipe_test.cpp7
-rw-r--r--test/include/google/google_service_root_test.cpp5
-rw-r--r--test/include/http_utility_test.cpp2
-rw-r--r--test/include/ibm/lock_test.cpp1
-rw-r--r--test/include/multipart_test.cpp3
-rw-r--r--test/include/ossl_random.cpp2
-rw-r--r--test/redfish-core/include/redfish_aggregator_test.cpp9
-rw-r--r--test/redfish-core/include/utils/hex_utils_test.cpp2
-rw-r--r--test/redfish-core/include/utils/ip_utils_test.cpp4
-rw-r--r--test/redfish-core/include/utils/json_utils_test.cpp1
-rw-r--r--test/redfish-core/include/utils/query_param_test.cpp10
-rw-r--r--test/redfish-core/include/utils/stl_utils_test.cpp1
-rw-r--r--test/redfish-core/include/utils/time_utils_test.cpp6
-rw-r--r--test/redfish-core/lib/chassis_test.cpp5
-rw-r--r--test/redfish-core/lib/log_services_dump_test.cpp8
-rw-r--r--test/redfish-core/lib/log_services_test.cpp6
-rw-r--r--test/redfish-core/lib/manager_diagnostic_data_test.cpp5
-rw-r--r--test/redfish-core/lib/power_subsystem_test.cpp2
-rw-r--r--test/redfish-core/lib/service_root_test.cpp1
-rw-r--r--test/redfish-core/lib/system_test.cpp11
-rw-r--r--test/redfish-core/lib/thermal_subsystem_test.cpp2
-rw-r--r--test/redfish-core/lib/update_service_test.cpp3
32 files changed, 131 insertions, 42 deletions
diff --git a/test/http/crow_getroutes_test.cpp b/test/http/crow_getroutes_test.cpp
index e5c9d6eb7e..0c3f8de608 100644
--- a/test/http/crow_getroutes_test.cpp
+++ b/test/http/crow_getroutes_test.cpp
@@ -1,7 +1,6 @@
#include "app.hpp"
-#include "routing.hpp"
-
-#include <boost/beast/http/status.hpp>
+#include "async_resp.hpp"
+#include "http_request.hpp"
#include <memory>
diff --git a/test/http/http2_connection_test.cpp b/test/http/http2_connection_test.cpp
index 7d6572cb1c..dc71ef3d73 100644
--- a/test/http/http2_connection_test.cpp
+++ b/test/http/http2_connection_test.cpp
@@ -1,13 +1,21 @@
+#include "async_resp.hpp"
#include "http/http2_connection.hpp"
#include "http/http_request.hpp"
#include "http/http_response.hpp"
+#include <nghttp2/nghttp2.h>
+#include <unistd.h>
+
+#include <boost/asio/buffer.hpp>
+#include <boost/asio/impl/write.hpp>
+#include <boost/asio/io_context.hpp>
#include <boost/asio/steady_timer.hpp>
#include <boost/beast/_experimental/test/stream.hpp>
+#include <boost/beast/http/field.hpp>
#include <bit>
-#include <filesystem>
-#include <fstream>
+#include <cstddef>
+#include <cstdint>
#include <functional>
#include <memory>
#include <string>
diff --git a/test/http/http_body_test.cpp b/test/http/http_body_test.cpp
index 6367cf9409..0983c1d815 100644
--- a/test/http/http_body_test.cpp
+++ b/test/http/http_body_test.cpp
@@ -1,11 +1,15 @@
#include "file_test_utilities.hpp"
#include "http_body.hpp"
+#include <boost/beast/core/file_base.hpp>
#include <boost/system/error_code.hpp>
#include <array>
+#include <cstddef>
+#include <cstdio>
#include <span>
#include <string>
+#include <utility>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/test/http/http_connection_test.cpp b/test/http/http_connection_test.cpp
index 6647e61d99..4dda70ecf8 100644
--- a/test/http/http_connection_test.cpp
+++ b/test/http/http_connection_test.cpp
@@ -1,15 +1,20 @@
+#include "async_resp.hpp"
#include "http/http_connection.hpp"
#include "http/http_request.hpp"
#include "http/http_response.hpp"
+#include <boost/asio/buffer.hpp>
+#include <boost/asio/io_context.hpp>
#include <boost/asio/steady_timer.hpp>
#include <boost/beast/_experimental/test/stream.hpp>
+#include <boost/beast/http/field.hpp>
+#include <boost/beast/http/verb.hpp>
-#include <filesystem>
-#include <fstream>
+#include <chrono>
#include <functional>
#include <memory>
#include <string>
+#include <utility>
#include "gtest/gtest.h"
namespace crow
diff --git a/test/http/http_response_test.cpp b/test/http/http_response_test.cpp
index 457cd7a924..d0836a2bab 100644
--- a/test/http/http_response_test.cpp
+++ b/test/http/http_response_test.cpp
@@ -1,13 +1,18 @@
#include "boost/beast/core/buffers_to_string.hpp"
-#include "boost/beast/core/flat_buffer.hpp"
#include "boost/beast/http/serializer.hpp"
#include "file_test_utilities.hpp"
#include "http/http_body.hpp"
#include "http/http_response.hpp"
+#include "utility.hpp"
+#include <boost/beast/core/file_base.hpp>
+#include <boost/beast/core/file_posix.hpp>
+#include <boost/beast/http/message.hpp>
+#include <boost/beast/http/status.hpp>
+
+#include <cstdio>
#include <filesystem>
-#include <fstream>
-#include <thread>
+#include <string>
#include "gtest/gtest.h"
namespace
diff --git a/test/http/mutual_tls.cpp b/test/http/mutual_tls.cpp
index 7b5cb25acd..be8b65102f 100644
--- a/test/http/mutual_tls.cpp
+++ b/test/http/mutual_tls.cpp
@@ -1,8 +1,20 @@
#include "mutual_tls.hpp"
+#include "sessions.hpp"
+
+#include <openssl/asn1.h>
+#include <openssl/ec.h>
+#include <openssl/evp.h>
+#include <openssl/obj_mac.h>
+#include <openssl/types.h>
+#include <openssl/x509.h>
+#include <openssl/x509_vfy.h>
+#include <openssl/x509v3.h>
+
#include <boost/asio/ip/address.hpp>
#include <boost/asio/ssl/verify_context.hpp>
+#include <array>
#include <memory>
#include <gmock/gmock.h>
diff --git a/test/http/mutual_tls_meta.cpp b/test/http/mutual_tls_meta.cpp
index 5f32cb54a1..0e280c10c9 100644
--- a/test/http/mutual_tls_meta.cpp
+++ b/test/http/mutual_tls_meta.cpp
@@ -1,5 +1,9 @@
#include "http/mutual_tls_meta.hpp"
+#include <optional>
+#include <string>
+#include <vector>
+
#include <gtest/gtest.h> // IWYU pragma: keep
namespace redfish
diff --git a/test/http/server_sent_event_test.cpp b/test/http/server_sent_event_test.cpp
index d3f9403364..3e740cb525 100644
--- a/test/http/server_sent_event_test.cpp
+++ b/test/http/server_sent_event_test.cpp
@@ -1,15 +1,15 @@
#include "boost/asio/read.hpp"
-#include "boost/asio/read_until.hpp"
-#include "http/http_request.hpp"
-#include "http/http_response.hpp"
#include "http/server_sent_event.hpp"
-#include <boost/asio/steady_timer.hpp>
+#include <boost/asio/buffer.hpp>
+#include <boost/asio/io_context.hpp>
#include <boost/beast/_experimental/test/stream.hpp>
+#include <chrono>
#include <memory>
#include <string>
#include <string_view>
+#include <utility>
#include "gtest/gtest.h"
namespace crow
diff --git a/test/http/utility_test.cpp b/test/http/utility_test.cpp
index c0b6412af2..20af871516 100644
--- a/test/http/utility_test.cpp
+++ b/test/http/utility_test.cpp
@@ -1,16 +1,16 @@
-#include "bmcweb_config.h"
#include "utility.hpp"
-#include <boost/url/error.hpp>
+#include <bits/basic_string.h>
+
+#include <boost/system/result.hpp>
+#include <boost/url/parse.hpp>
#include <boost/url/url.hpp>
#include <boost/url/url_view.hpp>
-#include <nlohmann/json.hpp>
-#include <cstdint>
+#include <algorithm>
#include <ctime>
#include <functional>
-#include <limits>
#include <string>
#include <string_view>
diff --git a/test/include/async_resolve_test.cpp b/test/include/async_resolve_test.cpp
index be1e8a34d2..d07dc1bffc 100644
--- a/test/include/async_resolve_test.cpp
+++ b/test/include/async_resolve_test.cpp
@@ -2,7 +2,7 @@
#include <boost/asio/ip/tcp.hpp>
-#include <gmock/gmock.h>
+#include <gtest/gtest.h>
TEST(AsyncResolve, ipv4Positive)
{
diff --git a/test/include/credential_pipe_test.cpp b/test/include/credential_pipe_test.cpp
index c5b544bc0c..0c722222da 100644
--- a/test/include/credential_pipe_test.cpp
+++ b/test/include/credential_pipe_test.cpp
@@ -1,11 +1,18 @@
#include "credential_pipe.hpp"
+#include <unistd.h>
+
#include <boost/asio/io_context.hpp>
#include <boost/beast/core/file_posix.hpp>
+#include <boost/system/detail/error_code.hpp>
+#include <array>
+#include <cstddef>
+#include <functional>
#include <string>
#include <gmock/gmock.h>
+#include <gtest/gtest.h>
using ::testing::ElementsAre;
diff --git a/test/include/google/google_service_root_test.cpp b/test/include/google/google_service_root_test.cpp
index 88b40d71db..daeb657bfd 100644
--- a/test/include/google/google_service_root_test.cpp
+++ b/test/include/google/google_service_root_test.cpp
@@ -1,9 +1,14 @@
#include "async_resp.hpp"
#include "google/google_service_root.hpp"
#include "http_request.hpp"
+#include "http_response.hpp"
+#include <boost/beast/http/verb.hpp>
#include <nlohmann/json.hpp>
+#include <memory>
+#include <system_error>
+
#include <gtest/gtest.h>
namespace crow::google_api
diff --git a/test/include/http_utility_test.cpp b/test/include/http_utility_test.cpp
index 915b168b49..d2060c16fb 100644
--- a/test/include/http_utility_test.cpp
+++ b/test/include/http_utility_test.cpp
@@ -1,5 +1,7 @@
#include "http_utility.hpp"
+#include <array>
+
#include <gtest/gtest.h> // IWYU pragma: keep
// IWYU pragma: no_include <gtest/gtest-message.h>
diff --git a/test/include/ibm/lock_test.cpp b/test/include/ibm/lock_test.cpp
index 327ce6869c..087a84b431 100644
--- a/test/include/ibm/lock_test.cpp
+++ b/test/include/ibm/lock_test.cpp
@@ -1,7 +1,6 @@
#include "ibm/locks.hpp"
#include <cstdint>
-#include <memory>
#include <string>
#include <tuple>
#include <utility>
diff --git a/test/include/multipart_test.cpp b/test/include/multipart_test.cpp
index 0ac201f100..59e8345755 100644
--- a/test/include/multipart_test.cpp
+++ b/test/include/multipart_test.cpp
@@ -2,9 +2,8 @@
#include "multipart_parser.hpp"
#include <boost/beast/http/fields.hpp>
-#include <boost/beast/http/message.hpp>
-#include <memory>
+#include <iterator>
#include <string_view>
#include <system_error>
#include <vector>
diff --git a/test/include/ossl_random.cpp b/test/include/ossl_random.cpp
index 22935e7d1c..512b5c8f83 100644
--- a/test/include/ossl_random.cpp
+++ b/test/include/ossl_random.cpp
@@ -1,7 +1,5 @@
#include "ossl_random.hpp"
-#include <string>
-
#include <gmock/gmock.h> // IWYU pragma: keep
#include <gtest/gtest.h> // IWYU pragma: keep
diff --git a/test/redfish-core/include/redfish_aggregator_test.cpp b/test/redfish-core/include/redfish_aggregator_test.cpp
index d3c819fcc4..6986dcf00c 100644
--- a/test/redfish-core/include/redfish_aggregator_test.cpp
+++ b/test/redfish-core/include/redfish_aggregator_test.cpp
@@ -1,8 +1,17 @@
#include "async_resp.hpp"
+#include "error_messages.hpp"
+#include "http_response.hpp"
#include "redfish_aggregator.hpp"
+#include <boost/beast/http/field.hpp>
+#include <boost/beast/http/status.hpp>
#include <nlohmann/json.hpp>
+#include <array>
+#include <memory>
+#include <string>
+#include <utility>
+
#include <gtest/gtest.h> // IWYU pragma: keep
namespace redfish
diff --git a/test/redfish-core/include/utils/hex_utils_test.cpp b/test/redfish-core/include/utils/hex_utils_test.cpp
index c80158a663..a4ff5b781e 100644
--- a/test/redfish-core/include/utils/hex_utils_test.cpp
+++ b/test/redfish-core/include/utils/hex_utils_test.cpp
@@ -1,7 +1,9 @@
#include "utils/hex_utils.hpp"
#include <cctype>
+#include <cstdint>
#include <limits>
+#include <vector>
#include <gmock/gmock.h> // IWYU pragma: keep
#include <gtest/gtest.h> // IWYU pragma: keep
diff --git a/test/redfish-core/include/utils/ip_utils_test.cpp b/test/redfish-core/include/utils/ip_utils_test.cpp
index e8b7ac9dd5..67cacc0f69 100644
--- a/test/redfish-core/include/utils/ip_utils_test.cpp
+++ b/test/redfish-core/include/utils/ip_utils_test.cpp
@@ -1,5 +1,9 @@
#include "utils/ip_utils.hpp"
+#include <boost/asio/ip/address.hpp>
+
+#include <cstdint>
+
#include <gtest/gtest.h> // IWYU pragma: keep
// IWYU pragma: no_include <gtest/gtest-message.h>
diff --git a/test/redfish-core/include/utils/json_utils_test.cpp b/test/redfish-core/include/utils/json_utils_test.cpp
index ad4d80538d..9245f25d87 100644
--- a/test/redfish-core/include/utils/json_utils_test.cpp
+++ b/test/redfish-core/include/utils/json_utils_test.cpp
@@ -2,6 +2,7 @@
#include "http_response.hpp"
#include "utils/json_utils.hpp"
+#include <boost/beast/http/field.hpp>
#include <boost/beast/http/status.hpp>
#include <nlohmann/json.hpp>
diff --git a/test/redfish-core/include/utils/query_param_test.cpp b/test/redfish-core/include/utils/query_param_test.cpp
index c5ae21f1d2..46cc64d003 100644
--- a/test/redfish-core/include/utils/query_param_test.cpp
+++ b/test/redfish-core/include/utils/query_param_test.cpp
@@ -1,13 +1,21 @@
#include "bmcweb_config.h"
+#include "error_messages.hpp"
+#include "http_response.hpp"
#include "utils/query_param.hpp"
+#include <boost/beast/http/status.hpp>
#include <boost/system/result.hpp>
+#include <boost/url/parse.hpp>
#include <boost/url/url_view.hpp>
#include <nlohmann/json.hpp>
-#include <new>
+#include <array>
+#include <optional>
#include <span>
+#include <string>
+#include <utility>
+#include <vector>
#include <gmock/gmock.h> // IWYU pragma: keep
#include <gtest/gtest.h> // IWYU pragma: keep
diff --git a/test/redfish-core/include/utils/stl_utils_test.cpp b/test/redfish-core/include/utils/stl_utils_test.cpp
index f1febd088d..d8c0a1c219 100644
--- a/test/redfish-core/include/utils/stl_utils_test.cpp
+++ b/test/redfish-core/include/utils/stl_utils_test.cpp
@@ -1,6 +1,7 @@
#include "utils/stl_utils.hpp"
#include <string>
+#include <vector>
#include <gmock/gmock.h> // IWYU pragma: keep
#include <gtest/gtest.h> // IWYU pragma: keep
diff --git a/test/redfish-core/include/utils/time_utils_test.cpp b/test/redfish-core/include/utils/time_utils_test.cpp
index e88f7580d4..a1ae058b6f 100644
--- a/test/redfish-core/include/utils/time_utils_test.cpp
+++ b/test/redfish-core/include/utils/time_utils_test.cpp
@@ -1,5 +1,11 @@
#include "utils/time_utils.hpp"
+#include <chrono>
+#include <cstdint>
+#include <ctime>
+#include <limits>
+#include <optional>
+
#include <gmock/gmock.h> // IWYU pragma: keep
#include <gtest/gtest.h> // IWYU pragma: keep
diff --git a/test/redfish-core/lib/chassis_test.cpp b/test/redfish-core/lib/chassis_test.cpp
index 45d06ae8aa..59e21dd26e 100644
--- a/test/redfish-core/lib/chassis_test.cpp
+++ b/test/redfish-core/lib/chassis_test.cpp
@@ -6,9 +6,14 @@
#include <boost/beast/core/string_type.hpp>
#include <boost/beast/http/message.hpp>
+#include <boost/beast/http/verb.hpp>
#include <nlohmann/json.hpp>
+#include <functional>
+#include <memory>
+#include <string>
#include <system_error>
+#include <utility>
#include <gtest/gtest.h>
diff --git a/test/redfish-core/lib/log_services_dump_test.cpp b/test/redfish-core/lib/log_services_dump_test.cpp
index 2a6333b6b2..ce7a3a9cd4 100644
--- a/test/redfish-core/lib/log_services_dump_test.cpp
+++ b/test/redfish-core/lib/log_services_dump_test.cpp
@@ -1,12 +1,10 @@
-#include "app.hpp"
#include "async_resp.hpp"
-#include "event_service_manager.hpp"
-#include "health.hpp"
#include "log_services.hpp"
-#include <nlohmann/json.hpp>
+#include <boost/beast/http/status.hpp>
+
+#include <memory>
-#include <gmock/gmock.h>
#include <gtest/gtest.h>
namespace redfish
diff --git a/test/redfish-core/lib/log_services_test.cpp b/test/redfish-core/lib/log_services_test.cpp
index 4f7bedb72f..631e3d159f 100644
--- a/test/redfish-core/lib/log_services_test.cpp
+++ b/test/redfish-core/lib/log_services_test.cpp
@@ -1,15 +1,13 @@
-#include "app.hpp"
#include "async_resp.hpp"
#include "log_services.hpp"
#include <systemd/sd-id128.h>
-#include <nlohmann/json.hpp>
-
+#include <cstdint>
#include <format>
+#include <memory>
#include <string>
-#include <gmock/gmock.h>
#include <gtest/gtest.h>
namespace redfish
diff --git a/test/redfish-core/lib/manager_diagnostic_data_test.cpp b/test/redfish-core/lib/manager_diagnostic_data_test.cpp
index b59842ab57..c10bd57c53 100644
--- a/test/redfish-core/lib/manager_diagnostic_data_test.cpp
+++ b/test/redfish-core/lib/manager_diagnostic_data_test.cpp
@@ -1,8 +1,13 @@
#include "async_resp.hpp"
#include "manager_diagnostic_data.hpp"
+#include <boost/asio/error.hpp>
+#include <boost/beast/http/status.hpp>
+#include <boost/system/linux_error.hpp>
#include <nlohmann/json.hpp>
+#include <cstdint>
+#include <limits>
#include <memory>
#include <gtest/gtest.h>
diff --git a/test/redfish-core/lib/power_subsystem_test.cpp b/test/redfish-core/lib/power_subsystem_test.cpp
index 1dfbbeb3ff..39ec3118d5 100644
--- a/test/redfish-core/lib/power_subsystem_test.cpp
+++ b/test/redfish-core/lib/power_subsystem_test.cpp
@@ -1,8 +1,10 @@
#include "async_resp.hpp"
+#include "http_response.hpp"
#include "power_subsystem.hpp"
#include <nlohmann/json.hpp>
+#include <memory>
#include <optional>
#include <string>
diff --git a/test/redfish-core/lib/service_root_test.cpp b/test/redfish-core/lib/service_root_test.cpp
index 78c068d760..3d47221041 100644
--- a/test/redfish-core/lib/service_root_test.cpp
+++ b/test/redfish-core/lib/service_root_test.cpp
@@ -7,7 +7,6 @@
#include <nlohmann/json.hpp>
#include <memory>
-#include <vector>
#include <gmock/gmock.h> // IWYU pragma: keep
#include <gtest/gtest.h> // IWYU pragma: keep
diff --git a/test/redfish-core/lib/system_test.cpp b/test/redfish-core/lib/system_test.cpp
index 481c0df746..0becca8956 100644
--- a/test/redfish-core/lib/system_test.cpp
+++ b/test/redfish-core/lib/system_test.cpp
@@ -1,17 +1,16 @@
-#include "app.hpp"
#include "async_resp.hpp"
-#include "http_request.hpp"
+#include "generated/enums/resource.hpp"
#include "http_response.hpp"
#include "systems.hpp"
-#include <boost/beast/core/string_type.hpp>
-#include <boost/beast/http/message.hpp>
-#include <boost/system/error_code.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/beast/http/status.hpp>
+#include <boost/system/linux_error.hpp>
#include <nlohmann/json.hpp>
#include <memory>
#include <string>
-#include <system_error>
+#include <utility>
#include <vector>
#include <gtest/gtest.h>
diff --git a/test/redfish-core/lib/thermal_subsystem_test.cpp b/test/redfish-core/lib/thermal_subsystem_test.cpp
index 305e29aeee..35df514c59 100644
--- a/test/redfish-core/lib/thermal_subsystem_test.cpp
+++ b/test/redfish-core/lib/thermal_subsystem_test.cpp
@@ -1,8 +1,10 @@
#include "async_resp.hpp"
+#include "http_response.hpp"
#include "thermal_subsystem.hpp"
#include <nlohmann/json.hpp>
+#include <memory>
#include <optional>
#include <string>
diff --git a/test/redfish-core/lib/update_service_test.cpp b/test/redfish-core/lib/update_service_test.cpp
index 6b90aef416..d56d709f5f 100644
--- a/test/redfish-core/lib/update_service_test.cpp
+++ b/test/redfish-core/lib/update_service_test.cpp
@@ -1,6 +1,9 @@
+#include "http_response.hpp"
#include "update_service.hpp"
+#include <optional>
+
#include <gtest/gtest.h>
namespace redfish