tests: somewhat support testing without openssl
You will still get lots of test error, but at least the tests will run.
This commit is contained in:
parent
98ecf1f074
commit
d2c0fae4f6
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash -eu
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
./test.bash -tags without_openssl
|
|
@ -13,6 +13,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/rfjakob/gocryptfs/internal/cryptocore"
|
"github.com/rfjakob/gocryptfs/internal/cryptocore"
|
||||||
|
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
|
||||||
"github.com/rfjakob/gocryptfs/tests/test_helpers"
|
"github.com/rfjakob/gocryptfs/tests/test_helpers"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -23,10 +24,16 @@ var opensslOpt string
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
// Make "testing.Verbose()" return the correct value
|
// Make "testing.Verbose()" return the correct value
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
variants := []string{"-openssl=true", "-openssl=false"}
|
var variants []string
|
||||||
if !cryptocore.HaveModernGoGCM {
|
if cryptocore.HaveModernGoGCM {
|
||||||
fmt.Printf("Skipping Go GCM variant, Go installation is too old")
|
variants = append(variants, "-openssl=false")
|
||||||
variants = variants[:1]
|
} 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 {
|
for _, opensslOpt = range variants {
|
||||||
if testing.Verbose() {
|
if testing.Verbose() {
|
||||||
|
|
Loading…
Reference in New Issue