Chore: contexify ProxyAdapter ListenPacket
This commit is contained in:
8
test/Makefile
Normal file
8
test/Makefile
Normal file
@ -0,0 +1,8 @@
|
||||
lint:
|
||||
golangci-lint run --disable-all -E govet -E gofumpt -E megacheck ./...
|
||||
|
||||
test:
|
||||
go test -p 1 -v ./...
|
||||
|
||||
benchmark:
|
||||
go test -benchmem -run=^$ -bench .
|
@ -45,7 +45,7 @@ Prerequisite
|
||||
* docker (support Linux and macOS)
|
||||
|
||||
```
|
||||
$ go test -p 1 -v
|
||||
$ make test
|
||||
```
|
||||
|
||||
benchmark (Linux)
|
||||
@ -55,5 +55,5 @@ benchmark (Linux)
|
||||
> (change chunkSize to measure the maximum throughput of clash on your machine)
|
||||
|
||||
```
|
||||
$ go test -benchmem -run=^$ -bench .
|
||||
$ make benchmark
|
||||
```
|
||||
|
@ -96,6 +96,7 @@ func init() {
|
||||
|
||||
images := []string{
|
||||
ImageShadowsocks,
|
||||
ImageShadowsocksRust,
|
||||
ImageVmess,
|
||||
ImageTrojan,
|
||||
ImageSnell,
|
||||
@ -582,7 +583,7 @@ func testSuit(t *testing.T, proxy C.ProxyAdapter) {
|
||||
return
|
||||
}
|
||||
|
||||
pc, err := proxy.DialUDP(&C.Metadata{
|
||||
pc, err := proxy.ListenPacketContext(context.Background(), &C.Metadata{
|
||||
NetWork: C.UDP,
|
||||
DstIP: localIP,
|
||||
DstPort: "10001",
|
||||
@ -595,7 +596,7 @@ func testSuit(t *testing.T, proxy C.ProxyAdapter) {
|
||||
|
||||
assert.NoError(t, testPingPongWithPacketConn(t, pc))
|
||||
|
||||
pc, err = proxy.DialUDP(&C.Metadata{
|
||||
pc, err = proxy.ListenPacketContext(context.Background(), &C.Metadata{
|
||||
NetWork: C.UDP,
|
||||
DstIP: localIP,
|
||||
DstPort: "10001",
|
||||
@ -608,7 +609,7 @@ func testSuit(t *testing.T, proxy C.ProxyAdapter) {
|
||||
|
||||
assert.NoError(t, testLargeDataWithPacketConn(t, pc))
|
||||
|
||||
pc, err = proxy.DialUDP(&C.Metadata{
|
||||
pc, err = proxy.ListenPacketContext(context.Background(), &C.Metadata{
|
||||
NetWork: C.UDP,
|
||||
DstIP: localIP,
|
||||
DstPort: "10001",
|
||||
|
Reference in New Issue
Block a user