Merge pull request #19617 from smirnov-alexey:as/extend_kernel_package_api
G-API: Extend GKernelPackage and serialization API * Extend GKernelPackage API * Adding tests * Extend serialization API * Address review comments
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
//
|
||||
// Copyright (C) 2018 Intel Corporation
|
||||
// Copyright (C) 2018-2021 Intel Corporation
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "test_precomp.hpp"
|
||||
#include "gapi_mock_kernels.hpp"
|
||||
@@ -146,6 +147,29 @@ TEST(KernelPackage, Includes)
|
||||
EXPECT_FALSE(pkg.includes<J::Qux>());
|
||||
}
|
||||
|
||||
TEST(KernelPackage, Include)
|
||||
{
|
||||
namespace J = Jupiter;
|
||||
auto pkg = cv::gapi::kernels();
|
||||
pkg.include(J::backend(), "test.kernels.foo");
|
||||
pkg.include(J::backend(), "test.kernels.bar");
|
||||
EXPECT_TRUE (pkg.includes<J::Foo>());
|
||||
EXPECT_TRUE (pkg.includes<J::Bar>());
|
||||
}
|
||||
|
||||
TEST(KernelPackage, GetIds)
|
||||
{
|
||||
namespace J = Jupiter;
|
||||
auto pkg = cv::gapi::kernels();
|
||||
pkg.include(J::backend(), "test.kernels.foo");
|
||||
pkg.include(J::backend(), "test.kernels.bar");
|
||||
pkg.include<J::Baz>();
|
||||
auto ids = pkg.get_kernel_ids();
|
||||
EXPECT_NE(ids.end(), std::find(ids.begin(), ids.end(), "test.kernels.foo"));
|
||||
EXPECT_NE(ids.end(), std::find(ids.begin(), ids.end(), "test.kernels.bar"));
|
||||
EXPECT_NE(ids.end(), std::find(ids.begin(), ids.end(), "test.kernels.baz"));
|
||||
}
|
||||
|
||||
TEST(KernelPackage, IncludesAPI)
|
||||
{
|
||||
namespace J = Jupiter;
|
||||
|
||||
Reference in New Issue
Block a user