Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
091ef25a
Commit
091ef25a
authored
Jan 11, 2012
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go: rely on exit code to tell if test passed
R=adg, dsymonds CC=golang-dev
https://golang.org/cl/5532066
parent
4a6b07f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
test.go
src/cmd/go/test.go
+1
-3
No files found.
src/cmd/go/test.go
View file @
091ef25a
...
...
@@ -440,8 +440,6 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
return
pmainAction
,
runAction
,
printAction
,
nil
}
var
pass
=
[]
byte
(
"
\n
PASS
\n
"
)
// runTest is the action for running a test binary.
func
(
b
*
builder
)
runTest
(
a
*
action
)
error
{
args
:=
[]
string
{
a
.
deps
[
0
]
.
target
}
...
...
@@ -469,7 +467,7 @@ func (b *builder) runTest(a *action) error {
out
,
err
:=
cmd
.
CombinedOutput
()
t1
:=
time
.
Now
()
t
:=
fmt
.
Sprintf
(
"%.3fs"
,
t1
.
Sub
(
t0
)
.
Seconds
())
if
err
==
nil
&&
(
bytes
.
Equal
(
out
,
pass
[
1
:
])
||
bytes
.
HasSuffix
(
out
,
pass
))
{
if
err
==
nil
{
fmt
.
Fprintf
(
a
.
testOutput
,
"ok
\t
%s
\t
%s
\n
"
,
a
.
p
.
ImportPath
,
t
)
if
testShowPass
{
a
.
testOutput
.
Write
(
out
)
...
...
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