summaryrefslogtreecommitdiff
path: root/http/ut
diff options
context:
space:
mode:
authorNan Zhou <nanzhoumails@gmail.com>2022-07-11 04:16:31 +0300
committerEd Tanous <ed@tanous.net>2022-07-23 18:17:11 +0300
commitd5c80ad9c07b94465d8ea62d2b6f87c30cac765e (patch)
tree7400b044cbca9299807facb5ab61b333a585d1b7 /http/ut
parent0d7702c0246c5948caf12a3e441f74952c7d0ccf (diff)
downloadbmcweb-d5c80ad9c07b94465d8ea62d2b6f87c30cac765e.tar.xz
test treewide: iwyu
These changes are done by running iwyu manually under clang14. Suppressed some obvious impl or details headers. Kept the recommended public headers. IWYU can increase readability, make maintenance easier, and avoid errors in some cases. See details in https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md. This commit also uses its best effort to correct obvious errors through iwyu pragma. See reference here: https://github.com/include-what-you-use/include-what-you-use#how-to-correct-iwyu-mistakes Tested: unit test passed. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I983b6f75601707cbb0f2f04546c3362ff4ba7fee
Diffstat (limited to 'http/ut')
-rw-r--r--http/ut/router_test.cpp12
-rw-r--r--http/ut/utility_test.cpp5
2 files changed, 14 insertions, 3 deletions
diff --git a/http/ut/router_test.cpp b/http/ut/router_test.cpp
index a08a8109c8..4d1a7442c9 100644
--- a/http/ut/router_test.cpp
+++ b/http/ut/router_test.cpp
@@ -1,8 +1,9 @@
-#include "async_resp.hpp"
+#include "async_resp.hpp" // IWYU pragma: keep
#include "http_request.hpp"
#include "routing.hpp"
#include "utility.hpp"
+#include <boost/beast/http/message.hpp> // IWYU pragma: keep
#include <boost/beast/http/verb.hpp>
#include <memory>
@@ -10,7 +11,14 @@
#include <string_view>
#include <system_error>
-#include <gtest/gtest.h>
+#include <gtest/gtest.h> // IWYU pragma: keep
+
+// IWYU pragma: no_include <boost/beast/http/impl/message.hpp>
+// IWYU pragma: no_include "gtest/gtest_pred_impl.h"
+// IWYU pragma: no_include <boost/intrusive/detail/list_iterator.hpp>
+// IWYU pragma: no_include <gtest/gtest-message.h>
+// IWYU pragma: no_include <gtest/gtest-test-part.h>
+// IWYU pragma: no_forward_declare bmcweb::AsyncResp
namespace crow
{
diff --git a/http/ut/utility_test.cpp b/http/ut/utility_test.cpp
index 23e8ae34a2..c774996283 100644
--- a/http/ut/utility_test.cpp
+++ b/http/ut/utility_test.cpp
@@ -14,7 +14,10 @@
#include <string>
#include <string_view>
-#include <gtest/gtest.h>
+#include <gtest/gtest.h> // IWYU pragma: keep
+// IWYU pragma: no_include <gtest/gtest-message.h>
+// IWYU pragma: no_include <gtest/gtest-test-part.h>
+// IWYU pragma: no_include "gtest/gtest_pred_impl.h"
namespace crow::utility
{