disable tests that requires video support if it is not available

This commit is contained in:
Vladislav Vinogradov 2013-03-20 11:50:42 +04:00
parent b07bce11ef
commit 0149969463
3 changed files with 77 additions and 5 deletions

View File

@ -4,6 +4,18 @@ using namespace std;
using namespace testing; using namespace testing;
using namespace perf; using namespace perf;
#if defined(HAVE_XINE) || \
defined(HAVE_GSTREAMER) || \
defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \
defined(HAVE_FFMPEG) || \
defined(WIN32) /* assume that we have ffmpeg */
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 1
#else
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 0
#endif
namespace cv namespace cv
{ {
template<> void Ptr<CvBGStatModel>::delete_obj() template<> void Ptr<CvBGStatModel>::delete_obj()
@ -482,6 +494,8 @@ PERF_TEST_P(ImagePair, Video_FastOpticalFlowBM,
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// FGDStatModel // FGDStatModel
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
DEF_PARAM_TEST_1(Video, string); DEF_PARAM_TEST_1(Video, string);
PERF_TEST_P(Video, Video_FGDStatModel, PERF_TEST_P(Video, Video_FGDStatModel,
@ -548,9 +562,13 @@ PERF_TEST_P(Video, Video_FGDStatModel,
} }
} }
#endif
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// MOG // MOG
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
DEF_PARAM_TEST(Video_Cn_LearningRate, string, MatCn, double); DEF_PARAM_TEST(Video_Cn_LearningRate, string, MatCn, double);
PERF_TEST_P(Video_Cn_LearningRate, Video_MOG, PERF_TEST_P(Video_Cn_LearningRate, Video_MOG,
@ -643,9 +661,13 @@ PERF_TEST_P(Video_Cn_LearningRate, Video_MOG,
} }
} }
#endif
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// MOG2 // MOG2
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
DEF_PARAM_TEST(Video_Cn, string, int); DEF_PARAM_TEST(Video_Cn, string, int);
PERF_TEST_P(Video_Cn, Video_MOG2, PERF_TEST_P(Video_Cn, Video_MOG2,
@ -740,9 +762,13 @@ PERF_TEST_P(Video_Cn, Video_MOG2,
} }
} }
#endif
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// MOG2GetBackgroundImage // MOG2GetBackgroundImage
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
PERF_TEST_P(Video_Cn, Video_MOG2GetBackgroundImage, PERF_TEST_P(Video_Cn, Video_MOG2GetBackgroundImage,
Combine(Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"), Combine(Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"),
GPU_CHANNELS_1_3_4)) GPU_CHANNELS_1_3_4))
@ -818,9 +844,13 @@ PERF_TEST_P(Video_Cn, Video_MOG2GetBackgroundImage,
} }
} }
#endif
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// GMG // GMG
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
DEF_PARAM_TEST(Video_Cn_MaxFeatures, string, MatCn, int); DEF_PARAM_TEST(Video_Cn_MaxFeatures, string, MatCn, int);
PERF_TEST_P(Video_Cn_MaxFeatures, Video_GMG, PERF_TEST_P(Video_Cn_MaxFeatures, Video_GMG,
@ -928,11 +958,13 @@ PERF_TEST_P(Video_Cn_MaxFeatures, Video_GMG,
} }
} }
#ifdef HAVE_NVCUVID #endif
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// VideoReader // VideoReader
#if defined(HAVE_NVCUVID) && BUILD_WITH_VIDEO_INPUT_SUPPORT
PERF_TEST_P(Video, Video_VideoReader, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi")) PERF_TEST_P(Video, Video_VideoReader, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"))
{ {
declare.time(20); declare.time(20);
@ -963,10 +995,12 @@ PERF_TEST_P(Video, Video_VideoReader, Values("gpu/video/768x576.avi", "gpu/video
} }
} }
#endif
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// VideoWriter // VideoWriter
#ifdef WIN32 #if defined(HAVE_NVCUVID) && defined(WIN32)
PERF_TEST_P(Video, Video_VideoWriter, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi")) PERF_TEST_P(Video, Video_VideoWriter, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"))
{ {
@ -1024,6 +1058,4 @@ PERF_TEST_P(Video, Video_VideoWriter, Values("gpu/video/768x576.avi", "gpu/video
SANITY_CHECK(frame); SANITY_CHECK(frame);
} }
#endif // WIN32 #endif
#endif // HAVE_NVCUVID

View File

@ -45,9 +45,23 @@
using namespace cvtest; using namespace cvtest;
#if defined(HAVE_XINE) || \
defined(HAVE_GSTREAMER) || \
defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \
defined(HAVE_FFMPEG) || \
defined(WIN32) /* assume that we have ffmpeg */
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 1
#else
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 0
#endif
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// FGDStatModel // FGDStatModel
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
namespace cv namespace cv
{ {
template<> void Ptr<CvBGStatModel>::delete_obj() template<> void Ptr<CvBGStatModel>::delete_obj()
@ -132,9 +146,13 @@ INSTANTIATE_TEST_CASE_P(GPU_Video, FGDStatModel, testing::Combine(
testing::Values(std::string("768x576.avi")), testing::Values(std::string("768x576.avi")),
testing::Values(Channels(3), Channels(4)))); testing::Values(Channels(3), Channels(4))));
#endif
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// MOG // MOG
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
namespace namespace
{ {
IMPLEMENT_PARAM_CLASS(UseGray, bool) IMPLEMENT_PARAM_CLASS(UseGray, bool)
@ -206,9 +224,13 @@ INSTANTIATE_TEST_CASE_P(GPU_Video, MOG, testing::Combine(
testing::Values(LearningRate(0.0), LearningRate(0.01)), testing::Values(LearningRate(0.0), LearningRate(0.01)),
WHOLE_SUBMAT)); WHOLE_SUBMAT));
#endif
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// MOG2 // MOG2
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
namespace namespace
{ {
IMPLEMENT_PARAM_CLASS(DetectShadow, bool) IMPLEMENT_PARAM_CLASS(DetectShadow, bool)
@ -322,6 +344,8 @@ INSTANTIATE_TEST_CASE_P(GPU_Video, MOG2, testing::Combine(
testing::Values(DetectShadow(true), DetectShadow(false)), testing::Values(DetectShadow(true), DetectShadow(false)),
WHOLE_SUBMAT)); WHOLE_SUBMAT));
#endif
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// GMG // GMG

View File

@ -4,6 +4,18 @@ using namespace std;
using namespace testing; using namespace testing;
using namespace perf; using namespace perf;
#if defined(HAVE_XINE) || \
defined(HAVE_GSTREAMER) || \
defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \
defined(HAVE_FFMPEG) || \
defined(WIN32) /* assume that we have ffmpeg */
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 1
#else
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 0
#endif
#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA) #if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA)
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@ -55,6 +67,8 @@ PERF_TEST_P(Image, GPU_SURF,
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// VIBE // VIBE
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
DEF_PARAM_TEST(Video_Cn, string, int); DEF_PARAM_TEST(Video_Cn, string, int);
PERF_TEST_P(Video_Cn, GPU_VIBE, PERF_TEST_P(Video_Cn, GPU_VIBE,
@ -120,3 +134,5 @@ PERF_TEST_P(Video_Cn, GPU_VIBE,
} }
#endif #endif
#endif