Skip to content

Commit

Permalink
cuda: fix CUDA tests initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Jan 12, 2017
1 parent f4fdd94 commit f94e64a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion modules/ts/include/opencv2/ts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,12 +604,17 @@ void dumpOpenCLDevice();

void parseCustomOptions(int argc, char **argv);

#define CV_TEST_MAIN(resourcesubdir, ...) \
#define CV_TEST_INIT0_NOOP (void)0

#define CV_TEST_MAIN(resourcesubdir, ...) CV_TEST_MAIN_EX(resourcesubdir, NOOP, __VA_ARGS__)

#define CV_TEST_MAIN_EX(resourcesubdir, INIT0, ...) \
int main(int argc, char **argv) \
{ \
using namespace cvtest; \
TS* ts = TS::ptr(); \
ts->init(resourcesubdir); \
__CV_TEST_EXEC_ARGS(CV_TEST_INIT0_ ## INIT0) \
::testing::InitGoogleTest(&argc, argv); \
cvtest::printVersionInfo(); \
TEST_DUMP_OCL_INFO \
Expand Down
6 changes: 4 additions & 2 deletions modules/ts/include/opencv2/ts/cuda_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,10 @@ namespace cv { namespace cuda

#ifdef HAVE_CUDA

#define CV_CUDA_TEST_MAIN(resourcesubdir) \
CV_TEST_MAIN(resourcesubdir, cvtest::parseCudaDeviceOptions(argc, argv), cvtest::printCudaInfo(), cv::setUseOptimized(false))
#define CV_TEST_INIT0_CUDA cvtest::parseCudaDeviceOptions(argc, argv), cvtest::printCudaInfo(), cv::setUseOptimized(false)

#define CV_CUDA_TEST_MAIN(resourcesubdir, ...) \
CV_TEST_MAIN_EX(resourcesubdir, CUDA, __VA_ARGS__)

#else // HAVE_CUDA

Expand Down

0 comments on commit f94e64a

Please sign in to comment.