27 #"videoio" # - a lot of GStreamer warnings and failed tests
28 #"dnn" #- some caffe tests failed, probably because github workflow also downloads additional models
29 ] ++ lib.optionals (!stdenv.isAarch64 && enableGStreamer) [ "gapi" ]
30 ++ lib.optionals (enableGtk2 || enableGtk3) [ "highgui" ];
41 ] ++ lib.optionals (!stdenv.isAarch64 && enableGStreamer) [ "gapi" ];
42 testRunner = lib.optionalString (!stdenv.isDarwin) "${lib.getExe xvfb-run} -a ";
45 # several tests want a write access, so we have to copy files
46 tmpPath="$(mktemp -d "/tmp/opencv_extra_XXXXXX")"
47 cp -R ${testDataSrc} $tmpPath/opencv_extra
48 chmod -R +w $tmpPath/opencv_extra
49 export OPENCV_TEST_DATA_PATH="$tmpPath/opencv_extra/testdata"
50 export OPENCV_SAMPLES_DATA_PATH="${opencv4.package_tests}/samples/data"
52 #ignored tests because of gtest error - "Test code is not available due to compilation error with GCC 11"
53 export GTEST_FILTER="-AsyncAPICancelation/cancel*"
55 accuracyTests = lib.optionalString runAccuracyTests ''
56 ${ builtins.concatStringsSep "\n"
57 (map (test: "${testRunner}${opencv4.package_tests}/opencv_test_${test} --test_threads=$NIX_BUILD_CORES --gtest_filter=$GTEST_FILTER" ) testNames)
60 performanceTests = lib.optionalString runPerformanceTests ''
61 ${ builtins.concatStringsSep "\n"
62 (map (test: "${testRunner}${opencv4.package_tests}/opencv_perf_${test} --perf_impl=plain --perf_min_samples=10 --perf_force_samples=10 --perf_verify_sanity --skip_unstable=1 --gtest_filter=$GTEST_FILTER") perfTestNames)
66 runCommand "opencv4-tests"
68 nativeBuildInputs = lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good ]);
70 (testsPreparation + accuracyTests + performanceTests)