From 79b4dc14a332bd207b6e1b78ec1130a4aab10984 Mon Sep 17 00:00:00 2001 From: OrestChura Date: Fri, 11 Dec 2020 20:26:39 +0300 Subject: [PATCH] Fix new streaming tests for CI --- .../test/streaming/gapi_streaming_tests.cpp | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/modules/gapi/test/streaming/gapi_streaming_tests.cpp b/modules/gapi/test/streaming/gapi_streaming_tests.cpp index 25d31f172e..527f682dfe 100644 --- a/modules/gapi/test/streaming/gapi_streaming_tests.cpp +++ b/modules/gapi/test/streaming/gapi_streaming_tests.cpp @@ -1704,7 +1704,11 @@ TEST(GAPI_Streaming, CopyFrame) cv::GComputation comp(cv::GIn(in), cv::GOut(out)); auto cc = comp.compileStreaming(); - cc.setSource(filepath); + try { + cc.setSource(filepath); + } catch(...) { + throw SkipTestException("Video file can not be opened"); + } cv::VideoCapture cap; cap.open(filepath); @@ -1739,7 +1743,11 @@ TEST(GAPI_Streaming, Reshape) cv::GComputation comp(cv::GIn(in), cv::GOut(out)); auto cc = comp.compileStreaming(); - cc.setSource(filepath); + try { + cc.setSource(filepath); + } catch(...) { + throw SkipTestException("Video file can not be opened"); + } cv::VideoCapture cap; cap.open(filepath); @@ -1765,7 +1773,11 @@ TEST(GAPI_Streaming, Reshape) // Reshape the graph meta filepath = findDataFile("cv/video/1920x1080.avi"); cc.stop(); - cc.setSource(filepath); + try { + cc.setSource(filepath); + } catch(...) { + throw SkipTestException("Video file can not be opened"); + } cap.open(filepath); if (!cap.isOpened()) @@ -1799,7 +1811,11 @@ TEST(GAPI_Streaming, AccessBGRFromBGRFrame) cv::GComputation comp(cv::GIn(in), cv::GOut(out)); auto cc = comp.compileStreaming(); - cc.setSource(filepath); + try { + cc.setSource(filepath); + } catch(...) { + throw SkipTestException("Video file can not be opened"); + } cv::VideoCapture cap; cap.open(filepath); @@ -1831,7 +1847,11 @@ TEST(GAPI_Streaming, AccessBGRFromNV12Frame) cv::GComputation comp(cv::GIn(in), cv::GOut(out)); auto cc = comp.compileStreaming(); - cc.setSource(filepath); + try { + cc.setSource(filepath); + } catch(...) { + throw SkipTestException("Video file can not be opened"); + } cv::VideoCapture cap; cap.open(filepath);