diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-04-04 16:34:29 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-04-08 15:19:50 +0200 |
commit | e047c360dcc5cbdc01ee19a1b755bb70d883e41c (patch) | |
tree | 446072ded32f88c1e77d047d27f9fbde6e1825be /test | |
parent | 65fc11ff28e6dd29a95391b6700a02d277b539c6 (diff) | |
download | justbuild-e047c360dcc5cbdc01ee19a1b755bb70d883e41c.tar.gz |
test: Add missing includes and fix deps
Diffstat (limited to 'test')
78 files changed, 349 insertions, 10 deletions
diff --git a/test/buildtool/build_engine/base_maps/TARGETS b/test/buildtool/build_engine/base_maps/TARGETS index 9a71957d..c6b683fb 100644 --- a/test/buildtool/build_engine/base_maps/TARGETS +++ b/test/buildtool/build_engine/base_maps/TARGETS @@ -31,6 +31,8 @@ , ["", "catch-main"] , ["@", "src", "src/buildtool/common", "config"] , ["@", "src", "src/buildtool/build_engine/base_maps", "directory_map"] + , ["@", "src", "src/buildtool/build_engine/base_maps", "module_name"] + , ["@", "src", "src/buildtool/file_system", "file_root"] ] , "stage": ["test", "buildtool", "build_engine", "base_maps"] } @@ -45,6 +47,8 @@ , ["", "catch-main"] , ["@", "src", "src/buildtool/common", "config"] , ["@", "src", "src/buildtool/build_engine/base_maps", "json_file_map"] + , ["@", "src", "src/buildtool/file_system", "file_root"] + , ["@", "src", "src/buildtool/multithreading", "task_system"] ] , "stage": ["test", "buildtool", "build_engine", "base_maps"] } @@ -57,9 +61,12 @@ [ "test_repo" , ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "json", "", "json"] , ["@", "src", "src/buildtool/common", "config"] , ["@", "src", "src/buildtool/build_engine/base_maps", "directory_map"] , ["@", "src", "src/buildtool/build_engine/base_maps", "source_map"] + , ["@", "src", "src/buildtool/build_engine/base_maps", "entity_name_data"] + , ["@", "src", "src/buildtool/file_system", "file_root"] ] , "stage": ["test", "buildtool", "build_engine", "base_maps"] } @@ -73,6 +80,12 @@ , ["@", "catch2", "", "catch2"] , ["", "catch-main"] , ["@", "src", "src/buildtool/build_engine/base_maps", "expression_map"] + , ["@", "src", "src/buildtool/build_engine/base_maps", "entity_name_data"] + , ["@", "src", "src/buildtool/build_engine/base_maps", "json_file_map"] + , ["@", "src", "src/buildtool/build_engine/expression", "expression"] + , ["@", "src", "src/buildtool/common", "config"] + , ["@", "src", "src/buildtool/file_system", "file_root"] + , ["@", "src", "src/buildtool/multithreading", "task_system"] ] , "stage": ["test", "buildtool", "build_engine", "base_maps"] } @@ -87,6 +100,13 @@ , ["", "catch-main"] , ["@", "src", "src/buildtool/common", "config"] , ["@", "src", "src/buildtool/build_engine/base_maps", "rule_map"] + , ["@", "src", "src/buildtool/build_engine/base_maps", "entity_name_data"] + , ["@", "src", "src/buildtool/build_engine/base_maps", "expression_map"] + , ["@", "src", "src/buildtool/build_engine/base_maps", "json_file_map"] + , ["@", "src", "src/buildtool/build_engine/expression", "expression"] + , ["@", "src", "src/buildtool/common", "config"] + , ["@", "src", "src/buildtool/file_system", "file_root"] + , ["@", "src", "src/buildtool/multithreading", "task_system"] ] , "stage": ["test", "buildtool", "build_engine", "base_maps"] } 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 b2674c2b..eaeb806a 100644 --- a/test/buildtool/build_engine/base_maps/directory_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/directory_map.test.cpp @@ -14,10 +14,14 @@ #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" #include "src/buildtool/multithreading/task_system.hpp" #include "test/buildtool/build_engine/base_maps/test_repo.hpp" 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 392d81ba..21cf1e50 100644 --- a/test/buildtool/build_engine/base_maps/expression_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/expression_map.test.cpp @@ -15,11 +15,16 @@ #include <filesystem> #include <functional> #include <memory> +#include <string> +#include <utility> // std::move #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" +#include "src/buildtool/file_system/file_root.hpp" #include "src/buildtool/multithreading/task_system.hpp" #include "test/buildtool/build_engine/base_maps/test_repo.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 e0177864..19814231 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 @@ -14,11 +14,13 @@ #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" #include "test/buildtool/build_engine/base_maps/test_repo.hpp" 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 7a3a021f..97e9c06d 100644 --- a/test/buildtool/build_engine/base_maps/rule_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/rule_map.test.cpp @@ -15,12 +15,18 @@ #include <filesystem> #include <functional> #include <memory> +#include <string> +#include <utility> // std::move #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/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" +#include "src/buildtool/file_system/file_root.hpp" #include "src/buildtool/multithreading/task_system.hpp" #include "test/buildtool/build_engine/base_maps/test_repo.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 b61bcbd4..4096e505 100644 --- a/test/buildtool/build_engine/base_maps/source_map.test.cpp +++ b/test/buildtool/build_engine/base_maps/source_map.test.cpp @@ -14,13 +14,18 @@ #include <filesystem> #include <memory> +#include <optional> +#include <string> #include <utility> #include "catch2/catch_test_macros.hpp" +#include "nlohmann/json.hpp" #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" #include "src/buildtool/multithreading/task_system.hpp" #include "test/buildtool/build_engine/base_maps/test_repo.hpp" diff --git a/test/buildtool/build_engine/base_maps/test_repo.hpp b/test/buildtool/build_engine/base_maps/test_repo.hpp index d3a04d41..7190f081 100644 --- a/test/buildtool/build_engine/base_maps/test_repo.hpp +++ b/test/buildtool/build_engine/base_maps/test_repo.hpp @@ -15,7 +15,11 @@ #ifndef INCLUDED_SRC_TEST_BUILDTOOL_BUILD_ENGINE_BASE_MAPS_TEST_REPO_HPP #define INCLUDED_SRC_TEST_BUILDTOOL_BUILD_ENGINE_BASE_MAPS_TEST_REPO_HPP +#include <atomic> +#include <cstdlib> #include <filesystem> +#include <optional> +#include <string> #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" diff --git a/test/buildtool/build_engine/expression/configuration.test.cpp b/test/buildtool/build_engine/expression/configuration.test.cpp index 47ad8084..7f54748d 100644 --- a/test/buildtool/build_engine/expression/configuration.test.cpp +++ b/test/buildtool/build_engine/expression/configuration.test.cpp @@ -12,10 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#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" TEST_CASE("Access", "[configuration]") { diff --git a/test/buildtool/build_engine/expression/expression.test.cpp b/test/buildtool/build_engine/expression/expression.test.cpp index 83257bf8..83cd48ce 100644 --- a/test/buildtool/build_engine/expression/expression.test.cpp +++ b/test/buildtool/build_engine/expression/expression.test.cpp @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <filesystem> +#include <string> +#include <vector> + #include "catch2/catch_test_macros.hpp" #include "catch2/matchers/catch_matchers_all.hpp" #include "src/buildtool/build_engine/expression/configuration.hpp" diff --git a/test/buildtool/build_engine/expression/linked_map.test.cpp b/test/buildtool/build_engine/expression/linked_map.test.cpp index dd15a5b0..0dfe7b72 100644 --- a/test/buildtool/build_engine/expression/linked_map.test.cpp +++ b/test/buildtool/build_engine/expression/linked_map.test.cpp @@ -13,6 +13,10 @@ // limitations under the License. #include <algorithm> +#include <cstddef> +#include <memory> +#include <string> +#include <utility> // std::move #include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/expression/linked_map.hpp" diff --git a/test/buildtool/build_engine/target_map/TARGETS b/test/buildtool/build_engine/target_map/TARGETS index 877c3b76..c4c1a456 100644 --- a/test/buildtool/build_engine/target_map/TARGETS +++ b/test/buildtool/build_engine/target_map/TARGETS @@ -5,9 +5,13 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "json", "", "json"] + , ["@", "src", "src/buildtool/build_engine/expression", "expression"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] + , ["@", "src", "src/buildtool/build_engine/analysed_target", "target"] , ["@", "src", "src/buildtool/build_engine/target_map", "result_map"] , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/buildtool/common", "action_description"] , ["@", "src", "src/buildtool/progress_reporting", "progress"] ] , "stage": ["test", "buildtool", "build_engine", "target_map"] @@ -26,6 +30,7 @@ , ["@", "src", "src/buildtool/build_engine/base_maps", "targets_file_map"] , ["@", "src", "src/buildtool/build_engine/target_map", "target_map"] , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/buildtool/file_system", "file_root"] , ["@", "src", "src/buildtool/progress_reporting", "progress"] , ["@", "src", "src/buildtool/storage", "storage"] , ["utils", "local_hermeticity"] 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 7f23942b..56fbfbd6 100644 --- a/test/buildtool/build_engine/target_map/result_map.test.cpp +++ b/test/buildtool/build_engine/target_map/result_map.test.cpp @@ -15,11 +15,16 @@ #include <cstdlib> #include <filesystem> #include <fstream> +#include <memory> #include <string> #include <vector> #include "catch2/catch_test_macros.hpp" +#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" #include "src/buildtool/progress_reporting/progress.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 b7a3a1e7..99f0481a 100644 --- a/test/buildtool/build_engine/target_map/target_map.test.cpp +++ b/test/buildtool/build_engine/target_map/target_map.test.cpp @@ -13,6 +13,8 @@ // limitations under the License. #include <filesystem> +#include <string> +#include <utility> // std::move #include "catch2/catch_test_macros.hpp" #include "src/buildtool/build_engine/base_maps/directory_map.hpp" @@ -24,6 +26,7 @@ #include "src/buildtool/build_engine/expression/expression.hpp" #include "src/buildtool/build_engine/target_map/target_map.hpp" #include "src/buildtool/common/statistics.hpp" +#include "src/buildtool/file_system/file_root.hpp" #include "src/buildtool/multithreading/async_map_consumer.hpp" #include "src/buildtool/multithreading/task_system.hpp" #include "src/buildtool/progress_reporting/progress.hpp" diff --git a/test/buildtool/common/TARGETS b/test/buildtool/common/TARGETS index 71cddce1..75209401 100644 --- a/test/buildtool/common/TARGETS +++ b/test/buildtool/common/TARGETS @@ -5,7 +5,9 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "json", "", "json"] , ["@", "src", "src/buildtool/common", "artifact_factory"] + , ["@", "src", "src/buildtool/file_system", "object_type"] ] , "stage": ["test", "buildtool", "common"] } @@ -18,6 +20,8 @@ , ["", "catch-main"] , ["@", "src", "src/buildtool/common", "artifact_factory"] , ["@", "src", "src/buildtool/common", "artifact_description"] + , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/buildtool/file_system", "object_type"] ] , "stage": ["test", "buildtool", "common"] } @@ -28,8 +32,10 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "json", "", "json"] , ["@", "src", "src/buildtool/common", "artifact_factory"] , ["@", "src", "src/buildtool/common", "action_description"] + , ["@", "src", "src/buildtool/common", "common"] ] , "stage": ["test", "buildtool", "common"] } @@ -40,7 +46,11 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "json", "", "json"] , ["@", "src", "src/buildtool/common", "config"] + , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/buildtool/file_system", "file_root"] + , ["@", "src", "src/buildtool/file_system", "file_system_manager"] , ["utils", "local_hermeticity"] , ["@", "src", "src/buildtool/execution_api/local", "local"] ] @@ -53,7 +63,9 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "json", "", "json"] , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/buildtool/file_system", "object_type"] ] , "stage": ["test", "buildtool", "common"] } diff --git a/test/buildtool/common/action_description.test.cpp b/test/buildtool/common/action_description.test.cpp index b32e6914..61361c58 100644 --- a/test/buildtool/common/action_description.test.cpp +++ b/test/buildtool/common/action_description.test.cpp @@ -12,7 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#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_factory.hpp" diff --git a/test/buildtool/common/artifact_description.test.cpp b/test/buildtool/common/artifact_description.test.cpp index 868e60c1..60d62961 100644 --- a/test/buildtool/common/artifact_description.test.cpp +++ b/test/buildtool/common/artifact_description.test.cpp @@ -12,9 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <filesystem> +#include <string> + #include "catch2/catch_test_macros.hpp" +#include "src/buildtool/common/artifact.hpp" #include "src/buildtool/common/artifact_description.hpp" #include "src/buildtool/common/artifact_factory.hpp" +#include "src/buildtool/file_system/object_type.hpp" [[nodiscard]] auto operator==(Artifact const& lhs, Artifact const& rhs) -> bool { diff --git a/test/buildtool/common/artifact_factory.test.cpp b/test/buildtool/common/artifact_factory.test.cpp index a71a5b63..64a6c782 100644 --- a/test/buildtool/common/artifact_factory.test.cpp +++ b/test/buildtool/common/artifact_factory.test.cpp @@ -12,8 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <string> + #include "catch2/catch_test_macros.hpp" +#include "nlohmann/json.hpp" #include "src/buildtool/common/artifact_factory.hpp" +#include "src/buildtool/file_system/object_type.hpp" TEST_CASE("Description missing mandatory key/value pair", "[artifact_factory]") { diff --git a/test/buildtool/common/artifact_object_info.test.cpp b/test/buildtool/common/artifact_object_info.test.cpp index fde2e506..cd78dd96 100644 --- a/test/buildtool/common/artifact_object_info.test.cpp +++ b/test/buildtool/common/artifact_object_info.test.cpp @@ -13,7 +13,10 @@ // limitations under the License. #include "catch2/catch_test_macros.hpp" +#include "nlohmann/json.hpp" #include "src/buildtool/common/artifact.hpp" +#include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/file_system/object_type.hpp" TEST_CASE("Consistency check for serialization and de-serialization", "[object_info]") { diff --git a/test/buildtool/common/repository_config.test.cpp b/test/buildtool/common/repository_config.test.cpp index 6eaec044..e4b4fd8d 100644 --- a/test/buildtool/common/repository_config.test.cpp +++ b/test/buildtool/common/repository_config.test.cpp @@ -12,8 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <atomic> +#include <cstddef> +#include <filesystem> +#include <map> +#include <string> +#include <unordered_map> +#include <utility> // std::move +#include <vector> + #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/storage.hpp" #include "test/utils/hermeticity/local.hpp" diff --git a/test/buildtool/crypto/hash_function.test.cpp b/test/buildtool/crypto/hash_function.test.cpp index 340384e7..ccee68aa 100644 --- a/test/buildtool/crypto/hash_function.test.cpp +++ b/test/buildtool/crypto/hash_function.test.cpp @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <string> +#include <utility> // std::move + #include "catch2/catch_test_macros.hpp" #include "src/buildtool/crypto/hash_function.hpp" diff --git a/test/buildtool/crypto/hasher.test.cpp b/test/buildtool/crypto/hasher.test.cpp index 26cc8568..0ee0cca1 100644 --- a/test/buildtool/crypto/hasher.test.cpp +++ b/test/buildtool/crypto/hasher.test.cpp @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <string> +#include <utility> // std::move + #include "catch2/catch_test_macros.hpp" #include "src/buildtool/crypto/hasher.hpp" diff --git a/test/buildtool/execution_api/bazel/TARGETS b/test/buildtool/execution_api/bazel/TARGETS index 4a2187c3..bf852e0e 100644 --- a/test/buildtool/execution_api/bazel/TARGETS +++ b/test/buildtool/execution_api/bazel/TARGETS @@ -5,8 +5,11 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["utils", "catch-main-remote-execution"] + , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/buildtool/execution_api/bazel_msg", "bazel_msg"] , ["@", "src", "src/buildtool/execution_api/remote", "bazel_network"] , ["@", "src", "src/buildtool/execution_api/remote", "config"] + , ["@", "src", "src/buildtool/file_system", "object_type"] ] , "stage": ["test", "buildtool", "execution_api", "bazel"] } @@ -18,7 +21,10 @@ [ ["@", "catch2", "", "catch2"] , ["utils", "catch-main-remote-execution"] , ["utils", "execution_bazel"] + , ["@", "src", "src/buildtool/common", "common"] , ["@", "src", "src/buildtool/execution_api/remote", "bazel_network"] + , ["@", "src", "src/buildtool/execution_api/remote", "config"] + , ["@", "src", "src/buildtool/file_system", "object_type"] ] , "stage": ["test", "buildtool", "execution_api", "bazel"] } @@ -30,7 +36,11 @@ [ ["@", "catch2", "", "catch2"] , ["utils", "catch-main-remote-execution"] , ["utils", "execution_bazel"] + , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/buildtool/execution_api/bazel_msg", "bazel_msg"] , ["@", "src", "src/buildtool/execution_api/remote", "bazel_network"] + , ["@", "src", "src/buildtool/execution_api/remote", "config"] + , ["@", "src", "src/buildtool/file_system", "object_type"] ] , "stage": ["test", "buildtool", "execution_api", "bazel"] } @@ -42,7 +52,12 @@ [ ["@", "catch2", "", "catch2"] , ["utils", "catch-main-remote-execution"] , ["utils", "execution_bazel"] + , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/buildtool/compatibility", "compatibility"] + , ["@", "src", "src/buildtool/execution_api/bazel_msg", "bazel_msg"] , ["@", "src", "src/buildtool/execution_api/remote", "bazel_network"] + , ["@", "src", "src/buildtool/execution_api/remote", "config"] + , ["@", "src", "src/buildtool/file_system", "object_type"] ] , "stage": ["test", "buildtool", "execution_api", "bazel"] } 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 d120360b..ffbe798a 100644 --- a/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp @@ -12,12 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <functional> // std::equal_to #include <string> +#include <vector> #include "catch2/catch_test_macros.hpp" +#include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/execution_api/bazel_msg/bazel_blob.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" TEST_CASE("Bazel internals: CAS Client", "[execution_api]") { auto const& info = RemoteExecutionConfig::RemoteAddress(); 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 cb79fc8d..0848ad32 100755 --- a/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp @@ -15,8 +15,10 @@ #include <string> #include "catch2/catch_test_macros.hpp" +#include "src/buildtool/common/artifact_digest.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" #include "test/utils/test_env.hpp" diff --git a/test/buildtool/execution_api/bazel/bazel_network.test.cpp b/test/buildtool/execution_api/bazel/bazel_network.test.cpp index 80714b97..240e3a16 100644 --- a/test/buildtool/execution_api/bazel/bazel_network.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_network.test.cpp @@ -12,12 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <cstddef> #include <string> +#include <vector> #include "catch2/catch_test_macros.hpp" +#include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/compatibility/compatibility.hpp" +#include "src/buildtool/execution_api/bazel_msg/bazel_blob.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" constexpr std::size_t kLargeSize = GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH + 1; diff --git a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp index e67afdb2..bf6db6db 100644 --- a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp @@ -12,13 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <cstddef> #include <string> #include "catch2/catch_test_macros.hpp" +#include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob.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" constexpr std::size_t kLargeSize = GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH + 1; diff --git a/test/buildtool/execution_api/common/api_test.hpp b/test/buildtool/execution_api/common/api_test.hpp index 0b74d1af..ac8925f0 100644 --- a/test/buildtool/execution_api/common/api_test.hpp +++ b/test/buildtool/execution_api/common/api_test.hpp @@ -13,7 +13,11 @@ // limitations under the License. #include <cstdlib> +#include <filesystem> +#include <functional> +#include <map> #include <string> +#include <vector> #include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_factory.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 5ddce950..1cdb71f8 100644 --- a/test/buildtool/execution_api/execution_service/cas_server.test.cpp +++ b/test/buildtool/execution_api/execution_service/cas_server.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <string> + #include "catch2/catch_test_macros.hpp" #include "gsl/gsl" #include "src/buildtool/common/artifact_digest.hpp" diff --git a/test/buildtool/execution_api/local/TARGETS b/test/buildtool/execution_api/local/TARGETS index e98e27cc..4b9c7b81 100644 --- a/test/buildtool/execution_api/local/TARGETS +++ b/test/buildtool/execution_api/local/TARGETS @@ -9,6 +9,7 @@ , ["@", "src", "src/buildtool/common", "config"] , ["@", "src", "src/buildtool/execution_api/local", "config"] , ["@", "src", "src/buildtool/execution_api/local", "local"] + , ["@", "src", "src/buildtool/file_system", "file_system_manager"] , ["@", "src", "src/buildtool/logging", "log_level"] , ["@", "src", "src/buildtool/logging", "logging"] , ["utils", "local_hermeticity"] diff --git a/test/buildtool/execution_api/local/local_execution.test.cpp b/test/buildtool/execution_api/local/local_execution.test.cpp index 7b308a59..c55449e0 100644 --- a/test/buildtool/execution_api/local/local_execution.test.cpp +++ b/test/buildtool/execution_api/local/local_execution.test.cpp @@ -13,6 +13,8 @@ // limitations under the License. #include <chrono> +#include <cstdlib> +#include <filesystem> #include <string> #include <vector> @@ -21,6 +23,7 @@ #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/execution_api/local/config.hpp" #include "src/buildtool/execution_api/local/local_api.hpp" +#include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" #include "test/utils/hermeticity/local.hpp" diff --git a/test/buildtool/execution_engine/dag/TARGETS b/test/buildtool/execution_engine/dag/TARGETS index a6ac316a..31bc55cd 100644 --- a/test/buildtool/execution_engine/dag/TARGETS +++ b/test/buildtool/execution_engine/dag/TARGETS @@ -6,7 +6,9 @@ [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] , ["utils", "container_matchers"] + , ["@", "src", "src/buildtool/common", "action_description"] , ["@", "src", "src/buildtool/common", "artifact_factory"] + , ["@", "src", "src/buildtool/common", "common"] , ["@", "src", "src/buildtool/execution_engine/dag", "dag"] ] , "stage": ["test", "buildtool", "execution_engine", "dag"] diff --git a/test/buildtool/execution_engine/dag/dag.test.cpp b/test/buildtool/execution_engine/dag/dag.test.cpp index a9b87554..ad819e43 100644 --- a/test/buildtool/execution_engine/dag/dag.test.cpp +++ b/test/buildtool/execution_engine/dag/dag.test.cpp @@ -12,8 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <cstddef> +#include <map> +#include <string> +#include <vector> + #include "catch2/catch_test_macros.hpp" +#include "src/buildtool/common/action.hpp" +#include "src/buildtool/common/action_description.hpp" #include "src/buildtool/common/artifact_factory.hpp" +#include "src/buildtool/common/identifier.hpp" #include "src/buildtool/execution_engine/dag/dag.hpp" #include "test/utils/container_matchers.hpp" diff --git a/test/buildtool/execution_engine/executor/TARGETS b/test/buildtool/execution_engine/executor/TARGETS index 896b7803..57ef9b44 100644 --- a/test/buildtool/execution_engine/executor/TARGETS +++ b/test/buildtool/execution_engine/executor/TARGETS @@ -18,6 +18,7 @@ , ["@", "src", "src/buildtool/progress_reporting", "progress"] , ["", "catch-main"] , ["@", "catch2", "", "catch2"] + , ["@", "gsl", "", "gsl"] ] , "stage": ["test", "buildtool", "execution_engine", "executor"] } diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index 72bd23bb..790e20ca 100644 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -12,11 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <algorithm> +#include <filesystem> +#include <map> +#include <optional> #include <string> #include <unordered_map> +#include <utility> #include <vector> #include "catch2/catch_test_macros.hpp" +#include "gsl/gsl" #include "src/buildtool/common/artifact_factory.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/common/statistics.hpp" diff --git a/test/buildtool/execution_engine/executor/executor_api.test.hpp b/test/buildtool/execution_engine/executor/executor_api.test.hpp index 634cc38f..1ff50831 100644 --- a/test/buildtool/execution_engine/executor/executor_api.test.hpp +++ b/test/buildtool/execution_engine/executor/executor_api.test.hpp @@ -15,7 +15,12 @@ #ifndef INCLUDED_SRC_TEST_BUILDTOOL_EXECUTION_ENGINE_EXECUTOR_EXECUTOR_API_TEST_HPP #define INCLUDED_SRC_TEST_BUILDTOOL_EXECUTION_ENGINE_EXECUTOR_EXECUTOR_API_TEST_HPP +#include <cstdlib> +#include <filesystem> #include <functional> +#include <map> +#include <string> +#include <vector> #include "catch2/catch_test_macros.hpp" #include "gsl/gsl" diff --git a/test/buildtool/execution_engine/executor/executor_api_local.test.cpp b/test/buildtool/execution_engine/executor/executor_api_local.test.cpp index 26d8993f..670a3fa7 100755 --- a/test/buildtool/execution_engine/executor/executor_api_local.test.cpp +++ b/test/buildtool/execution_engine/executor/executor_api_local.test.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <memory> + #include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/common/statistics.hpp" diff --git a/test/buildtool/file_system/TARGETS b/test/buildtool/file_system/TARGETS index d7101454..8121b39a 100644 --- a/test/buildtool/file_system/TARGETS +++ b/test/buildtool/file_system/TARGETS @@ -7,6 +7,7 @@ [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] + , ["@", "src", "src/buildtool/file_system", "object_type"] , ["@", "src", "src/buildtool/logging", "log_level"] , ["@", "src", "src/buildtool/logging", "logging"] ] @@ -21,6 +22,10 @@ , ["", "catch-main"] , ["@", "src", "src/buildtool/crypto", "hash_function"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] + , ["@", "src", "src/buildtool/file_system", "object_cas"] + , ["@", "src", "src/buildtool/file_system", "object_type"] + , ["@", "src", "src/buildtool/common", "bazel_types"] + , ["@", "src", "src/buildtool/common", "common"] , ["utils", "local_hermeticity"] ] , "stage": ["test", "buildtool", "file_system"] @@ -33,10 +38,15 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "fmt", "", "fmt"] , ["utils", "container_matchers"] + , ["@", "src", "src/buildtool/file_system", "git_cas"] + , ["@", "src", "src/buildtool/file_system", "git_repo"] , ["@", "src", "src/buildtool/file_system", "git_tree"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] + , ["@", "src", "src/buildtool/common", "bazel_types"] , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/utils/cpp", "hex_string"] , ["utils", "shell_quoting"] ] , "stage": ["test", "buildtool", "file_system"] @@ -52,6 +62,7 @@ , ["utils", "container_matchers"] , ["@", "src", "src/buildtool/common", "artifact_description"] , ["@", "src", "src/buildtool/file_system", "file_root"] + , ["@", "src", "src/buildtool/file_system", "file_system_manager"] , ["utils", "shell_quoting"] ] , "stage": ["test", "buildtool", "file_system"] @@ -64,9 +75,11 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "fmt", "", "fmt"] , ["utils", "container_matchers"] , ["@", "src", "src/buildtool/common", "artifact_description"] , ["@", "src", "src/buildtool/file_system", "file_root"] + , ["@", "src", "src/buildtool/file_system", "file_system_manager"] , ["utils", "shell_quoting"] ] , "stage": ["test", "buildtool", "file_system"] @@ -102,8 +115,10 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "fmt", "", "fmt"] , ["@", "json", "", "json"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] + , ["@", "src", "src/buildtool/file_system", "git_cas"] , ["@", "src", "src/buildtool/file_system", "git_repo"] , ["@", "src", "src/buildtool/logging", "log_level"] , ["@", "src", "src/buildtool/logging", "logging"] diff --git a/test/buildtool/file_system/directory_entries.test.cpp b/test/buildtool/file_system/directory_entries.test.cpp index 278f79d6..0de55726 100644 --- a/test/buildtool/file_system/directory_entries.test.cpp +++ b/test/buildtool/file_system/directory_entries.test.cpp @@ -13,11 +13,18 @@ // limitations under the License. #include <atomic> +#include <cstdlib> +#include <filesystem> +#include <optional> +#include <string> #include <thread> +#include <unordered_set> #include "catch2/catch_test_macros.hpp" +#include "fmt/core.h" #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_root.test.cpp b/test/buildtool/file_system/file_root.test.cpp index 8828fb7b..e5f84cfb 100644 --- a/test/buildtool/file_system/file_root.test.cpp +++ b/test/buildtool/file_system/file_root.test.cpp @@ -13,11 +13,15 @@ // limitations under the License. #include <atomic> +#include <cstdlib> +#include <filesystem> +#include <string> #include <thread> #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 18068aec..05fef390 100644 --- a/test/buildtool/file_system/file_system_manager.test.cpp +++ b/test/buildtool/file_system/file_system_manager.test.cpp @@ -19,10 +19,12 @@ #include <fstream> #include <iostream> #include <unordered_map> +#include <vector> #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" diff --git a/test/buildtool/file_system/git_repo.test.cpp b/test/buildtool/file_system/git_repo.test.cpp index 53658b44..e84e7242 100644 --- a/test/buildtool/file_system/git_repo.test.cpp +++ b/test/buildtool/file_system/git_repo.test.cpp @@ -12,11 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <atomic> +#include <cstdlib> +#include <filesystem> +#include <memory> +#include <optional> +#include <string> #include <thread> +#include <variant> +#include <vector> #include "catch2/catch_test_macros.hpp" +#include "fmt/core.h" #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" diff --git a/test/buildtool/file_system/git_tree.test.cpp b/test/buildtool/file_system/git_tree.test.cpp index ec2d5003..82177b45 100644 --- a/test/buildtool/file_system/git_tree.test.cpp +++ b/test/buildtool/file_system/git_tree.test.cpp @@ -12,12 +12,23 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <atomic> +#include <cstdlib> +#include <filesystem> +#include <optional> +#include <string> #include <thread> +#include <vector> #include "catch2/catch_test_macros.hpp" +#include "fmt/core.h" #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/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 3692b5fb..8bdfc0d8 100644 --- a/test/buildtool/file_system/object_cas.test.cpp +++ b/test/buildtool/file_system/object_cas.test.cpp @@ -12,12 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <functional> // std::equal_to #include <string> #include "catch2/catch_test_macros.hpp" +#include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/common/bazel_types.hpp" #include "src/buildtool/crypto/hash_function.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 "test/utils/hermeticity/local.hpp" TEST_CASE_METHOD(HermeticLocalTestFixture, "ObjectCAS", "[file_system]") { diff --git a/test/buildtool/graph_traverser/TARGETS b/test/buildtool/graph_traverser/TARGETS index 77e29e2a..d66ad96a 100644 --- a/test/buildtool/graph_traverser/TARGETS +++ b/test/buildtool/graph_traverser/TARGETS @@ -4,6 +4,7 @@ , "hdrs": ["graph_traverser.test.hpp"] , "deps": [ ["@", "catch2", "", "catch2"] + , ["@", "json", "", "json"] , ["@", "src", "src/buildtool/common", "common"] , ["@", "src", "src/buildtool/execution_api/local", "config"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] diff --git a/test/buildtool/graph_traverser/graph_traverser.test.hpp b/test/buildtool/graph_traverser/graph_traverser.test.hpp index 7e060d09..2ec011d4 100644 --- a/test/buildtool/graph_traverser/graph_traverser.test.hpp +++ b/test/buildtool/graph_traverser/graph_traverser.test.hpp @@ -15,11 +15,17 @@ #ifndef INCLUDED_SRC_TEST_BUILDTOOL_GRAPH_GRAVERSER_GRAPH_TRAVERSER_TEST_HPP #define INCLUDED_SRC_TEST_BUILDTOOL_GRAPH_GRAVERSER_GRAPH_TRAVERSER_TEST_HPP +#include <chrono> +#include <cstdlib> #include <filesystem> #include <sstream> +#include <string> +#include <thread> #include <utility> +#include <vector> #include "catch2/catch_test_macros.hpp" +#include "nlohmann/json.hpp" #include "src/buildtool/common/statistics.hpp" #include "src/buildtool/execution_api/local/config.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" diff --git a/test/buildtool/logging/log_sink_file.test.cpp b/test/buildtool/logging/log_sink_file.test.cpp index bede3f01..069480be 100644 --- a/test/buildtool/logging/log_sink_file.test.cpp +++ b/test/buildtool/logging/log_sink_file.test.cpp @@ -12,9 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <filesystem> #include <fstream> #include <iostream> +#include <string> #include <thread> +#include <vector> #include "catch2/catch_test_macros.hpp" #include "catch2/generators/catch_generators_all.hpp" diff --git a/test/buildtool/logging/logger.test.cpp b/test/buildtool/logging/logger.test.cpp index eac80424..f4a9313d 100644 --- a/test/buildtool/logging/logger.test.cpp +++ b/test/buildtool/logging/logger.test.cpp @@ -15,6 +15,7 @@ #include <atomic> #include <string> #include <unordered_map> +#include <vector> #include "catch2/catch_test_macros.hpp" #include "src/buildtool/logging/log_config.hpp" diff --git a/test/buildtool/main/TARGETS b/test/buildtool/main/TARGETS index 084fcb8e..a8f7541d 100644 --- a/test/buildtool/main/TARGETS +++ b/test/buildtool/main/TARGETS @@ -5,6 +5,7 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "src", "src/buildtool/common", "common"] , ["@", "src", "src/buildtool/main", "install_cas"] ] , "stage": ["test", "buildtool", "main"] diff --git a/test/buildtool/main/install_cas.test.cpp b/test/buildtool/main/install_cas.test.cpp index 6929d446..4d6ef0b8 100644 --- a/test/buildtool/main/install_cas.test.cpp +++ b/test/buildtool/main/install_cas.test.cpp @@ -13,6 +13,7 @@ // limitations under the License. #include "catch2/catch_test_macros.hpp" +#include "src/buildtool/common/artifact.hpp" #include "src/buildtool/main/install_cas.hpp" TEST_CASE("ObjectInfoFromLiberalString", "[artifact]") { diff --git a/test/buildtool/multithreading/async_map_consumer.test.cpp b/test/buildtool/multithreading/async_map_consumer.test.cpp index 4e8df652..fa7038b9 100644 --- a/test/buildtool/multithreading/async_map_consumer.test.cpp +++ b/test/buildtool/multithreading/async_map_consumer.test.cpp @@ -12,9 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <algorithm> // std::transform +#include <atomic> #include <cstdint> // for fixed width integral types +#include <mutex> #include <numeric> +#include <optional> #include <string> +#include <vector> #include "catch2/catch_test_macros.hpp" #include "catch2/matchers/catch_matchers_all.hpp" diff --git a/test/buildtool/multithreading/async_map_node.test.cpp b/test/buildtool/multithreading/async_map_node.test.cpp index 8dd9bf89..782f41ad 100644 --- a/test/buildtool/multithreading/async_map_node.test.cpp +++ b/test/buildtool/multithreading/async_map_node.test.cpp @@ -15,6 +15,7 @@ #include <mutex> #include <string> #include <thread> +#include <vector> #include "catch2/catch_test_macros.hpp" #include "catch2/matchers/catch_matchers_all.hpp" diff --git a/test/buildtool/multithreading/task.test.cpp b/test/buildtool/multithreading/task.test.cpp index cb540def..fab83547 100644 --- a/test/buildtool/multithreading/task.test.cpp +++ b/test/buildtool/multithreading/task.test.cpp @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <functional> +#include <utility> // std::move + #include "catch2/catch_test_macros.hpp" #include "src/buildtool/multithreading/task.hpp" diff --git a/test/buildtool/multithreading/task_system.test.cpp b/test/buildtool/multithreading/task_system.test.cpp index 694158ba..ea0ed41b 100644 --- a/test/buildtool/multithreading/task_system.test.cpp +++ b/test/buildtool/multithreading/task_system.test.cpp @@ -12,12 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <atomic> #include <chrono> +#include <condition_variable> +#include <cstddef> +#include <functional> #include <mutex> #include <numeric> // std::iota #include <string> #include <thread> #include <unordered_set> +#include <vector> #include "catch2/catch_test_macros.hpp" #include "catch2/generators/catch_generators_all.hpp" diff --git a/test/buildtool/serve_api/source_tree_client.test.cpp b/test/buildtool/serve_api/source_tree_client.test.cpp index bc8bfad1..f2620cc5 100644 --- a/test/buildtool/serve_api/source_tree_client.test.cpp +++ b/test/buildtool/serve_api/source_tree_client.test.cpp @@ -13,6 +13,7 @@ // limitations under the License. #include <string> +#include <variant> #include "catch2/catch_test_macros.hpp" #include "src/buildtool/serve_api/remote/config.hpp" diff --git a/test/buildtool/storage/TARGETS b/test/buildtool/storage/TARGETS index 9374bf58..13fc6e22 100644 --- a/test/buildtool/storage/TARGETS +++ b/test/buildtool/storage/TARGETS @@ -17,6 +17,9 @@ [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] , ["utils", "local_hermeticity"] + , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/buildtool/file_system", "file_system_manager"] + , ["@", "src", "src/buildtool/file_system", "object_type"] ] , "stage": ["test", "buildtool", "storage"] } @@ -27,7 +30,10 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "src", "src/buildtool/common", "bazel_types"] + , ["@", "src", "src/buildtool/common", "common"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] + , ["@", "src", "src/buildtool/file_system", "object_type"] , ["utils", "local_hermeticity"] ] , "stage": ["test", "buildtool", "storage"] @@ -40,6 +46,7 @@ [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] + , ["@", "src", "src/buildtool/file_system", "object_type"] , ["@", "src", "src/buildtool/storage", "storage"] , ["@", "src", "src/buildtool/storage", "config"] , ["utils", "local_hermeticity"] diff --git a/test/buildtool/storage/large_object_cas.test.cpp b/test/buildtool/storage/large_object_cas.test.cpp index 1d3b8394..f9a427f8 100644 --- a/test/buildtool/storage/large_object_cas.test.cpp +++ b/test/buildtool/storage/large_object_cas.test.cpp @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <cstddef> #include <cstdint> #include <cstdlib> #include <filesystem> @@ -28,6 +29,7 @@ #include "src/buildtool/compatibility/native_support.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 "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/large_object_cas.hpp" #include "src/buildtool/storage/storage.hpp" diff --git a/test/buildtool/storage/local_ac.test.cpp b/test/buildtool/storage/local_ac.test.cpp index a5da6201..4092ca1d 100644 --- a/test/buildtool/storage/local_ac.test.cpp +++ b/test/buildtool/storage/local_ac.test.cpp @@ -16,7 +16,10 @@ #include "catch2/catch_test_macros.hpp" #include "gsl/gsl" +#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_type.hpp" #include "src/buildtool/storage/storage.hpp" #include "test/utils/hermeticity/local.hpp" diff --git a/test/buildtool/storage/local_cas.test.cpp b/test/buildtool/storage/local_cas.test.cpp index a5f6876f..5f481b07 100644 --- a/test/buildtool/storage/local_cas.test.cpp +++ b/test/buildtool/storage/local_cas.test.cpp @@ -12,10 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <filesystem> #include <string> #include "catch2/catch_test_macros.hpp" -#include "src/buildtool/storage/storage.hpp" +#include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/file_system/file_system_manager.hpp" +#include "src/buildtool/file_system/object_type.hpp" #include "test/utils/hermeticity/local.hpp" TEST_CASE_METHOD(HermeticLocalTestFixture, diff --git a/test/buildtool/system/TARGETS b/test/buildtool/system/TARGETS index fb501d81..bc6610b7 100644 --- a/test/buildtool/system/TARGETS +++ b/test/buildtool/system/TARGETS @@ -5,6 +5,7 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "src", "src/buildtool/file_system", "file_system_manager"] , ["@", "src", "src/buildtool/system", "system_command"] ] , "stage": ["test", "buildtool", "system"] diff --git a/test/buildtool/system/system_command.test.cpp b/test/buildtool/system/system_command.test.cpp index e14a7657..5e16d02e 100644 --- a/test/buildtool/system/system_command.test.cpp +++ b/test/buildtool/system/system_command.test.cpp @@ -13,10 +13,13 @@ // limitations under the License. #include <cstdlib> +#include <filesystem> #include <iostream> +#include <string> #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 { diff --git a/test/end-to-end/just-mr/TARGETS b/test/end-to-end/just-mr/TARGETS index a5219153..a1bb74b6 100644 --- a/test/end-to-end/just-mr/TARGETS +++ b/test/end-to-end/just-mr/TARGETS @@ -24,6 +24,7 @@ , "srcs": ["create_test_archives.cpp"] , "private-deps": [ ["@", "src", "src/buildtool/file_system", "file_system_manager"] + , ["@", "src", "src/buildtool/file_system", "object_type"] , ["@", "src", "src/buildtool/logging", "log_level"] , ["@", "src", "src/buildtool/logging", "logging"] , ["@", "src", "src/utils/archive", "archive_ops"] diff --git a/test/end-to-end/just-mr/create_test_archives.cpp b/test/end-to-end/just-mr/create_test_archives.cpp index 93f3f3e7..c860c872 100644 --- a/test/end-to-end/just-mr/create_test_archives.cpp +++ b/test/end-to-end/just-mr/create_test_archives.cpp @@ -12,9 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <cstdlib> +#include <optional> +#include <string> #include <unordered_map> +#include <utility> // std::pair #include "src/buildtool/file_system/file_system_manager.hpp" +#include "src/buildtool/file_system/object_type.hpp" #include "src/buildtool/logging/log_config.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/log_sink_cmdline.hpp" diff --git a/test/main.cpp b/test/main.cpp index 1c685447..7b50aef6 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -14,6 +14,7 @@ #include <cstdlib> #include <filesystem> +#include <string> #include "catch2/catch_session.hpp" #include "src/buildtool/file_system/git_context.hpp" diff --git a/test/other_tools/git_operations/TARGETS b/test/other_tools/git_operations/TARGETS index 41f9df1c..9fa94906 100644 --- a/test/other_tools/git_operations/TARGETS +++ b/test/other_tools/git_operations/TARGETS @@ -6,6 +6,7 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "fmt", "", "fmt"] , ["@", "json", "", "json"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] , ["@", "src", "src/other_tools/ops_maps", "critical_git_op_map"] @@ -29,6 +30,7 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "fmt", "", "fmt"] , ["@", "json", "", "json"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] , ["@", "src", "src/buildtool/logging", "log_level"] diff --git a/test/other_tools/git_operations/critical_git_ops.test.cpp b/test/other_tools/git_operations/critical_git_ops.test.cpp index cfd651c4..231c61d7 100644 --- a/test/other_tools/git_operations/critical_git_ops.test.cpp +++ b/test/other_tools/git_operations/critical_git_ops.test.cpp @@ -12,9 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <algorithm> // std::find +#include <atomic> +#include <cstdlib> // std::system +#include <filesystem> +#include <optional> +#include <string> #include <thread> +#include <vector> #include "catch2/catch_test_macros.hpp" +#include "fmt/core.h" #include "nlohmann/json.hpp" #include "src/buildtool/execution_api/common/execution_common.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" diff --git a/test/other_tools/git_operations/git_config_run.test.cpp b/test/other_tools/git_operations/git_config_run.test.cpp index 50f859d7..1e72c7da 100644 --- a/test/other_tools/git_operations/git_config_run.test.cpp +++ b/test/other_tools/git_operations/git_config_run.test.cpp @@ -15,6 +15,8 @@ #include <exception> #include <filesystem> #include <functional> +#include <memory> +#include <optional> #include <string> #include "src/buildtool/file_system/git_context.hpp" 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 c781f61b..0a970db8 100644 --- a/test/other_tools/git_operations/git_repo_remote.test.cpp +++ b/test/other_tools/git_operations/git_repo_remote.test.cpp @@ -12,9 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <atomic> +#include <cstdlib> +#include <filesystem> +#include <memory> +#include <optional> +#include <string> #include <thread> #include "catch2/catch_test_macros.hpp" +#include "fmt/core.h" #include "nlohmann/json.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/logging/log_level.hpp" diff --git a/test/other_tools/just_mr/TARGETS b/test/other_tools/just_mr/TARGETS index fe423332..fd545232 100644 --- a/test/other_tools/just_mr/TARGETS +++ b/test/other_tools/just_mr/TARGETS @@ -5,6 +5,7 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] + , ["@", "src", "src/buildtool/build_engine/expression", "expression"] , ["@", "src", "src/other_tools/just_mr", "rc_merge"] ] , "stage": ["test", "other_tools", "just_mr"] diff --git a/test/other_tools/just_mr/mirrors.test.cpp b/test/other_tools/just_mr/mirrors.test.cpp index 926de549..5e2a6e9e 100644 --- a/test/other_tools/just_mr/mirrors.test.cpp +++ b/test/other_tools/just_mr/mirrors.test.cpp @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <string> #include <vector> #include "catch2/catch_test_macros.hpp" diff --git a/test/other_tools/just_mr/rc_merge.test.cpp b/test/other_tools/just_mr/rc_merge.test.cpp index 72dad36f..98302eae 100644 --- a/test/other_tools/just_mr/rc_merge.test.cpp +++ b/test/other_tools/just_mr/rc_merge.test.cpp @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#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 "src/other_tools/just_mr/rc_merge.hpp" TEST_CASE("Simple field") { diff --git a/test/other_tools/utils/curl_usage.test.cpp b/test/other_tools/utils/curl_usage.test.cpp index 742026b6..d3b3fd49 100644 --- a/test/other_tools/utils/curl_usage.test.cpp +++ b/test/other_tools/utils/curl_usage.test.cpp @@ -12,6 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <cstdlib> +#include <filesystem> +#include <string> +#include <vector> // std::erase_if + #include "catch2/catch_test_macros.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/other_tools/utils/curl_context.hpp" diff --git a/test/utils/TARGETS b/test/utils/TARGETS index df238ca5..bbbd363d 100644 --- a/test/utils/TARGETS +++ b/test/utils/TARGETS @@ -12,6 +12,7 @@ , "deps": [ ["@", "gsl", "", "gsl"] , ["@", "src", "src/buildtool/execution_api/remote", "bazel_network"] + , ["@", "src", "src/buildtool/common", "bazel_types"] ] , "stage": ["test", "utils"] } diff --git a/test/utils/archive/archive_usage.test.cpp b/test/utils/archive/archive_usage.test.cpp index 1be69139..bd7a3851 100644 --- a/test/utils/archive/archive_usage.test.cpp +++ b/test/utils/archive/archive_usage.test.cpp @@ -12,11 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <cstddef> +#include <cstdint> #include <cstdlib> +#include <filesystem> +#include <optional> #include <string> #include <unordered_map> #include <vector> +#ifdef __unix__ +#include <sys/types.h> // ssize_t +#else +#error "Non-unix is not supported yet" +#endif + #include "catch2/catch_test_macros.hpp" #include "catch2/generators/catch_generators_all.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" @@ -32,7 +42,7 @@ namespace { using file_t = std::pair</*content*/ std::string, mode_t>; using filetree_t = std::unordered_map<std::string, file_t>; -constexpr size_t kBlockSize = 10240; +constexpr std::size_t kBlockSize = 10240; constexpr int kFilePerm = 0644; constexpr int kDirectoryPerm = 0755; @@ -109,7 +119,7 @@ std::vector<archive_test_info_t> const kTestScenarios = { archive_entry* entry{}; while (archive_read_next_header(a, &entry) == ARCHIVE_OK) { auto size = archive_entry_size(entry); - auto buf = std::string(static_cast<size_t>(size), '\0'); + auto buf = std::string(static_cast<std::size_t>(size), '\0'); REQUIRE(archive_read_data(a, buf.data(), buf.size()) == static_cast<ssize_t>(buf.size())); result.emplace(archive_entry_pathname(entry), @@ -171,7 +181,7 @@ void extract_archive(std::string const& path) { REQUIRE(archive_write_header(out, entry) == ARCHIVE_OK); if (archive_entry_size(entry) > 0) { void const* buf{}; - size_t size{}; + std::size_t size{}; int64_t offset{}; int r2{}; while ((r2 = archive_read_data_block(a, &buf, &size, &offset)) == @@ -322,8 +332,8 @@ TEST_CASE("Archive write disk context", "[archive_context]") { TEST_CASE("Read-write archives", "[archive_read_write]") { // get the scenario - auto test_index = - GENERATE(Catch::Generators::range<size_t>(0, kTestScenarios.size())); + auto test_index = GENERATE( + Catch::Generators::range<std::size_t>(0, kTestScenarios.size())); auto const& scenario = kTestScenarios[test_index]; // perform the test @@ -375,8 +385,8 @@ TEST_CASE("Read-write archives", "[archive_read_write]") { TEST_CASE("ArchiveOps", "[archive_ops]") { // get the scenario - auto test_index = - GENERATE(Catch::Generators::range<size_t>(0, kTestScenarios.size())); + auto test_index = GENERATE( + Catch::Generators::range<std::size_t>(0, kTestScenarios.size())); auto const& scenario = kTestScenarios[test_index]; // perform the test diff --git a/test/utils/cpp/file_locking.test.cpp b/test/utils/cpp/file_locking.test.cpp index b313a21f..50b4fe63 100644 --- a/test/utils/cpp/file_locking.test.cpp +++ b/test/utils/cpp/file_locking.test.cpp @@ -12,7 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <atomic> +#include <chrono> +#include <cstdlib> +#include <filesystem> +#include <string> #include <thread> +#include <vector> #include "catch2/catch_test_macros.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" diff --git a/test/utils/hermeticity/local.hpp b/test/utils/hermeticity/local.hpp index 6716f4b1..1d4a0644 100644 --- a/test/utils/hermeticity/local.hpp +++ b/test/utils/hermeticity/local.hpp @@ -15,6 +15,8 @@ #ifndef INCLUDED_SRC_TEST_UTILS_HERMETICITY_LOCAL_HPP #define INCLUDED_SRC_TEST_UTILS_HERMETICITY_LOCAL_HPP +#include <cstdlib> + #include "src/buildtool/common/statistics.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/logging/log_level.hpp" diff --git a/test/utils/logging/log_config.hpp b/test/utils/logging/log_config.hpp index 54095469..816e73b9 100644 --- a/test/utils/logging/log_config.hpp +++ b/test/utils/logging/log_config.hpp @@ -16,6 +16,8 @@ #define INCLUDED_SRC_TEST_UTILS_LOGGING_LOG_CONFIG_HPP #include <cstdlib> +#include <exception> +#include <string> // std::stoul #include "src/buildtool/logging/log_config.hpp" #include "src/buildtool/logging/log_level.hpp" diff --git a/test/utils/remote_execution/bazel_action_creator.hpp b/test/utils/remote_execution/bazel_action_creator.hpp index 1fdc86c2..090f6425 100644 --- a/test/utils/remote_execution/bazel_action_creator.hpp +++ b/test/utils/remote_execution/bazel_action_creator.hpp @@ -15,11 +15,14 @@ #ifndef INCLUDED_SRC_TEST_UTILS_REMOTE_EXECUTION_ACTION_CREATOR_HPP #define INCLUDED_SRC_TEST_UTILS_REMOTE_EXECUTION_ACTION_CREATOR_HPP +#include <algorithm> // std::transform, std::copy +#include <map> #include <memory> #include <string> #include <vector> #include "gsl/gsl" +#include "src/buildtool/common/bazel_types.hpp" #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp" #include "src/buildtool/execution_api/remote/config.hpp" diff --git a/test/utils/serve_service/main-serve.cpp b/test/utils/serve_service/main-serve.cpp index 808e1e6a..537293d2 100644 --- a/test/utils/serve_service/main-serve.cpp +++ b/test/utils/serve_service/main-serve.cpp @@ -18,6 +18,7 @@ #include <filesystem> #include <iostream> #include <sstream> +#include <string> #include <thread> #include "catch2/catch_session.hpp" |