Added a Makefile and used for CI.

This commit is contained in:
Zach Klippenstein 2016-05-22 08:10:50 -07:00
parent 02ccca28d2
commit 267feeab14
5 changed files with 23 additions and 8 deletions

View file

@ -5,5 +5,7 @@ go:
- tip - tip
install: install:
# Needed for tip (394ac81) - make get-deps
- go get -t -v ./...
script:
- make test

13
Makefile Normal file
View file

@ -0,0 +1,13 @@
.PHONY: test generate get-deps
test: generate
go test -v -race ./...
generate:
# stringer requires the packages to be installed.
go install -v
go generate -x ./...
get-deps:
go get -t -v ./...
go get -u golang.org/x/tools/cmd/stringer

View file

@ -1,4 +1,4 @@
// generated by stringer -type=deviceDescriptorType; DO NOT EDIT // Code generated by "stringer -type=deviceDescriptorType"; DO NOT EDIT
package adb package adb
@ -9,7 +9,7 @@ const _deviceDescriptorType_name = "DeviceAnyDeviceSerialDeviceUsbDeviceLocal"
var _deviceDescriptorType_index = [...]uint8{0, 9, 21, 30, 41} var _deviceDescriptorType_index = [...]uint8{0, 9, 21, 30, 41}
func (i deviceDescriptorType) String() string { func (i deviceDescriptorType) String() string {
if i < 0 || i+1 >= deviceDescriptorType(len(_deviceDescriptorType_index)) { if i < 0 || i >= deviceDescriptorType(len(_deviceDescriptorType_index)-1) {
return fmt.Sprintf("deviceDescriptorType(%d)", i) return fmt.Sprintf("deviceDescriptorType(%d)", i)
} }
return _deviceDescriptorType_name[_deviceDescriptorType_index[i]:_deviceDescriptorType_index[i+1]] return _deviceDescriptorType_name[_deviceDescriptorType_index[i]:_deviceDescriptorType_index[i+1]]

View file

@ -1,4 +1,4 @@
// generated by stringer -type=DeviceState; DO NOT EDIT // Code generated by "stringer -type=DeviceState"; DO NOT EDIT
package adb package adb
@ -9,7 +9,7 @@ const _DeviceState_name = "StateDisconnectedStateOfflineStateOnline"
var _DeviceState_index = [...]uint8{0, 17, 29, 40} var _DeviceState_index = [...]uint8{0, 17, 29, 40}
func (i DeviceState) String() string { func (i DeviceState) String() string {
if i < 0 || i+1 >= DeviceState(len(_DeviceState_index)) { if i < 0 || i >= DeviceState(len(_DeviceState_index)-1) {
return fmt.Sprintf("DeviceState(%d)", i) return fmt.Sprintf("DeviceState(%d)", i)
} }
return _DeviceState_name[_DeviceState_index[i]:_DeviceState_index[i+1]] return _DeviceState_name[_DeviceState_index[i]:_DeviceState_index[i+1]]

View file

@ -1,4 +1,4 @@
// generated by stringer -type=ErrCode; DO NOT EDIT // Code generated by "stringer -type=ErrCode"; DO NOT EDIT
package util package util
@ -9,7 +9,7 @@ const _ErrCode_name = "AssertionErrorParseErrorServerNotAvailableNetworkErrorCon
var _ErrCode_index = [...]uint8{0, 14, 24, 42, 54, 74, 82, 96, 112} var _ErrCode_index = [...]uint8{0, 14, 24, 42, 54, 74, 82, 96, 112}
func (i ErrCode) String() string { func (i ErrCode) String() string {
if i+1 >= ErrCode(len(_ErrCode_index)) { if i >= ErrCode(len(_ErrCode_index)-1) {
return fmt.Sprintf("ErrCode(%d)", i) return fmt.Sprintf("ErrCode(%d)", i)
} }
return _ErrCode_name[_ErrCode_index[i]:_ErrCode_index[i+1]] return _ErrCode_name[_ErrCode_index[i]:_ErrCode_index[i+1]]