Skip to content

Commit

Permalink
test: skip tests on macOS that are not passing due to OpenCV differen…
Browse files Browse the repository at this point in the history
…t results

on macOS. See https://forum.opencv.org/t/match-template-different-results-on-mac-m1/10026
and other similar issues.

Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Aug 22, 2024
1 parent fd8a204 commit 78c14ab
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
13 changes: 13 additions & 0 deletions features2d_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gocv

import (
"image/color"
"runtime"
"testing"
)

Expand Down Expand Up @@ -523,6 +524,10 @@ func TestDrawKeyPoints(t *testing.T) {
}

func TestDrawMatches(t *testing.T) {
if runtime.GOOS == "darwin" {
t.Skip("skipping test on macos")
}

queryFile := "images/box.png"
trainFile := "images/box_in_scene.png"

Expand Down Expand Up @@ -593,6 +598,10 @@ func TestDrawMatches(t *testing.T) {
}

func TestSIFT(t *testing.T) {
if runtime.GOOS == "darwin" {
t.Skip("skipping test on macos")
}

img := IMRead("./images/face.jpg", IMReadGrayScale)
if img.Empty() {
t.Error("Invalid Mat in SIFT test")
Expand Down Expand Up @@ -633,6 +642,10 @@ func TestSIFT(t *testing.T) {
}

func TestSIFTWithParams(t *testing.T) {
if runtime.GOOS == "darwin" {
t.Skip("skipping test on macos")
}

img := IMRead("./images/face.jpg", IMReadGrayScale)
if img.Empty() {
t.Error("Invalid Mat in SIFT test")
Expand Down
9 changes: 9 additions & 0 deletions imgproc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"math"
"os"
"reflect"
"runtime"
"testing"
)

Expand Down Expand Up @@ -1140,6 +1141,10 @@ func TestHoughCirclesWithParams(t *testing.T) {
}

func TestHoughLines(t *testing.T) {
if runtime.GOOS == "darwin" {
t.Skip("skipping test on macos")
}

img := IMRead("images/face-detect.jpg", IMReadGrayScale)
if img.Empty() {
t.Error("Invalid read of Mat in HoughLines test")
Expand Down Expand Up @@ -1179,6 +1184,10 @@ func TestHoughLines(t *testing.T) {
}

func TestHoughLinesP(t *testing.T) {
if runtime.GOOS == "darwin" {
t.Skip("skipping test on macos")
}

img := IMRead("images/face-detect.jpg", IMReadGrayScale)
if img.Empty() {
t.Error("Invalid read of Mat in HoughLinesP test")
Expand Down
5 changes: 5 additions & 0 deletions svd_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package gocv

import (
"runtime"
"testing"
)

func TestSVDCompute(t *testing.T) {
if runtime.GOOS == "darwin" {
t.Skip("skipping test on macos")
}

var resultW = []float32{6.167493, 3.8214223}
var resultU = []float32{-0.1346676, -0.99089086, 0.9908908, -0.1346676}
var resultVt = []float32{0.01964448, 0.999807, -0.999807, 0.01964448}
Expand Down

0 comments on commit 78c14ab

Please sign in to comment.