added check into opencv_test_gpu: whether OpenCV was compiled with CUDA or not
authorAlexey Spizhevoy <no@email>
Mon, 21 Feb 2011 06:46:45 +0000 (06:46 +0000)
committerAlexey Spizhevoy <no@email>
Mon, 21 Feb 2011 06:46:45 +0000 (06:46 +0000)
modules/gpu/test/test_main.cpp
modules/gpu/test/test_meanshift.cpp
modules/gpu/test/test_precomp.hpp

index 3420eb1..89c1b27 100644 (file)
@@ -1,6 +1,13 @@
 #include "test_precomp.hpp"\r
 \r
-CV_TEST_MAIN("gpu")\r
-\r
-// Run test with --gtest_catch_exceptions flag to avoid runtime errors in \r
-// the case when there is no GPU\r
+int main(int argc, char **argv)\r
+{\r
+    cvtest::TS::ptr()->init("gpu");\r
+    ::testing::InitGoogleTest(&argc, argv);\r
+#ifdef HAVE_CUDA\r
+    return RUN_ALL_TESTS();\r
+#else\r
+    std::cerr << "opencv_test_gpu: OpenCV was compiled without GPU support\n";\r
+    return -1;\r
+#endif\r
+}
\ No newline at end of file
index e58bd15..b297b98 100644 (file)
@@ -125,11 +125,7 @@ struct CV_GpuMeanShiftTest : public cvtest::BaseTest
 \r
 };\r
 \r
-/////////////////////////////////////////////////////////////////////////////\r
-/////////////////// tests registration  /////////////////////////////////////\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-CV_GpuMeanShiftTest CV_GpuMeanShift_test;\r
+TEST(meanShift, accuracy) { CV_GpuMeanShiftTest test; test.safe_run(); }\r
 \r
 struct CV_GpuMeanShiftProcTest : public cvtest::BaseTest\r
 {\r
index 9b048fc..89426c3 100644 (file)
@@ -2,6 +2,7 @@
 #define __OPENCV_TEST_PRECOMP_HPP__\r
 \r
 #include <limits>\r
+#include <cvconfig.h>\r
 #include "opencv2/core/core.hpp"\r
 #include "opencv2/highgui/highgui.hpp"\r
 #include "opencv2/calib3d/calib3d.hpp"\r