#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
-CV_TEST_MAIN("gpu")\r
\r
// TODO Add other tests from tests/gpu folder\r
-// TODO When there is no GPU test system doesn't print error message: it fails or keeps \r
-// quiet when --gtest_catch_exceptions is enabled\r
#include "opencv2/gpu/gpu.hpp"\r
#include "opencv2/highgui/highgui.hpp"\r
\r
-static inline bool check_and_treat_gpu_exception(const cv::Exception& e, cvtest::TS* ts)\r
-{\r
- switch (e.code)\r
- {\r
- case CV_GpuNotSupported: \r
- ts->printf(cvtest::TS::LOG, "\nGpu not supported by the library"); \r
- break;\r
-\r
- case CV_GpuApiCallError: \r
- ts->printf(cvtest::TS::LOG, "\nGPU Error: %s", e.what());\r
- break;\r
-\r
- case CV_GpuNppCallError: \r
- ts->printf(cvtest::TS::LOG, "\nNPP Error: %s", e.what());\r
- break;\r
-\r
- default:\r
- return false;\r
- }\r
- ts->set_failed_test_info(cvtest::TS::FAIL_GENERIC); \r
- return true;\r
-}\r
-\r
#endif\r