1
0
Fork 0
mirror of https://github.com/Luzifer/go-dhparam.git synced 2024-11-09 15:50:02 +00:00

Test: Keep travis awake by sending output

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-10-08 12:27:44 +02:00
parent b6a915824f
commit fd3eda34cc
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 13 additions and 2 deletions

View file

@ -10,8 +10,19 @@ import (
"testing" "testing"
) )
func opensslOutput(r GeneratorResult) {
switch r {
case GeneratorFoundPossiblePrime:
os.Stderr.WriteString(".")
case GeneratorFirstConfirmation:
os.Stderr.WriteString("+")
case GeneratorSafePrimeFound:
os.Stderr.WriteString("*\n")
}
}
func execGeneratorIntegration(t *testing.T, bitsize int, generator Generator) { func execGeneratorIntegration(t *testing.T, bitsize int, generator Generator) {
dh, err := Generate(bitsize, generator, nil) dh, err := Generate(bitsize, generator, opensslOutput)
if err != nil { if err != nil {
t.Fatalf("Unable to generate DH params: %s", err) t.Fatalf("Unable to generate DH params: %s", err)
} }

View file

@ -3,7 +3,7 @@ package dhparam
import "testing" import "testing"
func TestCheckOwn(t *testing.T) { func TestCheckOwn(t *testing.T) {
dh, err := Generate(512, 2, nil) dh, err := Generate(512, 2, opensslOutput)
if err != nil { if err != nil {
t.Fatalf("Could not generate DH parameters: %s", err) t.Fatalf("Could not generate DH parameters: %s", err)
} }