summaryrefslogtreecommitdiff
path: root/preproc
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-05-13 19:46:27 +0100
committerNick White <git@njw.name>2019-05-13 19:46:27 +0100
commit6abca706a944a62231608c4a8d8fbdff81f4ca3c (patch)
treef231898570d7a7e7fbfa1603dc551be6423e6a3d /preproc
parent02a6c66eb77a5b455bcf2d0547d2383074eb7e41 (diff)
Add -slow flag to test to skip slow tests by default
Diffstat (limited to 'preproc')
-rw-r--r--preproc/sauvola_test.go6
-rw-r--r--preproc/test_helpers.go (renamed from preproc/helpers_test.go)1
2 files changed, 6 insertions, 1 deletions
diff --git a/preproc/sauvola_test.go b/preproc/sauvola_test.go
index 1397a4f..5582941 100644
--- a/preproc/sauvola_test.go
+++ b/preproc/sauvola_test.go
@@ -35,7 +35,11 @@ func TestBinarization(t *testing.T) {
case "integralsauvola":
actual = IntegralSauvola(orig, c.ksize, c.wsize)
case "sauvola":
- actual = Sauvola(orig, c.ksize, c.wsize)
+ if *slow {
+ actual = Sauvola(orig, c.ksize, c.wsize)
+ } else {
+ t.Skip("Skipping slow test; use -slow to run it.\n")
+ }
default:
t.Fatalf("No method %s\n", c.name)
}
diff --git a/preproc/helpers_test.go b/preproc/test_helpers.go
index 326b59d..7579e88 100644
--- a/preproc/helpers_test.go
+++ b/preproc/test_helpers.go
@@ -11,6 +11,7 @@ import (
"os"
)
+var slow = flag.Bool("slow", false, "include slow tests")
var update = flag.Bool("update", false, "update golden files")
func decode(s string) (*image.Gray, error) {