diff options
Diffstat (limited to 'test/buildtool/execution_api/bazel')
-rw-r--r-- | test/buildtool/execution_api/bazel/TARGETS | 15 | ||||
-rw-r--r-- | test/buildtool/execution_api/bazel/bazel_api.test.cpp | 35 |
2 files changed, 49 insertions, 1 deletions
diff --git a/test/buildtool/execution_api/bazel/TARGETS b/test/buildtool/execution_api/bazel/TARGETS index 74890977..5978f7be 100644 --- a/test/buildtool/execution_api/bazel/TARGETS +++ b/test/buildtool/execution_api/bazel/TARGETS @@ -72,6 +72,18 @@ ] , "stage": ["test", "buildtool", "execution_api", "bazel"] } +, "bazel_api": + { "type": ["@", "rules", "CC/test", "test"] + , "name": ["bazel_api"] + , "srcs": ["bazel_api.test.cpp"] + , "deps": + [ ["@", "catch2", "", "catch2"] + , ["test/utils", "catch-main-remote-execution"] + , ["src/buildtool/execution_api/remote", "bazel"] + , ["test/buildtool/execution_api/common", "api_test"] + ] + , "stage": ["test", "buildtool", "execution_api", "bazel"] + } , "TESTS": { "type": "install" , "tainted": ["test"] @@ -82,6 +94,7 @@ , "execution_client" , "msg_factory" , "network" + , "bazel_api" ] } -}
\ No newline at end of file +} diff --git a/test/buildtool/execution_api/bazel/bazel_api.test.cpp b/test/buildtool/execution_api/bazel/bazel_api.test.cpp new file mode 100644 index 00000000..18d08f7c --- /dev/null +++ b/test/buildtool/execution_api/bazel/bazel_api.test.cpp @@ -0,0 +1,35 @@ +#include <cstdlib> +#include <string> + +#include "catch2/catch.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/test_env.hpp" + +namespace { + +auto api_factory = []() { + static auto const& server = RemoteExecutionConfig::Instance(); + return IExecutionApi::Ptr{ + new BazelApi{"remote-execution", server.Host(), server.Port(), {}}}; +}; + +} // namespace + +TEST_CASE("BazelAPI: No input, no output", "[execution_api]") { + TestNoInputNoOutput(api_factory, ReadPlatformPropertiesFromEnv()); +} + +TEST_CASE("BazelAPI: No input, create output", "[execution_api]") { + TestNoInputCreateOutput(api_factory, ReadPlatformPropertiesFromEnv()); +} + +TEST_CASE("BazelAPI: One input copied to output", "[execution_api]") { + TestOneInputCopiedToOutput(api_factory, ReadPlatformPropertiesFromEnv()); +} + +TEST_CASE("BazelAPI: Non-zero exit code, create output", "[execution_api]") { + TestNonZeroExitCodeCreateOutput(api_factory, + ReadPlatformPropertiesFromEnv()); +} |