Skip to content

Commit

Permalink
Merge pull request #335 from xaionaro-facebook/master
Browse files Browse the repository at this point in the history
Simplified porting from client4 to nclient4
  • Loading branch information
pmazzini authored Nov 29, 2019
2 parents ec0e015 + 92b156c commit 571b45e
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 70 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sudo: required
go:
- "1.11"
- "1.12"
- "1.13"
- tip

env:
Expand Down
13 changes: 11 additions & 2 deletions .travis/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,23 @@ echo "" > coverage.txt
# tests.
ip a

GO_TEST_OPTS=()
if [[ "$TRAVIS_GO_VERSION" =~ ^1.(9|10|11|12)$ ]]
then
# We use fmt.Errorf with verb "%w" which appeared only in Go1.13.
# So the code compiles and works with Go1.12, but error descriptions
# looks uglier and it does not pass "vet" tests on Go<1.13.
GO_TEST_OPTS+='-vet=off'
fi

for d in $(go list ./... | grep -v vendor); do
go test -race -coverprofile=profile.out -covermode=atomic $d
go test -race -coverprofile=profile.out -covermode=atomic ${GO_TEST_OPTS[@]} $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
# integration tests
go test -c -cover -tags=integration -race -covermode=atomic $d
go test -c -cover -tags=integration -race -covermode=atomic ${GO_TEST_OPTS[@]} $d
testbin="./$(basename $d).test"
# only run it if it was built - i.e. if there are integ tests
test -x "${testbin}" && sudo "./${testbin}" -test.coverprofile=profile.out
Expand Down
1 change: 1 addition & 0 deletions dhcpv4/client4/client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package client4 is deprecated. Use "nclient4" instead.
package client4

import (
Expand Down
Loading

0 comments on commit 571b45e

Please sign in to comment.