test_main.cpp 826 B

12345678910111213141516171819202122232425
  1. // This file is part of OpenCV project.
  2. // It is subject to the license terms in the LICENSE file found in the top-level directory
  3. // of this distribution and at http://opencv.org/license.html.
  4. #include "test_precomp.hpp"
  5. #include <opencv2/core/utils/logger.hpp>
  6. #if defined(HAVE_HPX)
  7. #include <hpx/hpx_main.hpp>
  8. #endif
  9. static
  10. void initTests()
  11. {
  12. #ifndef WINRT // missing getenv
  13. const std::vector<cv::VideoCaptureAPIs> backends = cv::videoio_registry::getStreamBackends();
  14. const char* requireFFmpeg = getenv("OPENCV_TEST_VIDEOIO_BACKEND_REQUIRE_FFMPEG");
  15. if (requireFFmpeg && !isBackendAvailable(cv::CAP_FFMPEG, backends))
  16. {
  17. CV_LOG_FATAL(NULL, "OpenCV-Test: required FFmpeg backend is not available (broken plugin?). STOP.");
  18. exit(1);
  19. }
  20. #endif
  21. }
  22. CV_TEST_MAIN("highgui", initTests())