Move rest of integration tests into the gquic folder

This commit is contained in:
Lucas Clemente
2017-08-03 20:56:10 +02:00
parent 0b1d7c46f5
commit 84db78db83
12 changed files with 45 additions and 45 deletions

View File

@@ -1,32 +0,0 @@
package integrationtests
import (
"crypto/md5"
"math/rand"
"time"
)
type dataManager struct {
data []byte
md5 []byte
}
func (m *dataManager) GenerateData(len int) error {
m.data = make([]byte, len)
r := rand.New(rand.NewSource(int64(time.Now().Nanosecond())))
_, err := r.Read(m.data)
if err != nil {
return err
}
sum := md5.Sum(m.data)
m.md5 = sum[:]
return nil
}
func (m *dataManager) GetData() []byte {
return m.data
}
func (m *dataManager) GetMD5() []byte {
return m.md5
}

View File

@@ -1,4 +1,4 @@
package integrationtests
package gquic_test
import (
"bytes"

View File

@@ -1,10 +1,40 @@
package integrationtests
package gquic_test
import (
. "github.com/onsi/ginkgo"
"crypto/md5"
"math/rand"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
type dataManager struct {
data []byte
md5 []byte
}
func (m *dataManager) GenerateData(len int) error {
m.data = make([]byte, len)
r := rand.New(rand.NewSource(int64(time.Now().Nanosecond())))
_, err := r.Read(m.data)
if err != nil {
return err
}
sum := md5.Sum(m.data)
m.md5 = sum[:]
return nil
}
func (m *dataManager) GetData() []byte {
return m.data
}
func (m *dataManager) GetMD5() []byte {
return m.md5
}
var _ = Describe("Data Manager", func() {
dm := dataManager{}

View File

@@ -1,4 +1,4 @@
package integrationtests
package gquic_test
import (
"bytes"

View File

@@ -0,0 +1 @@
package gquic

View File

@@ -1,4 +1,4 @@
package integrationtests
package gquic_test
import (
"fmt"
@@ -30,7 +30,7 @@ var (
func TestIntegration(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Integration Tests Suite")
RunSpecs(t, "GQuic Tests Suite")
}
var _ = JustBeforeEach(testserver.StartQuicServer)
@@ -42,8 +42,8 @@ func init() {
if !ok {
panic("Failed to get current path")
}
clientPath = filepath.Join(thisfile, fmt.Sprintf("../../../quic-clients/client-%s-debug", runtime.GOOS))
serverPath = filepath.Join(thisfile, fmt.Sprintf("../../../quic-clients/server-%s-debug", runtime.GOOS))
clientPath = filepath.Join(thisfile, fmt.Sprintf("../../../../quic-clients/client-%s-debug", runtime.GOOS))
serverPath = filepath.Join(thisfile, fmt.Sprintf("../../../../quic-clients/server-%s-debug", runtime.GOOS))
http.HandleFunc("/hello", func(w http.ResponseWriter, r *http.Request) {
defer GinkgoRecover()

View File

@@ -1,4 +1,4 @@
package integrationtests
package gquic_test
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package integrationtests
package gquic_test
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package integrationtests
package gquic_test
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package integrationtests
package gquic_test
import (
"crypto/rand"

View File

@@ -1 +0,0 @@
package integrationtests

View File

@@ -4,6 +4,8 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
_ "github.com/lucas-clemente/quic-go/integrationtests/tools/testlog"
"testing"
)