[IE TESTS] Test movement (#9429)

* [IE TESTS] Movement of some tests in shared lib. Movement of 'QueryNetwork' validation to ApiConformance suite

* Update read_ir.cpp
This commit is contained in:
Irina Efode 2021-12-29 12:28:58 +03:00 committed by GitHub
parent 3ee00e018a
commit 9234f4177d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 77 additions and 10 deletions

View File

@ -4,7 +4,7 @@
#include "common_test_utils/file_utils.hpp"
#include "read_ir/read_ir.hpp"
#include "read_ir/read_ir_query_network.hpp"
#include "conformance.hpp"
namespace ConformanceTests {

View File

@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "op_impl_check/op_impl_check.hpp"
#include "op_impl_check/single_op_graph.hpp"
#include "single_layer_tests/op_impl_check/op_impl_check.hpp"
#include "single_layer_tests/op_impl_check/single_op_graph.hpp"
#include "conformance.hpp"
namespace ConformanceTests {

View File

@ -0,0 +1,22 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "common_test_utils/file_utils.hpp"
#include "read_ir/read_ir_compare_with_refs.hpp"
#include "conformance.hpp"
namespace ConformanceTests {
using namespace LayerTestsDefinitions;
namespace {
INSTANTIATE_TEST_SUITE_P(conformance,
ReadIRTest,
::testing::Combine(
::testing::ValuesIn(CommonTestUtils::getFileListByPatternRecursive(IRFolderPaths, std::regex(R"(.*\.xml)"))),
::testing::Values(targetDevice),
::testing::Values(pluginConfig)),
ReadIRTest::getTestCaseName);
} // namespace
} // namespace ConformanceTests

View File

@ -0,0 +1,13 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "shared_test_classes/read_ir/read_ir.hpp"
namespace LayerTestsDefinitions {
TEST_P(ReadIRTest, ReadIR) {
Run();
}
} // namespace LayerTestsDefinitions

View File

@ -6,10 +6,6 @@
namespace LayerTestsDefinitions {
TEST_P(ReadIRTest, ReadIR) {
Run();
}
TEST_P(ReadIRTest, QueryNetwork) {
QueryNetwork();
}

View File

@ -6,7 +6,7 @@
#include <process.h>
#endif
#include "op_impl_check/op_impl_check.hpp"
#include "single_layer_tests/op_impl_check/op_impl_check.hpp"
namespace ov {
namespace test {

View File

@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
//
#include <op_impl_check/op_impl_check.hpp>
#include <op_impl_check/single_op_graph.hpp>
#include <single_layer_tests/op_impl_check/op_impl_check.hpp>
#include <single_layer_tests/op_impl_check/single_op_graph.hpp>
namespace ov {
namespace test {

View File

@ -19,6 +19,7 @@ class ReadIRTest : public testing::WithParamInterface<ReadIRParams>,
virtual public LayerTestsUtils::LayerTestsCommon {
public:
static std::string getTestCaseName(const testing::TestParamInfo<ReadIRParams> &obj);
void QueryNetwork() override;
protected:
void SetUp() override;

View File

@ -2,6 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
//
#include <signal.h>
#ifdef _WIN32
#include <process.h>
#endif
#include <pugixml.hpp>
#include "common_test_utils/file_utils.hpp"
#include "functional_test_utils/core_config.hpp"
@ -29,6 +34,36 @@ std::string ReadIRTest::getTestCaseName(const testing::TestParamInfo<ReadIRParam
return result.str();
}
void ReadIRTest::QueryNetwork() {
if (functionRefs == nullptr) {
functionRefs = ngraph::clone_function(*function);
functionRefs->set_friendly_name("refFunction");
}
auto crashHandler = [](int errCode) {
auto &s = LayerTestsUtils::Summary::getInstance();
s.saveReport();
std::cout << "Unexpected application crash!" << std::endl;
std::abort();
};
signal(SIGSEGV, crashHandler);
auto &s = LayerTestsUtils::Summary::getInstance();
s.setDeviceName(targetDevice);
if (FuncTestUtils::SkipTestsConfig::currentTestIsDisabled()) {
s.updateOPsStats(functionRefs, LayerTestsUtils::PassRate::Statuses::SKIPPED);
GTEST_SKIP() << "Disabled test due to configuration" << std::endl;
} else {
s.updateOPsStats(functionRefs, LayerTestsUtils::PassRate::Statuses::CRASHED);
}
try {
LayerTestsCommon::QueryNetwork();
s.updateOPsStats(functionRefs, LayerTestsUtils::PassRate::Statuses::PASSED);
} catch (...) {
s.updateOPsStats(functionRefs, LayerTestsUtils::PassRate::Statuses::FAILED);
}
}
void ReadIRTest::SetUp() {
std::tie(pathToModel, targetDevice, configuration) = this->GetParam();
auto net = getCore()->ReadNetwork(pathToModel);