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/example_filesystems/example_filesystems_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/example_filesystems') diff --git a/tests/example_filesystems/example_filesystems_test.go b/tests/example_filesystems/example_filesystems_test.go index 8b01555..2b0c2ca 100644 --- a/tests/example_filesystems/example_filesystems_test.go +++ b/tests/example_filesystems/example_filesystems_test.go @@ -12,6 +12,7 @@ import ( "os" "testing" + "github.com/rfjakob/gocryptfs/internal/cryptocore" "github.com/rfjakob/gocryptfs/tests/test_helpers" ) @@ -22,7 +23,12 @@ var opensslOpt string func TestMain(m *testing.M) { // Make "testing.Verbose()" return the correct value flag.Parse() - for _, opensslOpt = range []string{"-openssl=false", "-openssl=true"} { + variants := []string{"-openssl=true", "-openssl=false"} + if !cryptocore.HaveModernGoGCM { + fmt.Printf("Skipping Go GCM variant, Go installation is too old") + variants = variants[:1] + } + for _, opensslOpt = range variants { if testing.Verbose() { fmt.Printf("example_filesystems: testing with %q\n", opensslOpt) } -- cgit v1.2.3