  
  #define CV_TEST_MAIN(resourcesubdir, ...) \
  int main(int argc, char **argv) \
+diff --git a/modules/ts/include/opencv2/ts/ocl_test.hpp b/modules/ts/include/opencv2/ts/ocl_test.hpp
+index c967cd7..ff35b40 100644
+--- a/modules/ts/include/opencv2/ts/ocl_test.hpp
++++ b/modules/ts/include/opencv2/ts/ocl_test.hpp
+@@ -84,7 +84,7 @@ inline UMat ToUMat(InputArray src)
+     return dst;
+ }
+ 
+-extern int test_loop_times;
++CV_EXPORTS extern int test_loop_times;
+ 
+ #define MAX_VALUE 357
+ 
 diff --git a/modules/ts/include/opencv2/ts/ts_ext.hpp b/modules/ts/include/opencv2/ts/ts_ext.hpp
 index 05ccc63..8075065 100644
 --- a/modules/ts/include/opencv2/ts/ts_ext.hpp

 
 struct CV_EXPORTS DefaultRngAuto
 {
@@ -602,7 +602,7 @@ void dumpOpenCLDevice();
 #define TEST_DUMP_OCL_INFO
 #endif
 

From a4abe478bf4514ec95aa10b2d6f258647ce325f5 Mon Sep 17 00:00:00 2001
From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
Date: Fri, 19 May 2017 04:27:50 +0900
Subject: [PATCH] To fix errors as following:
