Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
aa03e53c
Commit
aa03e53c
authored
Apr 28, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Makefile for Travis tests
parent
c6b983e4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
36 deletions
+37
-36
.gitignore
.gitignore
+4
-0
.travis.yml
.travis.yml
+3
-4
Makefile
Makefile
+4
-1
test-global-coverage.sh
build/test-global-coverage.sh
+26
-0
gocoverage.sh
gocoverage.sh
+0
-31
No files found.
.gitignore
View file @
aa03e53c
...
...
@@ -30,3 +30,7 @@ deploy/osx/Mist\ Installer.dmg
/build/_workspace/
/build/bin/
# travis
profile.tmp
profile.cov
.travis.yml
View file @
aa03e53c
...
...
@@ -4,13 +4,12 @@ go:
before_install
:
-
sudo add-apt-repository ppa:beineri/opt-qt541 -y
-
sudo apt-get update -qq
-
sudo apt-get install -yqq libgmp3-dev
libreadline6-dev
qt54quickcontrols qt54webengine
-
sudo apt-get install -yqq libgmp3-dev qt54quickcontrols qt54webengine
install
:
# - go get code.google.com/p/go.tools/cmd/goimports
# - go get github.com/golang/lint/golint
# - go get golang.org/x/tools/cmd/vet
-
go get golang.org/x/tools/cmd/cover
-
go get github.com/mattn/goveralls
-
go get golang.org/x/tools/cmd/cover github.com/mattn/goveralls
before_script
:
# - gofmt -l -w .
# - goimports -l -w .
...
...
@@ -18,7 +17,7 @@ before_script:
# - go vet ./...
# - go test -race ./...
script
:
-
./gocoverage.sh
-
make travis-test-with-coverage
after_success
:
-
if [ "$COVERALLS_TOKEN" ]; then goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
env
:
...
...
Makefile
View file @
aa03e53c
...
...
@@ -2,7 +2,7 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.
.PHONY
:
geth mist
test
clean
.PHONY
:
geth mist
all test travis-test-with-coverage
clean
GOBIN
=
build/bin
geth
:
...
...
@@ -21,5 +21,8 @@ all:
test
:
all
build/env.sh go
test
./...
travis-test-with-coverage
:
all
build/env.sh build/test-global-coverage.sh
clean
:
rm
-fr
build/_workspace/pkg/ Godeps/_workspace/pkg
$(GOBIN)
/
*
build/test-global-coverage.sh
0 → 100755
View file @
aa03e53c
#!/bin/bash
# This script runs all package tests and merges the resulting coverage
# profiles. Coverage is accounted per package under test.
set
-e
if
[
!
-f
"build/env.sh"
]
;
then
echo
"
$0
must be run from the root of the repository."
exit
2
fi
echo
"mode: count"
>
profile.cov
for
pkg
in
$(
go list ./...
)
;
do
# drop the namespace prefix.
dir
=
${
pkg
##github.com/ethereum/go-ethereum/
}
if
[[
$dir
!=
"tests/vm"
]]
;
then
go
test
-covermode
=
count
-coverprofile
=
$dir
/profile.tmp
$pkg
fi
if
[[
-f
$dir
/profile.tmp
]]
;
then
tail
-n
+2
$dir
/profile.tmp
>>
profile.cov
rm
$dir
/profile.tmp
fi
done
gocoverage.sh
deleted
100755 → 0
View file @
c6b983e4
#!/bin/bash
set
-e
# Add godep workspace to GOPATH. We do it manually instead of using
# 'godep go test' or 'godep restore' so godep doesn't need to be installed.
GOPATH
=
"
$PWD
/Godeps/_workspace:
$GOPATH
"
# Install packages before testing. Not doing this would cause
# 'go test' to recompile all package dependencies before testing each package.
go
install
./...
# Run test coverage on each subdirectories and merge the coverage profile.
echo
"mode: count"
>
profile.cov
# Standard go tooling behavior is to ignore dirs with leading underscors
for
dir
in
$(
find
.
-maxdepth
10
-not
-path
'./.git*'
-not
-path
'*/_*'
-type
d
)
;
do
if
ls
$dir
/
*
.go &> /dev/null
;
then
# echo $dir
if
[[
$dir
!=
"./tests/vm"
&&
$dir
!=
"."
]]
then
go
test
-covermode
=
count
-coverprofile
=
$dir
/profile.tmp
$dir
fi
if
[
-f
$dir
/profile.tmp
]
then
cat
$dir
/profile.tmp |
tail
-n
+2
>>
profile.cov
rm
$dir
/profile.tmp
fi
fi
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment