mirror of
https://github.com/fumiama/water.git
synced 2026-07-02 09:50:25 +08:00
add .travis.yml
This commit is contained in:
12
.travis.yml
Normal file
12
.travis.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
language: go
|
||||||
|
go:
|
||||||
|
- "1.11.4"
|
||||||
|
go_import_path: github.com/songgao/water
|
||||||
|
install: go get -u golang.org/x/lint/golint
|
||||||
|
script: make ci
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: linux
|
||||||
|
dist: xenial
|
||||||
|
- os: osx
|
||||||
23
Makefile
Normal file
23
Makefile
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
.phony: default ci test lint vet gofmt
|
||||||
|
|
||||||
|
|
||||||
|
default:
|
||||||
|
echo 'This make file is for CI.'
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
ci: test lint vet gofmt
|
||||||
|
|
||||||
|
test: water.test
|
||||||
|
sudo ./water.test -test.v
|
||||||
|
|
||||||
|
lint:
|
||||||
|
golint -set_exit_status
|
||||||
|
|
||||||
|
vet:
|
||||||
|
go vet .
|
||||||
|
|
||||||
|
gofmt:
|
||||||
|
gofmt -s -e -l .
|
||||||
|
|
||||||
|
water.test: *.go
|
||||||
|
go test -c
|
||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func startPing(t *testing.T, dst net.IP) {
|
func startPing(t *testing.T, dst net.IP) {
|
||||||
if err := exec.Command("ping", "-c", "2", dst.String()).Start(); err != nil {
|
if err := exec.Command("ping", "-c", "4", dst.String()).Start(); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func startBroadcast(t *testing.T, dst net.IP) {
|
func startBroadcast(t *testing.T, dst net.IP) {
|
||||||
if err := exec.Command("ping", "-b", "-c", "2", dst.String()).Start(); err != nil {
|
if err := exec.Command("ping", "-b", "-c", "4", dst.String()).Start(); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user