diff options
Diffstat (limited to 'test/utils')
-rw-r--r-- | test/utils/TARGETS | 26 | ||||
-rw-r--r-- | test/utils/archive/archive_usage.test.cpp | 14 | ||||
-rw-r--r-- | test/utils/container_matchers.hpp | 4 | ||||
-rw-r--r-- | test/utils/cpp/file_locking.test.cpp | 2 | ||||
-rw-r--r-- | test/utils/cpp/path.test.cpp | 1 | ||||
-rw-r--r-- | test/utils/cpp/path_rebase.test.cpp | 3 | ||||
-rw-r--r-- | test/utils/cpp/prefix.test.cpp | 2 | ||||
-rw-r--r-- | test/utils/executor/test_api_bundle.hpp | 2 | ||||
-rw-r--r-- | test/utils/hermeticity/test_hash_function_type.hpp | 2 | ||||
-rw-r--r-- | test/utils/hermeticity/test_storage_config.hpp | 3 | ||||
-rw-r--r-- | test/utils/large_objects/large_object_utils.cpp | 2 | ||||
-rw-r--r-- | test/utils/logging/log_config.hpp | 1 | ||||
-rw-r--r-- | test/utils/remote_execution/bazel_action_creator.hpp | 6 | ||||
-rw-r--r-- | test/utils/remote_execution/main-remote-execution.cpp | 9 | ||||
-rw-r--r-- | test/utils/remote_execution/test_auth_config.hpp | 3 | ||||
-rw-r--r-- | test/utils/remote_execution/test_remote_config.hpp | 2 | ||||
-rw-r--r-- | test/utils/serve_service/main-serve.cpp | 11 | ||||
-rw-r--r-- | test/utils/serve_service/test_serve_config.hpp | 4 | ||||
-rw-r--r-- | test/utils/test_env.hpp | 6 |
19 files changed, 53 insertions, 50 deletions
diff --git a/test/utils/TARGETS b/test/utils/TARGETS index d94feaa2..21e4fb9f 100644 --- a/test/utils/TARGETS +++ b/test/utils/TARGETS @@ -14,13 +14,16 @@ , "test_env" , "test_remote_config" , ["@", "gsl", "", "gsl"] - , ["@", "src", "src/buildtool/auth", "auth"] + , ["@", "protoc", "", "libprotobuf"] , ["@", "src", "src/buildtool/common", "bazel_digest_factory"] , ["@", "src", "src/buildtool/common", "bazel_types"] + , ["@", "src", "src/buildtool/common/remote", "remote_common"] , ["@", "src", "src/buildtool/common/remote", "retry_config"] , ["@", "src", "src/buildtool/crypto", "hash_function"] + , ["@", "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", "utils"] } @@ -38,11 +41,6 @@ { "type": ["@", "rules", "CC", "library"] , "name": ["test_env"] , "hdrs": ["test_env.hpp"] - , "deps": - [ "log_config" - , ["@", "src", "src/buildtool/auth", "auth"] - , ["@", "src", "src/buildtool/common", "protocol_traits"] - ] , "stage": ["test", "utils"] } , "test_storage_config": @@ -52,10 +50,10 @@ , "deps": [ "test_hash_function_type" , ["@", "gsl", "", "gsl"] - , ["@", "src", "src/buildtool/common", "protocol_traits"] , ["@", "src", "src/buildtool/logging", "log_level"] , ["@", "src", "src/buildtool/logging", "logging"] , ["@", "src", "src/buildtool/storage", "config"] + , ["@", "src", "src/utils/cpp", "expected"] , ["@", "src", "src/utils/cpp", "tmp_dir"] ] , "stage": ["test", "utils"] @@ -93,11 +91,10 @@ , "test_env" , "test_remote_config" , ["@", "catch2", "", "catch2"] + , ["@", "src", "src/buildtool/auth", "auth"] + , ["@", "src", "src/buildtool/common/remote", "remote_common"] , ["@", "src", "src/buildtool/execution_api/remote", "config"] - , ["@", "src", "src/buildtool/file_system", "file_system_manager"] , ["@", "src", "src/buildtool/file_system", "git_context"] - , ["@", "src", "src/buildtool/logging", "log_level"] - , ["@", "src", "src/buildtool/logging", "logging"] ] , "stage": ["test", "utils"] } @@ -110,6 +107,7 @@ , ["@", "src", "src/buildtool/logging", "log_level"] , ["@", "src", "src/buildtool/logging", "logging"] , ["@", "src", "src/buildtool/serve_api/remote", "config"] + , ["@", "src", "src/utils/cpp", "expected"] ] , "stage": ["test", "utils"] } @@ -122,6 +120,7 @@ , ["@", "src", "src/buildtool/auth", "auth"] , ["@", "src", "src/buildtool/logging", "log_level"] , ["@", "src", "src/buildtool/logging", "logging"] + , ["@", "src", "src/utils/cpp", "expected"] ] , "stage": ["test", "utils"] } @@ -134,6 +133,7 @@ , ["@", "src", "src/buildtool/execution_api/remote", "config"] , ["@", "src", "src/buildtool/logging", "log_level"] , ["@", "src", "src/buildtool/logging", "logging"] + , ["@", "src", "src/utils/cpp", "expected"] ] , "stage": ["test", "utils"] } @@ -147,14 +147,12 @@ , "test_env" , "test_serve_config" , ["@", "catch2", "", "catch2"] - , ["@", "src", "src/buildtool/common", "protocol_traits"] - , ["@", "src", "src/buildtool/execution_api/remote", "config"] - , ["@", "src", "src/buildtool/file_system", "file_system_manager"] + , ["@", "fmt", "", "fmt"] + , ["@", "src", "src/buildtool/common/remote", "remote_common"] , ["@", "src", "src/buildtool/file_system", "git_context"] , ["@", "src", "src/buildtool/logging", "log_level"] , ["@", "src", "src/buildtool/logging", "logging"] , ["@", "src", "src/buildtool/serve_api/remote", "config"] - , ["@", "src", "src/buildtool/storage", "storage"] ] , "stage": ["test", "utils"] } diff --git a/test/utils/archive/archive_usage.test.cpp b/test/utils/archive/archive_usage.test.cpp index 23313620..030cd223 100644 --- a/test/utils/archive/archive_usage.test.cpp +++ b/test/utils/archive/archive_usage.test.cpp @@ -12,21 +12,23 @@ // See the License for the specific language governing permissions and // limitations under the License. +#ifdef __unix__ +#include <sys/types.h> // ssize_t +#else +#error "Non-unix is not supported yet" +#endif + #include <cstddef> #include <cstdint> #include <cstdlib> #include <filesystem> +#include <functional> #include <optional> #include <string> #include <unordered_map> +#include <utility> #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" diff --git a/test/utils/container_matchers.hpp b/test/utils/container_matchers.hpp index 7def6d57..d7a29c3a 100644 --- a/test/utils/container_matchers.hpp +++ b/test/utils/container_matchers.hpp @@ -16,14 +16,14 @@ #define INCLUDED_SRC_TEST_UTILS_CONTAINER_MATCHERS_HPP #include <algorithm> +#include <initializer_list> +#include <iterator> #include <numeric> #include <sstream> #include <string> -#include <type_traits> #include <unordered_set> #include <vector> -#include "catch2/catch_test_macros.hpp" #include "catch2/matchers/catch_matchers_all.hpp" /// \brief Matcher to check if the sets of elements present in two different diff --git a/test/utils/cpp/file_locking.test.cpp b/test/utils/cpp/file_locking.test.cpp index b5e38a9c..45b2a056 100644 --- a/test/utils/cpp/file_locking.test.cpp +++ b/test/utils/cpp/file_locking.test.cpp @@ -14,10 +14,10 @@ #include "src/utils/cpp/file_locking.hpp" -#include <atomic> #include <chrono> #include <cstdlib> #include <filesystem> +#include <optional> #include <string> #include <thread> #include <vector> diff --git a/test/utils/cpp/path.test.cpp b/test/utils/cpp/path.test.cpp index ecfc64c1..b0d67499 100644 --- a/test/utils/cpp/path.test.cpp +++ b/test/utils/cpp/path.test.cpp @@ -15,6 +15,7 @@ #include "src/utils/cpp/path.hpp" #include <filesystem> +#include <string> #include "catch2/catch_test_macros.hpp" diff --git a/test/utils/cpp/path_rebase.test.cpp b/test/utils/cpp/path_rebase.test.cpp index fe62e0be..d0d0b7e7 100644 --- a/test/utils/cpp/path_rebase.test.cpp +++ b/test/utils/cpp/path_rebase.test.cpp @@ -14,6 +14,9 @@ #include "src/utils/cpp/path_rebase.hpp" +#include <string> +#include <vector> + #include "catch2/catch_test_macros.hpp" TEST_CASE("rebase", "[path_rebase]") { diff --git a/test/utils/cpp/prefix.test.cpp b/test/utils/cpp/prefix.test.cpp index ae47c93d..5ddd9754 100644 --- a/test/utils/cpp/prefix.test.cpp +++ b/test/utils/cpp/prefix.test.cpp @@ -14,7 +14,7 @@ #include "src/utils/cpp/prefix.hpp" -#include <filesystem> +#include <string> #include "catch2/catch_test_macros.hpp" diff --git a/test/utils/executor/test_api_bundle.hpp b/test/utils/executor/test_api_bundle.hpp index 088c4323..5a27f556 100644 --- a/test/utils/executor/test_api_bundle.hpp +++ b/test/utils/executor/test_api_bundle.hpp @@ -15,8 +15,6 @@ #ifndef INCLUDED_SRC_TEST_UTILS_EXECUTOR_TEST_API_BUNDLE_HPP #define INCLUDED_SRC_TEST_UTILS_EXECUTOR_TEST_API_BUNDLE_HPP -#include <utility> // std::move - #include "gsl/gsl" #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/common/api_bundle.hpp" diff --git a/test/utils/hermeticity/test_hash_function_type.hpp b/test/utils/hermeticity/test_hash_function_type.hpp index ab46f791..721b6dd4 100644 --- a/test/utils/hermeticity/test_hash_function_type.hpp +++ b/test/utils/hermeticity/test_hash_function_type.hpp @@ -15,7 +15,7 @@ #ifndef INCLUDED_SRC_TEST_UTILS_HERMETICITY_TEST_HASH_FUNCTION_TYPE_HPP #define INCLUDED_SRC_TEST_UTILS_HERMETICITY_TEST_HASH_FUNCTION_TYPE_HPP -#include <cstddef> //std::exit +#include <cstdlib> #include <optional> #include "src/buildtool/crypto/hash_function.hpp" diff --git a/test/utils/hermeticity/test_storage_config.hpp b/test/utils/hermeticity/test_storage_config.hpp index 4335592c..39d3ed24 100644 --- a/test/utils/hermeticity/test_storage_config.hpp +++ b/test/utils/hermeticity/test_storage_config.hpp @@ -17,14 +17,15 @@ #include <cstdlib> //std::exit, std::getenv #include <filesystem> +#include <memory> #include <string> #include <utility> //std::move #include "gsl/gsl" -#include "src/buildtool/common/protocol_traits.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/storage/config.hpp" +#include "src/utils/cpp/expected.hpp" #include "src/utils/cpp/tmp_dir.hpp" #include "test/utils/hermeticity/test_hash_function_type.hpp" diff --git a/test/utils/large_objects/large_object_utils.cpp b/test/utils/large_objects/large_object_utils.cpp index 0428b506..b61ea49e 100644 --- a/test/utils/large_objects/large_object_utils.cpp +++ b/test/utils/large_objects/large_object_utils.cpp @@ -14,6 +14,8 @@ #include "test/utils/large_objects/large_object_utils.hpp" +#include <algorithm> +#include <array> #include <cstddef> #include <cstdint> #include <fstream> diff --git a/test/utils/logging/log_config.hpp b/test/utils/logging/log_config.hpp index 3b920917..e7fc8a8b 100644 --- a/test/utils/logging/log_config.hpp +++ b/test/utils/logging/log_config.hpp @@ -18,6 +18,7 @@ #include <cstdlib> #include <exception> #include <string> // std::stoul +#include <vector> #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 b7185121..1499424c 100644 --- a/test/utils/remote_execution/bazel_action_creator.hpp +++ b/test/utils/remote_execution/bazel_action_creator.hpp @@ -16,20 +16,24 @@ #define INCLUDED_SRC_TEST_UTILS_REMOTE_EXECUTION_ACTION_CREATOR_HPP #include <algorithm> // std::transform, std::copy +#include <iterator> #include <map> #include <memory> #include <optional> #include <string> #include <vector> +#include "google/protobuf/repeated_ptr_field.h" #include "gsl/gsl" -#include "src/buildtool/auth/authentication.hpp" #include "src/buildtool/common/bazel_digest_factory.hpp" #include "src/buildtool/common/bazel_types.hpp" +#include "src/buildtool/common/remote/remote_common.hpp" #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/config.hpp" +#include "src/buildtool/file_system/object_type.hpp" #include "test/utils/remote_execution/test_auth_config.hpp" #include "test/utils/remote_execution/test_remote_config.hpp" diff --git a/test/utils/remote_execution/main-remote-execution.cpp b/test/utils/remote_execution/main-remote-execution.cpp index f7bbc4fc..324d5634 100644 --- a/test/utils/remote_execution/main-remote-execution.cpp +++ b/test/utils/remote_execution/main-remote-execution.cpp @@ -15,17 +15,14 @@ #define CATCH_CONFIG_RUNNER #include <chrono> #include <cstdlib> -#include <iostream> -#include <sstream> +#include <optional> #include <thread> #include "catch2/catch_session.hpp" -#include "catch2/catch_test_macros.hpp" +#include "src/buildtool/auth/authentication.hpp" +#include "src/buildtool/common/remote/remote_common.hpp" #include "src/buildtool/execution_api/remote/config.hpp" -#include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/git_context.hpp" -#include "src/buildtool/logging/log_level.hpp" -#include "src/buildtool/logging/logger.hpp" #include "test/utils/logging/log_config.hpp" #include "test/utils/remote_execution/test_auth_config.hpp" #include "test/utils/remote_execution/test_remote_config.hpp" diff --git a/test/utils/remote_execution/test_auth_config.hpp b/test/utils/remote_execution/test_auth_config.hpp index 2f5cca25..c4ddfb99 100644 --- a/test/utils/remote_execution/test_auth_config.hpp +++ b/test/utils/remote_execution/test_auth_config.hpp @@ -16,12 +16,13 @@ #define INCLUDED_SRC_TEST_UTILS_REMOTE_EXECUTION_TEST_AUTH_CONFIG_HPP #include <optional> -#include <string> +#include <utility> #include <variant> #include "src/buildtool/auth/authentication.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" +#include "src/utils/cpp/expected.hpp" #include "test/utils/test_env.hpp" class TestAuthConfig final { diff --git a/test/utils/remote_execution/test_remote_config.hpp b/test/utils/remote_execution/test_remote_config.hpp index 513b24ea..9aa2484a 100644 --- a/test/utils/remote_execution/test_remote_config.hpp +++ b/test/utils/remote_execution/test_remote_config.hpp @@ -16,10 +16,12 @@ #define INCLUDED_SRC_TEST_UTILS_REMOTE_EXECUTION_TEST_REMOTE_CONFIG_HPP #include <optional> +#include <utility> #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" +#include "src/utils/cpp/expected.hpp" #include "test/utils/test_env.hpp" class TestRemoteConfig final { diff --git a/test/utils/serve_service/main-serve.cpp b/test/utils/serve_service/main-serve.cpp index 59761832..ea60d726 100644 --- a/test/utils/serve_service/main-serve.cpp +++ b/test/utils/serve_service/main-serve.cpp @@ -16,21 +16,18 @@ #include <chrono> #include <cstdlib> #include <filesystem> -#include <iostream> -#include <sstream> +#include <optional> #include <string> #include <thread> +#include <vector> #include "catch2/catch_session.hpp" -#include "catch2/catch_test_macros.hpp" -#include "src/buildtool/common/protocol_traits.hpp" -#include "src/buildtool/execution_api/remote/config.hpp" -#include "src/buildtool/file_system/file_system_manager.hpp" +#include "fmt/core.h" +#include "src/buildtool/common/remote/remote_common.hpp" #include "src/buildtool/file_system/git_context.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/serve_api/remote/config.hpp" -#include "src/buildtool/storage/storage.hpp" #include "test/utils/logging/log_config.hpp" #include "test/utils/serve_service/test_serve_config.hpp" #include "test/utils/shell_quoting.hpp" diff --git a/test/utils/serve_service/test_serve_config.hpp b/test/utils/serve_service/test_serve_config.hpp index 4b94d0f7..6f6b712f 100644 --- a/test/utils/serve_service/test_serve_config.hpp +++ b/test/utils/serve_service/test_serve_config.hpp @@ -16,12 +16,12 @@ #define INCLUDED_SRC_TEST_UTILS_SERVE_SERVICE_TEST_SERVE_CONFIG_HPP #include <optional> -#include <string> -#include <variant> +#include <utility> #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/serve_api/remote/config.hpp" +#include "src/utils/cpp/expected.hpp" #include "test/utils/test_env.hpp" class TestServeConfig final { diff --git a/test/utils/test_env.hpp b/test/utils/test_env.hpp index ec03a9ee..0f93a898 100644 --- a/test/utils/test_env.hpp +++ b/test/utils/test_env.hpp @@ -17,14 +17,10 @@ #include <cstdlib> #include <filesystem> -#include <map> #include <optional> #include <sstream> #include <string> - -#include "src/buildtool/auth/authentication.hpp" -#include "src/buildtool/common/protocol_traits.hpp" -#include "test/utils/logging/log_config.hpp" +#include <vector> [[nodiscard]] static inline auto ReadPlatformPropertiesFromEnv() -> std::vector<std::string> { |