diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-08-27 11:14:38 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-08-27 11:40:40 +0200 |
commit | bc39ecc0385dd7e0cb9e1df84628e4c6dde34ab5 (patch) | |
tree | 4556b3f5f5898ef56316fc1612a04402b79903ef /test | |
parent | 340f3478dc2bffe1a75496e5c120e88274fee698 (diff) | |
download | justbuild-bc39ecc0385dd7e0cb9e1df84628e4c6dde34ab5.tar.gz |
Reformat code to comply with clang-format 18
... while keeping our .clang-format file.
Diffstat (limited to 'test')
52 files changed, 169 insertions, 85 deletions
diff --git a/test/buildtool/build_engine/base_maps/directory_map.test.cpp b/test/buildtool/build_engine/base_maps/directory_map.test.cpp index d001f50e..b59c4ff0 100644 --- a/test/buildtool/build_engine/base_maps/directory_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/directory_map.test.cpp @@ -12,13 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/build_engine/base_maps/directory_map.hpp" + #include <filesystem> #include <memory> #include <string> #include <utility> // std::move #include "catch2/catch_test_macros.hpp" -#include "src/buildtool/build_engine/base_maps/directory_map.hpp" #include "src/buildtool/build_engine/base_maps/module_name.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/file_system/file_root.hpp" diff --git a/test/buildtool/build_engine/base_maps/entity_name.test.cpp b/test/buildtool/build_engine/base_maps/entity_name.test.cpp index 223de0fc..be88f017 100644 --- a/test/buildtool/build_engine/base_maps/entity_name.test.cpp +++ b/test/buildtool/build_engine/base_maps/entity_name.test.cpp @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/base_maps/entity_name.hpp" +#include "catch2/catch_test_macros.hpp" + TEST_CASE("Normal module names") { using NT = BuildMaps::Base::NamedTarget; CHECK(NT::normal_module_name("foo/bar") == "foo/bar"); diff --git a/test/buildtool/build_engine/base_maps/expression_map.test.cpp b/test/buildtool/build_engine/base_maps/expression_map.test.cpp index 21cf1e50..04d5b86e 100644 --- a/test/buildtool/build_engine/base_maps/expression_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/expression_map.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/build_engine/base_maps/expression_map.hpp" + #include <filesystem> #include <functional> #include <memory> @@ -20,7 +22,6 @@ #include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/base_maps/entity_name_data.hpp" -#include "src/buildtool/build_engine/base_maps/expression_map.hpp" #include "src/buildtool/build_engine/base_maps/json_file_map.hpp" #include "src/buildtool/build_engine/expression/expression.hpp" #include "src/buildtool/common/repository_config.hpp" diff --git a/test/buildtool/build_engine/base_maps/json_file_map.test.cpp b/test/buildtool/build_engine/base_maps/json_file_map.test.cpp index 91e74877..be657cff 100644 --- a/test/buildtool/build_engine/base_maps/json_file_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/json_file_map.test.cpp @@ -12,13 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/build_engine/base_maps/json_file_map.hpp" + #include <filesystem> #include <memory> #include <string> #include <utility> #include "catch2/catch_test_macros.hpp" -#include "src/buildtool/build_engine/base_maps/json_file_map.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/file_system/file_root.hpp" #include "src/buildtool/multithreading/task_system.hpp" @@ -28,8 +29,8 @@ namespace { using namespace BuildMaps::Base; // NOLINT -auto SetupConfig(std::string target_file_name, bool use_git) - -> RepositoryConfig { +auto SetupConfig(std::string target_file_name, + bool use_git) -> RepositoryConfig { auto root = FileRoot{kBasePath}; if (use_git) { auto repo_path = CreateTestRepo(); diff --git a/test/buildtool/build_engine/base_maps/rule_map.test.cpp b/test/buildtool/build_engine/base_maps/rule_map.test.cpp index 97e9c06d..87a76c2b 100644 --- a/test/buildtool/build_engine/base_maps/rule_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/rule_map.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/build_engine/base_maps/rule_map.hpp" + #include <filesystem> #include <functional> #include <memory> @@ -22,7 +24,6 @@ #include "src/buildtool/build_engine/base_maps/entity_name_data.hpp" #include "src/buildtool/build_engine/base_maps/expression_map.hpp" #include "src/buildtool/build_engine/base_maps/json_file_map.hpp" -#include "src/buildtool/build_engine/base_maps/rule_map.hpp" #include "src/buildtool/build_engine/expression/configuration.hpp" #include "src/buildtool/build_engine/expression/expression.hpp" #include "src/buildtool/common/repository_config.hpp" diff --git a/test/buildtool/build_engine/base_maps/source_map.test.cpp b/test/buildtool/build_engine/base_maps/source_map.test.cpp index 36a58895..44c6863a 100644 --- a/test/buildtool/build_engine/base_maps/source_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/source_map.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/build_engine/base_maps/source_map.hpp" + #include <filesystem> #include <memory> #include <optional> @@ -23,7 +25,6 @@ #include "src/buildtool/build_engine/base_maps/directory_map.hpp" #include "src/buildtool/build_engine/base_maps/entity_name.hpp" #include "src/buildtool/build_engine/base_maps/entity_name_data.hpp" -#include "src/buildtool/build_engine/base_maps/source_map.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/file_system/file_root.hpp" #include "src/buildtool/multithreading/async_map_consumer.hpp" @@ -56,12 +57,11 @@ auto SetupConfig(bool use_git) -> RepositoryConfig { return repo_config; } -auto ReadSourceTarget( - EntityName const& id, - SourceTargetMap::Consumer consumer, - bool use_git = false, - std::optional<SourceTargetMap::FailureFunction> fail_func = std::nullopt) - -> bool { +auto ReadSourceTarget(EntityName const& id, + SourceTargetMap::Consumer consumer, + bool use_git = false, + std::optional<SourceTargetMap::FailureFunction> + fail_func = std::nullopt) -> bool { auto repo_config = SetupConfig(use_git); auto directory_entries = CreateDirectoryEntriesMap(&repo_config); auto source_artifacts = diff --git a/test/buildtool/build_engine/expression/configuration.test.cpp b/test/buildtool/build_engine/expression/configuration.test.cpp index 7f54748d..0a902c73 100644 --- a/test/buildtool/build_engine/expression/configuration.test.cpp +++ b/test/buildtool/build_engine/expression/configuration.test.cpp @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/build_engine/expression/configuration.hpp" + #include <string> #include <vector> #include "catch2/catch_test_macros.hpp" -#include "src/buildtool/build_engine/expression/configuration.hpp" #include "src/buildtool/build_engine/expression/expression.hpp" #include "test/utils/container_matchers.hpp" diff --git a/test/buildtool/build_engine/expression/expression.test.cpp b/test/buildtool/build_engine/expression/expression.test.cpp index 83d6a2fe..aaca1c71 100644 --- a/test/buildtool/build_engine/expression/expression.test.cpp +++ b/test/buildtool/build_engine/expression/expression.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/build_engine/expression/expression.hpp" + #include <filesystem> #include <sstream> #include <string> @@ -20,7 +22,6 @@ #include "catch2/catch_test_macros.hpp" #include "catch2/matchers/catch_matchers_all.hpp" #include "src/buildtool/build_engine/expression/configuration.hpp" -#include "src/buildtool/build_engine/expression/expression.hpp" #include "src/buildtool/build_engine/expression/function_map.hpp" #include "src/buildtool/common/artifact_description.hpp" #include "test/utils/container_matchers.hpp" @@ -291,8 +292,9 @@ concept ValidExpressionTypeOrPtr = Expression::IsValidType<T>() or std::is_same_v<T, ExpressionPtr>; template <ValidExpressionTypeOrPtr T> -auto Add(ExpressionPtr const& expr, std::string const& key, T const& by) - -> ExpressionPtr { +auto Add(ExpressionPtr const& expr, + std::string const& key, + T const& by) -> ExpressionPtr { try { auto new_map = Expression::map_t::underlying_map_t{}; new_map.emplace(key, by); @@ -303,8 +305,9 @@ auto Add(ExpressionPtr const& expr, std::string const& key, T const& by) } template <ValidExpressionTypeOrPtr T> -auto Replace(ExpressionPtr const& expr, std::string const& key, T const& by) - -> ExpressionPtr { +auto Replace(ExpressionPtr const& expr, + std::string const& key, + T const& by) -> ExpressionPtr { auto const& map = expr->Map(); if (not map.contains(key)) { return ExpressionPtr{nullptr}; diff --git a/test/buildtool/build_engine/expression/linked_map.test.cpp b/test/buildtool/build_engine/expression/linked_map.test.cpp index 4c9a996f..4d0bf993 100644 --- a/test/buildtool/build_engine/expression/linked_map.test.cpp +++ b/test/buildtool/build_engine/expression/linked_map.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/build_engine/expression/linked_map.hpp" + #include <algorithm> #include <cstddef> #include <memory> @@ -19,7 +21,6 @@ #include <utility> // std::move #include "catch2/catch_test_macros.hpp" -#include "src/buildtool/build_engine/expression/linked_map.hpp" #include "test/utils/container_matchers.hpp" TEST_CASE("Empty map", "[linked_map]") { diff --git a/test/buildtool/build_engine/target_map/result_map.test.cpp b/test/buildtool/build_engine/target_map/result_map.test.cpp index 56fbfbd6..c781d83c 100644 --- a/test/buildtool/build_engine/target_map/result_map.test.cpp +++ b/test/buildtool/build_engine/target_map/result_map.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/build_engine/target_map/result_map.hpp" + #include <cstdlib> #include <filesystem> #include <fstream> @@ -23,7 +25,6 @@ #include "nlohmann/json.hpp" #include "src/buildtool/build_engine/analysed_target/analysed_target.hpp" #include "src/buildtool/build_engine/expression/target_result.hpp" -#include "src/buildtool/build_engine/target_map/result_map.hpp" #include "src/buildtool/common/action_description.hpp" #include "src/buildtool/common/statistics.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" diff --git a/test/buildtool/build_engine/target_map/target_map.test.cpp b/test/buildtool/build_engine/target_map/target_map.test.cpp index 85d3b104..cb8aa230 100644 --- a/test/buildtool/build_engine/target_map/target_map.test.cpp +++ b/test/buildtool/build_engine/target_map/target_map.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/build_engine/target_map/target_map.hpp" + #include <filesystem> #include <string> #include <utility> // std::move @@ -25,7 +27,6 @@ #include "src/buildtool/build_engine/base_maps/source_map.hpp" #include "src/buildtool/build_engine/base_maps/targets_file_map.hpp" #include "src/buildtool/build_engine/expression/expression.hpp" -#include "src/buildtool/build_engine/target_map/target_map.hpp" #include "src/buildtool/common/remote/retry_config.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/common/statistics.hpp" diff --git a/test/buildtool/common/action_description.test.cpp b/test/buildtool/common/action_description.test.cpp index c79caeaa..eab2cc48 100644 --- a/test/buildtool/common/action_description.test.cpp +++ b/test/buildtool/common/action_description.test.cpp @@ -12,12 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/common/action_description.hpp" + #include <filesystem> #include "catch2/catch_test_macros.hpp" #include "nlohmann/json.hpp" #include "src/buildtool/common/action.hpp" -#include "src/buildtool/common/action_description.hpp" #include "src/buildtool/common/artifact_description.hpp" TEST_CASE("From JSON", "[action_description]") { diff --git a/test/buildtool/common/artifact_description.test.cpp b/test/buildtool/common/artifact_description.test.cpp index 76e49e34..c6d3a8d5 100644 --- a/test/buildtool/common/artifact_description.test.cpp +++ b/test/buildtool/common/artifact_description.test.cpp @@ -12,17 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/common/artifact_description.hpp" + #include <filesystem> #include <string> #include "catch2/catch_test_macros.hpp" #include "nlohmann/json.hpp" #include "src/buildtool/common/artifact.hpp" -#include "src/buildtool/common/artifact_description.hpp" #include "src/buildtool/file_system/object_type.hpp" -[[nodiscard]] auto operator==(Artifact const& lhs, Artifact const& rhs) - -> bool { +[[nodiscard]] auto operator==(Artifact const& lhs, + Artifact const& rhs) -> bool { return lhs.Id() == rhs.Id() and lhs.FilePath() == rhs.FilePath() and lhs.Info() == rhs.Info(); } diff --git a/test/buildtool/common/repository_config.test.cpp b/test/buildtool/common/repository_config.test.cpp index 4fd8362b..931ead30 100644 --- a/test/buildtool/common/repository_config.test.cpp +++ b/test/buildtool/common/repository_config.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/common/repository_config.hpp" + #include <atomic> #include <cstddef> #include <filesystem> @@ -24,7 +26,6 @@ #include "catch2/catch_test_macros.hpp" #include "nlohmann/json.hpp" #include "src/buildtool/common/artifact_digest.hpp" -#include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/file_system/file_root.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/storage/config.hpp" @@ -86,8 +87,8 @@ template <class T> } // Read graph from CAS -[[nodiscard]] auto ReadGraph(Storage const& storage, std::string const& hash) - -> nlohmann::json { +[[nodiscard]] auto ReadGraph(Storage const& storage, + std::string const& hash) -> nlohmann::json { auto const& cas = storage.CAS(); auto blob = cas.BlobPath( ArtifactDigest{hash, /*does not matter*/ 0, /*is_tree=*/false}, diff --git a/test/buildtool/crypto/hash_function.test.cpp b/test/buildtool/crypto/hash_function.test.cpp index 61c92eb9..89c073f4 100644 --- a/test/buildtool/crypto/hash_function.test.cpp +++ b/test/buildtool/crypto/hash_function.test.cpp @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/crypto/hash_function.hpp" + #include <string> #include <utility> // std::move #include "catch2/catch_test_macros.hpp" -#include "src/buildtool/crypto/hash_function.hpp" TEST_CASE("Hash Function", "[crypto]") { std::string bytes{"test"}; diff --git a/test/buildtool/crypto/hasher.test.cpp b/test/buildtool/crypto/hasher.test.cpp index 4f5e8448..8414cc81 100644 --- a/test/buildtool/crypto/hasher.test.cpp +++ b/test/buildtool/crypto/hasher.test.cpp @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/crypto/hasher.hpp" + #include <string> #include <utility> // std::move #include "catch2/catch_test_macros.hpp" -#include "src/buildtool/crypto/hasher.hpp" template <Hasher::HashType type> void test_increment_hash(std::string const& bytes, std::string const& result) { diff --git a/test/buildtool/execution_api/bazel/bazel_api.test.cpp b/test/buildtool/execution_api/bazel/bazel_api.test.cpp index 3ebee8d2..bced4a87 100644 --- a/test/buildtool/execution_api/bazel/bazel_api.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_api.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/execution_api/remote/bazel/bazel_api.hpp" + #include <cstdlib> #include <string> @@ -19,7 +21,6 @@ #include "src/buildtool/common/remote/retry_config.hpp" #include "src/buildtool/compatibility/compatibility.hpp" #include "src/buildtool/crypto/hash_function.hpp" -#include "src/buildtool/execution_api/remote/bazel/bazel_api.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "test/buildtool/execution_api/common/api_test.hpp" #include "test/utils/remote_execution/test_auth_config.hpp" diff --git a/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp b/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp index 3aae8db2..bd005497 100644 --- a/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp" + #include <functional> // std::equal_to #include <string> #include <vector> @@ -22,7 +24,6 @@ #include "src/buildtool/common/remote/retry_config.hpp" #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob_container.hpp" -#include "src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/file_system/object_type.hpp" diff --git a/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp b/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp index d569f884..093c4eb1 100644 --- a/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp" + #include <string> #include "catch2/catch_test_macros.hpp" @@ -19,7 +21,6 @@ #include "src/buildtool/common/remote/retry_config.hpp" #include "src/buildtool/compatibility/compatibility.hpp" #include "src/buildtool/crypto/hash_function.hpp" -#include "src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/file_system/object_type.hpp" #include "test/utils/remote_execution/bazel_action_creator.hpp" diff --git a/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp b/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp index fa6c3d4d..2c4035b0 100644 --- a/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp" + #include <filesystem> #include <unordered_map> @@ -20,7 +22,6 @@ #include "src/buildtool/compatibility/compatibility.hpp" #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob_container.hpp" -#include "src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/object_type.hpp" #include "test/utils/blob_creator.hpp" diff --git a/test/buildtool/execution_api/bazel/bazel_network.test.cpp b/test/buildtool/execution_api/bazel/bazel_network.test.cpp index 1103c52b..edc35ea7 100644 --- a/test/buildtool/execution_api/bazel/bazel_network.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_network.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/execution_api/remote/bazel/bazel_network.hpp" + #include <cstddef> #include <optional> #include <string> @@ -25,7 +27,6 @@ #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob_container.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp" -#include "src/buildtool/execution_api/remote/bazel/bazel_network.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/file_system/object_type.hpp" #include "test/utils/remote_execution/test_auth_config.hpp" diff --git a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp index dbf965dd..fba05118 100644 --- a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/execution_api/remote/bazel/bytestream_client.hpp" + #include <cstddef> #include <optional> #include <string> @@ -23,7 +25,6 @@ #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob_container.hpp" #include "src/buildtool/execution_api/common/execution_common.hpp" -#include "src/buildtool/execution_api/remote/bazel/bytestream_client.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/file_system/object_type.hpp" #include "test/utils/remote_execution/test_auth_config.hpp" diff --git a/test/buildtool/execution_api/execution_service/cas_server.test.cpp b/test/buildtool/execution_api/execution_service/cas_server.test.cpp index 80aaa76b..4bc90546 100644 --- a/test/buildtool/execution_api/execution_service/cas_server.test.cpp +++ b/test/buildtool/execution_api/execution_service/cas_server.test.cpp @@ -12,12 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/execution_api/execution_service/cas_server.hpp" + #include <string> #include "catch2/catch_test_macros.hpp" #include "gsl/gsl" #include "src/buildtool/common/artifact_digest.hpp" -#include "src/buildtool/execution_api/execution_service/cas_server.hpp" #include "src/buildtool/execution_api/local/config.hpp" #include "src/buildtool/execution_api/local/context.hpp" #include "src/buildtool/file_system/git_repo.hpp" diff --git a/test/buildtool/execution_api/local/local_api.test.cpp b/test/buildtool/execution_api/local/local_api.test.cpp index 22d6bdbd..548b3497 100644 --- a/test/buildtool/execution_api/local/local_api.test.cpp +++ b/test/buildtool/execution_api/local/local_api.test.cpp @@ -12,13 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/execution_api/local/local_api.hpp" + #include <cstdlib> #include <string> #include "catch2/catch_test_macros.hpp" #include "src/buildtool/execution_api/local/config.hpp" #include "src/buildtool/execution_api/local/context.hpp" -#include "src/buildtool/execution_api/local/local_api.hpp" #include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/storage.hpp" #include "test/buildtool/execution_api/common/api_test.hpp" diff --git a/test/buildtool/execution_engine/dag/dag.test.cpp b/test/buildtool/execution_engine/dag/dag.test.cpp index 8a88775d..201a537f 100644 --- a/test/buildtool/execution_engine/dag/dag.test.cpp +++ b/test/buildtool/execution_engine/dag/dag.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/execution_engine/dag/dag.hpp" + #include <cstddef> #include <cstdint> #include <map> @@ -25,7 +27,6 @@ #include "src/buildtool/common/action_description.hpp" #include "src/buildtool/common/artifact_description.hpp" #include "src/buildtool/common/identifier.hpp" -#include "src/buildtool/execution_engine/dag/dag.hpp" #include "test/utils/container_matchers.hpp" namespace { diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index 84bf7ade..22cd2cc4 100644 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/execution_engine/executor/executor.hpp" + #include <algorithm> #include <filesystem> #include <map> @@ -33,7 +35,6 @@ #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/execution_api/remote/context.hpp" #include "src/buildtool/execution_engine/executor/context.hpp" -#include "src/buildtool/execution_engine/executor/executor.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/progress_reporting/progress.hpp" #include "test/utils/executor/test_api_bundle.hpp" diff --git a/test/buildtool/execution_engine/traverser/traverser.test.cpp b/test/buildtool/execution_engine/traverser/traverser.test.cpp index fcdc5ef7..97e2095e 100644 --- a/test/buildtool/execution_engine/traverser/traverser.test.cpp +++ b/test/buildtool/execution_engine/traverser/traverser.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/execution_engine/traverser/traverser.hpp" + #include <algorithm> #include <mutex> #include <string> @@ -23,7 +25,6 @@ #include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_description.hpp" #include "src/buildtool/execution_engine/dag/dag.hpp" -#include "src/buildtool/execution_engine/traverser/traverser.hpp" #include "test/utils/container_matchers.hpp" namespace { diff --git a/test/buildtool/file_system/file_root.test.cpp b/test/buildtool/file_system/file_root.test.cpp index 8fbb0d95..67fd77f3 100644 --- a/test/buildtool/file_system/file_root.test.cpp +++ b/test/buildtool/file_system/file_root.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/file_system/file_root.hpp" + #include <atomic> #include <cstdlib> #include <filesystem> @@ -21,7 +23,6 @@ #include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_description.hpp" -#include "src/buildtool/file_system/file_root.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "test/utils/container_matchers.hpp" #include "test/utils/shell_quoting.hpp" diff --git a/test/buildtool/file_system/file_system_manager.test.cpp b/test/buildtool/file_system/file_system_manager.test.cpp index 05fef390..689dd9b1 100644 --- a/test/buildtool/file_system/file_system_manager.test.cpp +++ b/test/buildtool/file_system/file_system_manager.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/file_system/file_system_manager.hpp" + #include <algorithm> #include <chrono> #include <cstdlib> @@ -23,7 +25,6 @@ #include "catch2/catch_test_macros.hpp" #include "catch2/generators/catch_generators_all.hpp" -#include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/object_type.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" @@ -352,8 +353,12 @@ TEST_CASE_METHOD(CopyFileFixture, "CopyFile", "[file_system]") { CHECK(content_from == content_to); }; - SECTION("direct") { run_test(false); } - SECTION("fd_less") { run_test(true); } + SECTION("direct") { + run_test(false); + } + SECTION("fd_less") { + run_test(true); + } } TEST_CASE_METHOD(CopyFileFixture, "CopyFileAs", "[file_system]") { @@ -381,8 +386,12 @@ TEST_CASE_METHOD(CopyFileFixture, "CopyFileAs", "[file_system]") { } }; - SECTION("direct") { run_test(false); } - SECTION("fd_less") { run_test(true); } + SECTION("direct") { + run_test(false); + } + SECTION("fd_less") { + run_test(true); + } SECTION("direct with epoch") { run_test.template operator()<true>(false); } @@ -415,8 +424,12 @@ TEST_CASE_METHOD(CopyFileFixture, "CopyFileAs", "[file_system]") { } }; - SECTION("direct") { run_test(false); } - SECTION("fd_less") { run_test(true); } + SECTION("direct") { + run_test(false); + } + SECTION("fd_less") { + run_test(true); + } SECTION("direct with epoch") { run_test.template operator()<true>(false); } @@ -447,8 +460,12 @@ TEST_CASE_METHOD(CopyFileFixture, "CopyFileAs", "[file_system]") { } }; - SECTION("direct") { run_test(false); } - SECTION("fd_less") { run_test(true); } + SECTION("direct") { + run_test(false); + } + SECTION("fd_less") { + run_test(true); + } SECTION("direct with epoch") { run_test.template operator()<true>(false); } @@ -480,8 +497,12 @@ TEST_CASE_METHOD(CopyFileFixture, "CopyFileAs", "[file_system]") { } }; - SECTION("direct") { run_test(false); } - SECTION("fd_less") { run_test(true); } + SECTION("direct") { + run_test(false); + } + SECTION("fd_less") { + run_test(true); + } SECTION("direct with epoch") { run_test.template operator()<true>(false); } @@ -535,8 +556,12 @@ TEST_CASE_METHOD(WriteFileFixture, "WriteFile", "[file_system]") { CHECK(written_content == content); }; - SECTION("direct") { run_test(false); } - SECTION("fd-less") { run_test(true); } + SECTION("direct") { + run_test(false); + } + SECTION("fd-less") { + run_test(true); + } } TEST_CASE_METHOD(WriteFileFixture, "WriteFileAs", "[file_system]") { @@ -562,8 +587,12 @@ TEST_CASE_METHOD(WriteFileFixture, "WriteFileAs", "[file_system]") { } }; - SECTION("direct") { run_test(false); } - SECTION("fd-less") { run_test(true); } + SECTION("direct") { + run_test(false); + } + SECTION("fd-less") { + run_test(true); + } SECTION("direct with epoch") { run_test.template operator()<true>(false); } @@ -592,8 +621,12 @@ TEST_CASE_METHOD(WriteFileFixture, "WriteFileAs", "[file_system]") { } }; - SECTION("direct") { run_test(false); } - SECTION("fd-less") { run_test(true); } + SECTION("direct") { + run_test(false); + } + SECTION("fd-less") { + run_test(true); + } SECTION("direct with epoch") { run_test.template operator()<true>(false); } diff --git a/test/buildtool/file_system/git_repo.test.cpp b/test/buildtool/file_system/git_repo.test.cpp index 5a0831cc..2663e9bd 100644 --- a/test/buildtool/file_system/git_repo.test.cpp +++ b/test/buildtool/file_system/git_repo.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/file_system/git_repo.hpp" + #include <atomic> #include <cstdlib> #include <filesystem> @@ -26,7 +28,6 @@ #include "nlohmann/json.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/git_cas.hpp" -#include "src/buildtool/file_system/git_repo.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/storage/config.hpp" diff --git a/test/buildtool/file_system/git_tree.test.cpp b/test/buildtool/file_system/git_tree.test.cpp index 82177b45..2cef0e00 100644 --- a/test/buildtool/file_system/git_tree.test.cpp +++ b/test/buildtool/file_system/git_tree.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/file_system/git_tree.hpp" + #include <atomic> #include <cstdlib> #include <filesystem> @@ -27,7 +29,6 @@ #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/git_cas.hpp" #include "src/buildtool/file_system/git_repo.hpp" -#include "src/buildtool/file_system/git_tree.hpp" #include "src/utils/cpp/hex_string.hpp" #include "test/utils/container_matchers.hpp" #include "test/utils/shell_quoting.hpp" diff --git a/test/buildtool/file_system/object_cas.test.cpp b/test/buildtool/file_system/object_cas.test.cpp index a8fd746b..e9ebf580 100644 --- a/test/buildtool/file_system/object_cas.test.cpp +++ b/test/buildtool/file_system/object_cas.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/file_system/object_cas.hpp" + #include <functional> // std::equal_to #include <string> @@ -19,7 +21,6 @@ #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/common/bazel_types.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" -#include "src/buildtool/file_system/object_cas.hpp" #include "src/buildtool/file_system/object_type.hpp" #include "src/buildtool/storage/config.hpp" #include "test/utils/hermeticity/test_storage_config.hpp" diff --git a/test/buildtool/file_system/resolve_symlinks_map.test.cpp b/test/buildtool/file_system/resolve_symlinks_map.test.cpp index 2cf05ead..d1cd7692 100644 --- a/test/buildtool/file_system/resolve_symlinks_map.test.cpp +++ b/test/buildtool/file_system/resolve_symlinks_map.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/file_system/symlinks_map/resolve_symlinks_map.hpp" + #include <atomic> #include <cstdlib> #include <filesystem> @@ -27,7 +29,6 @@ #include "src/buildtool/file_system/git_repo.hpp" #include "src/buildtool/file_system/object_type.hpp" #include "src/buildtool/file_system/symlinks_map/pragma_special.hpp" -#include "src/buildtool/file_system/symlinks_map/resolve_symlinks_map.hpp" #include "src/buildtool/multithreading/task_system.hpp" #include "test/utils/shell_quoting.hpp" diff --git a/test/buildtool/logging/log_sink_file.test.cpp b/test/buildtool/logging/log_sink_file.test.cpp index 2dde74b8..08a59446 100644 --- a/test/buildtool/logging/log_sink_file.test.cpp +++ b/test/buildtool/logging/log_sink_file.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/logging/log_sink_file.hpp" + #include <filesystem> #include <fstream> #include <iostream> @@ -26,7 +28,6 @@ #include "src/buildtool/logging/log_config.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/log_sink_cmdline.hpp" -#include "src/buildtool/logging/log_sink_file.hpp" [[nodiscard]] static auto NumberOfLines(std::filesystem::path const& file_path) -> int { diff --git a/test/buildtool/logging/logger.test.cpp b/test/buildtool/logging/logger.test.cpp index f4a9313d..474a656f 100644 --- a/test/buildtool/logging/logger.test.cpp +++ b/test/buildtool/logging/logger.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/logging/logger.hpp" + #include <atomic> #include <string> #include <unordered_map> @@ -21,7 +23,6 @@ #include "src/buildtool/logging/log_config.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/log_sink.hpp" -#include "src/buildtool/logging/logger.hpp" // Stores prints from test sink instances class TestPrints { diff --git a/test/buildtool/main/install_cas.test.cpp b/test/buildtool/main/install_cas.test.cpp index 05de9c0d..9c9ef8e0 100644 --- a/test/buildtool/main/install_cas.test.cpp +++ b/test/buildtool/main/install_cas.test.cpp @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/main/install_cas.hpp" + #include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact.hpp" -#include "src/buildtool/main/install_cas.hpp" TEST_CASE("ObjectInfoFromLiberalString", "[artifact]") { auto expected = *Artifact::ObjectInfo::FromString( diff --git a/test/buildtool/multithreading/async_map.test.cpp b/test/buildtool/multithreading/async_map.test.cpp index 30a6322a..7932f507 100644 --- a/test/buildtool/multithreading/async_map.test.cpp +++ b/test/buildtool/multithreading/async_map.test.cpp @@ -12,10 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/multithreading/async_map.hpp" + #include <string> #include "catch2/catch_test_macros.hpp" -#include "src/buildtool/multithreading/async_map.hpp" #include "src/buildtool/multithreading/async_map_node.hpp" #include "src/buildtool/multithreading/task_system.hpp" diff --git a/test/buildtool/multithreading/async_map_consumer.test.cpp b/test/buildtool/multithreading/async_map_consumer.test.cpp index f65c7851..3ba3eebf 100644 --- a/test/buildtool/multithreading/async_map_consumer.test.cpp +++ b/test/buildtool/multithreading/async_map_consumer.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/multithreading/async_map_consumer.hpp" + #include <algorithm> // std::transform #include <atomic> #include <cstdint> // for fixed width integral types @@ -24,7 +26,6 @@ #include "catch2/catch_test_macros.hpp" #include "catch2/matchers/catch_matchers_all.hpp" #include "src/buildtool/multithreading/async_map.hpp" -#include "src/buildtool/multithreading/async_map_consumer.hpp" #include "src/buildtool/multithreading/task_system.hpp" auto FibonacciMapConsumer() -> AsyncMapConsumer<int, std::uint64_t> { diff --git a/test/buildtool/multithreading/async_map_node.test.cpp b/test/buildtool/multithreading/async_map_node.test.cpp index 782f41ad..d0c9a702 100644 --- a/test/buildtool/multithreading/async_map_node.test.cpp +++ b/test/buildtool/multithreading/async_map_node.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/multithreading/async_map_node.hpp" + #include <mutex> #include <string> #include <thread> @@ -19,7 +21,6 @@ #include "catch2/catch_test_macros.hpp" #include "catch2/matchers/catch_matchers_all.hpp" -#include "src/buildtool/multithreading/async_map_node.hpp" #include "src/buildtool/multithreading/task_system.hpp" TEST_CASE("No task is queued if the node is never ready", "[async_map_node]") { diff --git a/test/buildtool/multithreading/task.test.cpp b/test/buildtool/multithreading/task.test.cpp index 772b3e83..dbacb1a8 100644 --- a/test/buildtool/multithreading/task.test.cpp +++ b/test/buildtool/multithreading/task.test.cpp @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/multithreading/task.hpp" + #include <functional> #include <utility> // std::move #include "catch2/catch_test_macros.hpp" -#include "src/buildtool/multithreading/task.hpp" namespace { constexpr int kDummyValue{5}; diff --git a/test/buildtool/multithreading/task_system.test.cpp b/test/buildtool/multithreading/task_system.test.cpp index ea0ed41b..8e9f5c77 100644 --- a/test/buildtool/multithreading/task_system.test.cpp +++ b/test/buildtool/multithreading/task_system.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/multithreading/task_system.hpp" + #include <atomic> #include <chrono> #include <condition_variable> @@ -27,7 +29,6 @@ #include "catch2/catch_test_macros.hpp" #include "catch2/generators/catch_generators_all.hpp" #include "catch2/matchers/catch_matchers_all.hpp" -#include "src/buildtool/multithreading/task_system.hpp" #include "test/utils/container_matchers.hpp" namespace { diff --git a/test/buildtool/serve_api/source_tree_client.test.cpp b/test/buildtool/serve_api/source_tree_client.test.cpp index d44a1605..7c9634df 100644 --- a/test/buildtool/serve_api/source_tree_client.test.cpp +++ b/test/buildtool/serve_api/source_tree_client.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/serve_api/remote/source_tree_client.hpp" + #include <string> #include <variant> @@ -21,7 +23,6 @@ #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/execution_api/remote/context.hpp" #include "src/buildtool/serve_api/remote/config.hpp" -#include "src/buildtool/serve_api/remote/source_tree_client.hpp" #include "test/utils/serve_service/test_serve_config.hpp" auto const kRootCommit = diff --git a/test/buildtool/storage/large_object_cas.test.cpp b/test/buildtool/storage/large_object_cas.test.cpp index 39a957e0..7d191629 100644 --- a/test/buildtool/storage/large_object_cas.test.cpp +++ b/test/buildtool/storage/large_object_cas.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/storage/large_object_cas.hpp" + #include <cstddef> #include <cstdint> #include <cstdlib> @@ -32,7 +34,6 @@ #include "src/buildtool/file_system/object_type.hpp" #include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/garbage_collector.hpp" -#include "src/buildtool/storage/large_object_cas.hpp" #include "src/buildtool/storage/storage.hpp" #include "src/utils/cpp/tmp_dir.hpp" #include "test/utils/hermeticity/test_storage_config.hpp" diff --git a/test/buildtool/system/system_command.test.cpp b/test/buildtool/system/system_command.test.cpp index 5e16d02e..a2fc5d35 100644 --- a/test/buildtool/system/system_command.test.cpp +++ b/test/buildtool/system/system_command.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/buildtool/system/system_command.hpp" + #include <cstdlib> #include <filesystem> #include <iostream> @@ -20,7 +22,6 @@ #include "catch2/catch_test_macros.hpp" #include "catch2/matchers/catch_matchers_all.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" -#include "src/buildtool/system/system_command.hpp" namespace { [[nodiscard]] auto GetTestDir() -> std::filesystem::path { diff --git a/test/other_tools/git_operations/git_repo_remote.test.cpp b/test/other_tools/git_operations/git_repo_remote.test.cpp index 0844205d..69cfce34 100644 --- a/test/other_tools/git_operations/git_repo_remote.test.cpp +++ b/test/other_tools/git_operations/git_repo_remote.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/other_tools/git_operations/git_repo_remote.hpp" + #include <atomic> #include <cstdlib> #include <filesystem> @@ -27,7 +29,6 @@ #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/storage/config.hpp" -#include "src/other_tools/git_operations/git_repo_remote.hpp" #include "src/utils/cpp/atomic.hpp" #include "test/utils/hermeticity/test_storage_config.hpp" #include "test/utils/shell_quoting.hpp" diff --git a/test/other_tools/just_mr/mirrors.test.cpp b/test/other_tools/just_mr/mirrors.test.cpp index 5e2a6e9e..c7eef60b 100644 --- a/test/other_tools/just_mr/mirrors.test.cpp +++ b/test/other_tools/just_mr/mirrors.test.cpp @@ -12,12 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/other_tools/just_mr/mirrors.hpp" + #include <string> #include <vector> #include "catch2/catch_test_macros.hpp" #include "catch2/matchers/catch_matchers_all.hpp" -#include "src/other_tools/just_mr/mirrors.hpp" TEST_CASE("SortByHostname") { // setup inputs diff --git a/test/other_tools/just_mr/rc_merge.test.cpp b/test/other_tools/just_mr/rc_merge.test.cpp index 98302eae..b40b1b48 100644 --- a/test/other_tools/just_mr/rc_merge.test.cpp +++ b/test/other_tools/just_mr/rc_merge.test.cpp @@ -12,10 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/other_tools/just_mr/rc_merge.hpp" + #include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/expression/configuration.hpp" #include "src/buildtool/build_engine/expression/expression.hpp" -#include "src/other_tools/just_mr/rc_merge.hpp" TEST_CASE("Simple field") { auto conf = Configuration{Expression::FromJson(R"( diff --git a/test/utils/archive/archive_usage.test.cpp b/test/utils/archive/archive_usage.test.cpp index 282c2425..fd33f7e0 100644 --- a/test/utils/archive/archive_usage.test.cpp +++ b/test/utils/archive/archive_usage.test.cpp @@ -109,8 +109,8 @@ std::vector<archive_test_info_t> const kTestScenarios = { .tools = {"7z"}, // 7z comes with its own lzma-type compression .cmd = "/usr/bin/7z x"}}; -[[nodiscard]] auto read_archive(archive* a, std::string const& path) - -> filetree_t { +[[nodiscard]] auto read_archive(archive* a, + std::string const& path) -> filetree_t { filetree_t result{}; REQUIRE(archive_read_open_filename(a, path.c_str(), kBlockSize) == diff --git a/test/utils/cpp/file_locking.test.cpp b/test/utils/cpp/file_locking.test.cpp index 50b4fe63..b5e38a9c 100644 --- a/test/utils/cpp/file_locking.test.cpp +++ b/test/utils/cpp/file_locking.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/utils/cpp/file_locking.hpp" + #include <atomic> #include <chrono> #include <cstdlib> @@ -23,7 +25,6 @@ #include "catch2/catch_test_macros.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/utils/cpp/atomic.hpp" -#include "src/utils/cpp/file_locking.hpp" namespace { [[nodiscard]] auto GetTestDir() noexcept -> std::filesystem::path { diff --git a/test/utils/cpp/path.test.cpp b/test/utils/cpp/path.test.cpp index 7a0ac1fe..ecfc64c1 100644 --- a/test/utils/cpp/path.test.cpp +++ b/test/utils/cpp/path.test.cpp @@ -12,10 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/utils/cpp/path.hpp" + #include <filesystem> #include "catch2/catch_test_macros.hpp" -#include "src/utils/cpp/path.hpp" TEST_CASE("normalization", "[path]") { CHECK(ToNormalPath(std::filesystem::path{""}) == diff --git a/test/utils/cpp/path_rebase.test.cpp b/test/utils/cpp/path_rebase.test.cpp index 79a13fb5..fe62e0be 100644 --- a/test/utils/cpp/path_rebase.test.cpp +++ b/test/utils/cpp/path_rebase.test.cpp @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "catch2/catch_test_macros.hpp" #include "src/utils/cpp/path_rebase.hpp" +#include "catch2/catch_test_macros.hpp" + TEST_CASE("rebase", "[path_rebase]") { CHECK(RebasePathStringRelativeTo("work", "work/foo/bar") == "foo/bar"); CHECK(RebasePathStringRelativeTo("work", "work/foo") == "foo"); diff --git a/test/utils/cpp/prefix.test.cpp b/test/utils/cpp/prefix.test.cpp index 3dd092eb..ae47c93d 100644 --- a/test/utils/cpp/prefix.test.cpp +++ b/test/utils/cpp/prefix.test.cpp @@ -12,10 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/utils/cpp/prefix.hpp" + #include <filesystem> #include "catch2/catch_test_macros.hpp" -#include "src/utils/cpp/prefix.hpp" TEST_CASE("lines", "[prefix]") { CHECK(PrefixLines("").empty()); |