16 #ifndef TENSORFLOW_SERVING_CORE_TEST_UTIL_MOCK_SESSION_H_
17 #define TENSORFLOW_SERVING_CORE_TEST_UTIL_MOCK_SESSION_H_
19 #include <gmock/gmock.h>
20 #include "tensorflow/core/platform/threadpool_options.h"
21 #include "tensorflow/core/public/session.h"
23 namespace tensorflow {
31 ON_CALL(*
this, Close()).WillByDefault(::testing::Return(Status()));
33 MOCK_METHOD(::tensorflow::Status, Create, (
const GraphDef& graph),
35 MOCK_METHOD(::tensorflow::Status, Extend, (
const GraphDef& graph),
37 MOCK_METHOD(::tensorflow::Status, Run,
38 ((
const std::vector<std::pair<string, Tensor>>& inputs),
39 const std::vector<string>& output_names,
40 const std::vector<string>& target_nodes,
41 std::vector<Tensor>* outputs),
43 MOCK_METHOD(::tensorflow::Status, Run,
44 (
const RunOptions& run_options,
45 (
const std::vector<std::pair<string, Tensor>>& inputs),
46 const std::vector<string>& output_names,
47 const std::vector<string>& target_nodes,
48 std::vector<Tensor>* outputs, RunMetadata* run_metadata),
51 ::tensorflow::Status, Run,
52 (
const RunOptions& run_options,
53 (
const std::vector<std::pair<string, Tensor>>& inputs),
54 const std::vector<string>& output_names,
55 const std::vector<string>& target_nodes, std::vector<Tensor>* outputs,
56 RunMetadata* run_metadata,
57 const tensorflow::thread::ThreadPoolOptions& thread_pool_options),
59 MOCK_METHOD(::tensorflow::Status, PRunSetup,
60 (
const std::vector<string>& input_names,
61 const std::vector<string>& output_names,
62 const std::vector<string>& target_nodes,
string* handle),
64 MOCK_METHOD(::tensorflow::Status, PRun,
65 (
const string& handle,
66 (
const std::vector<std::pair<string, Tensor>>& inputs),
67 const std::vector<string>& output_names,
68 std::vector<Tensor>* outputs),
71 MOCK_METHOD(::tensorflow::Status, ListDevices,
72 (std::vector<::tensorflow::DeviceAttributes> * response),
75 MOCK_METHOD(::tensorflow::Status, Close, (), (
override));