-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IE Myriad] Added MockICore to fix graph transformer tests
- Loading branch information
1 parent
7b65736
commit 2ef870c
Showing
11 changed files
with
112 additions
and
9 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...-engine/tests/ie_test_utils/unit_test_utils/mocks/cpp_interfaces/interface/mock_icore.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (C) 2018-2020 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <gmock/gmock.h> | ||
#include "ie_icore.hpp" | ||
|
||
using namespace InferenceEngine; | ||
|
||
class MockICore : public ICore { | ||
public: | ||
MOCK_QUALIFIED_METHOD0(GetTaskExecutor, const, std::shared_ptr<ITaskExecutor>()); | ||
|
||
MOCK_QUALIFIED_METHOD2(ReadNetwork, const, CNNNetwork(const std::string&, const Blob::CPtr&)); | ||
MOCK_QUALIFIED_METHOD2(ReadNetwork, const, CNNNetwork(const std::string&, const std::string&)); | ||
|
||
MOCK_METHOD3(LoadNetwork, ExecutableNetwork( | ||
const CNNNetwork&, const std::string&, const std::map<std::string, std::string>&)); | ||
|
||
MOCK_METHOD3(ImportNetwork, ExecutableNetwork( | ||
std::istream&, const std::string&, const std::map<std::string, std::string>&)); | ||
|
||
MOCK_QUALIFIED_METHOD3(QueryNetwork, const, QueryNetworkResult( | ||
const ICNNNetwork&, const std::string&, const std::map<std::string, std::string>&)); | ||
|
||
MOCK_QUALIFIED_METHOD2(GetMetric, const, Parameter(const std::string&, const std::string&)); | ||
|
||
~MockICore() = default; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (C) 2018-2020 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <gmock/gmock.h> | ||
#include "ie_icore.hpp" | ||
|
||
using namespace InferenceEngine; | ||
|
||
class MockICore : public ICore { | ||
public: | ||
MOCK_QUALIFIED_METHOD0(GetTaskExecutor, const, std::shared_ptr<ITaskExecutor>()); | ||
|
||
MOCK_QUALIFIED_METHOD2(ReadNetwork, const, CNNNetwork(const std::string&, const Blob::CPtr&)); | ||
MOCK_QUALIFIED_METHOD2(ReadNetwork, const, CNNNetwork(const std::string&, const std::string&)); | ||
|
||
MOCK_METHOD3(LoadNetwork, ExecutableNetwork( | ||
const CNNNetwork&, const std::string&, const std::map<std::string, std::string>&)); | ||
|
||
MOCK_METHOD3(ImportNetwork, ExecutableNetwork( | ||
std::istream&, const std::string&, const std::map<std::string, std::string>&)); | ||
|
||
MOCK_QUALIFIED_METHOD3(QueryNetwork, const, QueryNetworkResult( | ||
const ICNNNetwork&, const std::string&, const std::map<std::string, std::string>&)); | ||
|
||
MOCK_QUALIFIED_METHOD2(GetMetric, const, Parameter(const std::string&, const std::string&)); | ||
|
||
~MockICore() = default; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
inference-engine/tests_deprecated/unit/engines/vpu/myriad_tests/helpers/mock_icore.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (C) 2018-2020 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <gmock/gmock.h> | ||
#include "ie_icore.hpp" | ||
|
||
class MockICore : public InferenceEngine::ICore { | ||
public: | ||
MOCK_QUALIFIED_METHOD0(GetTaskExecutor, const, std::shared_ptr<InferenceEngine::ITaskExecutor>()); | ||
|
||
MOCK_QUALIFIED_METHOD2(ReadNetwork, const, InferenceEngine::CNNNetwork(const std::string&, const InferenceEngine::Blob::CPtr&)); | ||
MOCK_QUALIFIED_METHOD2(ReadNetwork, const, InferenceEngine::CNNNetwork(const std::string&, const std::string&)); | ||
|
||
MOCK_METHOD3(LoadNetwork, InferenceEngine::ExecutableNetwork( | ||
const InferenceEngine::CNNNetwork&, const std::string&, const std::map<std::string, std::string>&)); | ||
|
||
MOCK_METHOD3(ImportNetwork, InferenceEngine::ExecutableNetwork( | ||
std::istream&, const std::string&, const std::map<std::string, std::string>&)); | ||
|
||
MOCK_QUALIFIED_METHOD3(QueryNetwork, const, InferenceEngine::QueryNetworkResult( | ||
const InferenceEngine::ICNNNetwork&, const std::string&, const std::map<std::string, std::string>&)); | ||
|
||
MOCK_QUALIFIED_METHOD2(GetMetric, const, InferenceEngine::Parameter(const std::string&, const std::string&)); | ||
|
||
~MockICore() = default; | ||
}; |