From db5782028aaff99dbf15c62d851a4f6ec8227748 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 4 Oct 2016 22:29:14 +0200 Subject: tests: skip tests with -openssl=false on Go 1.4 and lower Go versions 1.4 and lower lack NewGCMWithNonceSize(), which causes a panic in the test. --- tests/matrix/matrix_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/matrix/matrix_test.go') diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go index 6a96909..b4c5668 100644 --- a/tests/matrix/matrix_test.go +++ b/tests/matrix/matrix_test.go @@ -22,6 +22,7 @@ import ( "syscall" "testing" + "github.com/rfjakob/gocryptfs/internal/cryptocore" "github.com/rfjakob/gocryptfs/internal/syscallcompat" "github.com/rfjakob/gocryptfs/tests/test_helpers" ) @@ -34,7 +35,12 @@ var plaintextnames bool func TestMain(m *testing.M) { // Make "testing.Verbose()" return the correct value flag.Parse() - for _, openssl := range []bool{true, false} { + opensslVariants := []bool{true, false} + if !cryptocore.HaveModernGoGCM { + fmt.Printf("Skipping Go GCM variant, Go installation is too old") + opensslVariants = opensslVariants[:1] + } + for _, openssl := range opensslVariants { for _, plaintextnames = range []bool{true, false} { if testing.Verbose() { fmt.Printf("matrix: testing openssl=%v plaintextnames=%v\n", openssl, plaintextnames) -- cgit v1.2.3