Merge remote-tracking branch 'origin/v1' into merging-from-v1
This commit is contained in:
21
runtests
21
runtests
@@ -38,7 +38,7 @@ def _target(func):
|
||||
@_target
|
||||
def _test():
|
||||
if check_output('go version'.split()).split()[2] < 'go1.2':
|
||||
_run('go test -v .'.split())
|
||||
_run('go test -v .')
|
||||
return
|
||||
|
||||
coverprofiles = []
|
||||
@@ -55,7 +55,7 @@ def _test():
|
||||
])
|
||||
|
||||
combined_name = _combine_coverprofiles(coverprofiles)
|
||||
_run('go tool cover -func={}'.format(combined_name).split())
|
||||
_run('go tool cover -func={}'.format(combined_name))
|
||||
os.remove(combined_name)
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ def _gfmxr():
|
||||
|
||||
@_target
|
||||
def _vet():
|
||||
_run('go vet ./...'.split())
|
||||
_run('go vet ./...')
|
||||
|
||||
|
||||
@_target
|
||||
@@ -101,10 +101,23 @@ def _toc():
|
||||
os.path.join('node_modules', '.bin', 'markdown-toc'),
|
||||
'-i', 'README.md'
|
||||
])
|
||||
_run(['git', 'diff', '--quiet'])
|
||||
_run('git diff --exit-code')
|
||||
|
||||
|
||||
@_target
|
||||
def _gen():
|
||||
go_version = check_output('go version'.split()).split()[2]
|
||||
if go_version < 'go1.4':
|
||||
print('runtests: skip on {}'.format(go_version), file=sys.stderr)
|
||||
return
|
||||
|
||||
_run('go generate ./...')
|
||||
_run('git diff --exit-code')
|
||||
|
||||
|
||||
def _run(command):
|
||||
if hasattr(command, 'split'):
|
||||
command = command.split()
|
||||
print('runtests: {}'.format(' '.join(command)), file=sys.stderr)
|
||||
sys.stderr.flush()
|
||||
check_call(command)
|
||||
|
Reference in New Issue
Block a user