Skip to content

Commit

Permalink
tests: somewhat support testing without openssl
Browse files Browse the repository at this point in the history
You will still get lots of test error, but at least the tests
will run.
  • Loading branch information
rfjakob committed Feb 26, 2017
1 parent 98ecf1f commit d2c0fae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions test-without-openssl.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -eu

cd "$(dirname "$0")"

./test.bash -tags without_openssl
15 changes: 11 additions & 4 deletions tests/example_filesystems/example_filesystems_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"testing"

"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/tests/test_helpers"
)

Expand All @@ -23,10 +24,16 @@ var opensslOpt string
func TestMain(m *testing.M) {
// Make "testing.Verbose()" return the correct value
flag.Parse()
variants := []string{"-openssl=true", "-openssl=false"}
if !cryptocore.HaveModernGoGCM {
fmt.Printf("Skipping Go GCM variant, Go installation is too old")
variants = variants[:1]
var variants []string
if cryptocore.HaveModernGoGCM {
variants = append(variants, "-openssl=false")
} else {
fmt.Println("Skipping Go GCM tests, Go installation is too old")
}
if !stupidgcm.BuiltWithoutOpenssl {
variants = append(variants, "-openssl=true")
} else {
fmt.Println("Skipping OpenSSL tests, I have been compiled without openssl support")
}
for _, opensslOpt = range variants {
if testing.Verbose() {
Expand Down

0 comments on commit d2c0fae

Please sign in to comment.