forked from quic-go/quic-go
Move rest of integration tests into the gquic folder
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package integrationtests
|
||||
package gquic_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -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{}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package integrationtests
|
||||
package gquic_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
1
integrationtests/gquic/gquic.go
Normal file
1
integrationtests/gquic/gquic.go
Normal file
@@ -0,0 +1 @@
|
||||
package gquic
|
||||
@@ -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()
|
||||
@@ -1,4 +1,4 @@
|
||||
package integrationtests
|
||||
package gquic_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -1,4 +1,4 @@
|
||||
package integrationtests
|
||||
package gquic_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -1,4 +1,4 @@
|
||||
package integrationtests
|
||||
package gquic_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -1,4 +1,4 @@
|
||||
package integrationtests
|
||||
package gquic_test
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
@@ -1 +0,0 @@
|
||||
package integrationtests
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
_ "github.com/lucas-clemente/quic-go/integrationtests/tools/testlog"
|
||||
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user